Created
October 5, 2011 16:59
-
-
Save sohocoke/1265005 to your computer and use it in GitHub Desktop.
Show ruby version in irb prmopt
This file contains 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
if (defined?(RUBY_ENGINE) && RUBY_ENGINE == 'macruby') | |
IRB::Formatter::DEFAULT_PROMPT = "#{ver} #{IRB::Formatter::DEFAULT_PROMPT}" | |
else | |
my_prompt = IRB.conf[:PROMPT][:DEFAULT].inject({}) do |r, (k,v)| | |
r[k] = "#{ver} #{v}" | |
r | |
end | |
IRB.conf[:PROMPT][:MY_PROMPT] = my_prompt | |
IRB.conf[:PROMPT_MODE] = :MY_PROMPT | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment