Skip to content

Instantly share code, notes, and snippets.

@edennis
Created July 27, 2012 09:55
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save edennis/3187189 to your computer and use it in GitHub Desktop.
Save edennis/3187189 to your computer and use it in GitHub Desktop.
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