-
-
Save dolzenko/7c76d6b594ba6a2c68266b58bd83275b to your computer and use it in GitHub Desktop.
Ruby: Colorized irb prompt for production: ~/.irbrc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# .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