Skip to content

Instantly share code, notes, and snippets.

@sohocoke
Created October 5, 2011 16:59
Show Gist options
  • Save sohocoke/1265005 to your computer and use it in GitHub Desktop.
Save sohocoke/1265005 to your computer and use it in GitHub Desktop.
Show ruby version in irb prmopt
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