-
-
Save Intrepidd/af2bb4ed825817ecb044a5e93fc52f4d to your computer and use it in GitHub Desktop.
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
# Add color coding based on Rails environment for safety | |
# edited by cveneziani | |
if defined? Rails | |
banner = if Rails.env.production? || Rails.env.staging? | |
"\e[41;97;1m #{Rails.env} \e[0m " | |
else | |
"\e[42;97;1m #{Rails.env} \e[0m " | |
end | |
Pry.config.prompt_name = banner | |
end |
Bonjour 👋
Fabulous, I didn't know anything about pry prompts, your solution is much simpler, I'll update my gist !
Sam same, I didn't know about pry prompts. I discovered the prompt_name
while investigating the stack level too deep 😃
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi there,
I tried to play a bit with this snippet and if you have the same code within a
~/.pryrc
and a project's.pryrc
, we end up with a stack level too deep error at line 14.What about the following code?