Skip to content

Instantly share code, notes, and snippets.

@dolzenko
Forked from kogakure/gist:3187467
Created July 15, 2016 11:09
Show Gist options
  • Save dolzenko/7c76d6b594ba6a2c68266b58bd83275b to your computer and use it in GitHub Desktop.
Save dolzenko/7c76d6b594ba6a2c68266b58bd83275b 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