Skip to content

Instantly share code, notes, and snippets.

@kogakure
Forked from edennis/gist:3187189
Created July 27, 2012 11:21
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save kogakure/3187467 to your computer and use it in GitHub Desktop.
Save kogakure/3187467 to your computer and use it in GitHub Desktop.
Ruby: Colorized irb prompt for production: ~/.irbrc
# .irbrc
if defined?(Rails) && Rails.production?
conf = IRB.conf[:PROMPT][IRB.conf[:PROMPT_MODE]]
red = "\033[0;31m"
reset = "\033[0m"
[:PROMPT_S, :PROMPT_C].each do |p|
conf[p].gsub!(/^(.*)$/, "#{red}\\1#{reset}")
end
conf[:PROMPT_I] = "#{red}%N(%m):%03n:%i (PRODUCTION) > #{reset}"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment