Created
June 26, 2020 02:49
-
-
Save glasses618/d07930e83d095bdb98effd43630d4005 to your computer and use it in GitHub Desktop.
pry prompt before v0.13.0
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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