Skip to content

Instantly share code, notes, and snippets.

@glasses618
Created June 26, 2020 02:49
Show Gist options
  • Save glasses618/d07930e83d095bdb98effd43630d4005 to your computer and use it in GitHub Desktop.
Save glasses618/d07930e83d095bdb98effd43630d4005 to your computer and use it in GitHub Desktop.
pry prompt before v0.13.0
# config/initializers/pry.rb
# Show red environment name in pry prompt for non development environments
unless Rails.env.development?
old_prompt = Pry.config.prompt
env = Pry::Helpers::Text.red(Rails.env.upcase)
Pry.config.prompt = [
proc {|*a| "#{env} #{old_prompt.first.call(*a)}"},
proc {|*a| "#{env} #{old_prompt.second.call(*a)}"},
]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment