Skip to content

Instantly share code, notes, and snippets.

@RafaelChefe
Last active October 27, 2015 11:33
Show Gist options
  • Save RafaelChefe/8888164ff1fcfa93603a to your computer and use it in GitHub Desktop.
Save RafaelChefe/8888164ff1fcfa93603a to your computer and use it in GitHub Desktop.
# color and syntax reference:
# http://misc.flogisoft.com/bash/tip_colors_and_formatting
if defined?(Rails)
colors = HashWithIndifferentAccess.new({
development: 32, # green
test: 33, # yellow
production: 31 # red
})
env_name = Rails.env == "production" ? Rails.env.upcase : Rails.env
dir = File.basename(Dir.pwd)
Pry.config.prompt_name = "\e[#{colors[Rails.env]}m#{dir} #{env_name} \e[0m"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment