Skip to content

Instantly share code, notes, and snippets.

@loopj
Created September 21, 2012 02:13
Show Gist options
  • Select an option

  • Save loopj/3759405 to your computer and use it in GitHub Desktop.

Select an option

Save loopj/3759405 to your computer and use it in GitHub Desktop.
Show red environment name in pry prompt for non development environments
# Put this in an initializer
old_prompt = Pry.config.prompt
Pry.config.prompt = [
proc {|a,b,c| "\e[31m#{(Rails.env.upcase)}\e[0m #{old_prompt.first.call(a,b,c)}"},
proc {|a,b,c| "\e[31m#{(Rails.env.upcase)}\e[0m #{old_prompt.second.call(a,b,c)}"},
] unless Rails.env.development?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment