Skip to content

Instantly share code, notes, and snippets.

@carsontang
Created April 18, 2013 15:29
Show Gist options
  • Save carsontang/5413656 to your computer and use it in GitHub Desktop.
Save carsontang/5413656 to your computer and use it in GitHub Desktop.
irbrc
if Rails.env
rails_env = Rails.env.production? ? 'PROD' : Rails.env[0...3].downcase
current_app = Dir.pwd.split('/').last.capitalize
IRB.conf[:PROMPT].reverse_merge!(:RAILS_ENV => {:PROMPT_I=>"#{current_app} #{rails_env} >> ", :PROMPT_N=>"#{current_app} #{rails_env} >> ", :PROMPT_S=>nil, :PROMPT_C=>"?> ", :RETURN=>"=> %s\n"})
IRB.conf[:PROMPT_MODE] = :RAILS_ENV
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment