Skip to content

Instantly share code, notes, and snippets.

@Intrepidd

Intrepidd/.pryrc Secret

Last active July 7, 2023 17:55
Show Gist options
  • Save Intrepidd/af2bb4ed825817ecb044a5e93fc52f4d to your computer and use it in GitHub Desktop.
Save Intrepidd/af2bb4ed825817ecb044a5e93fc52f4d to your computer and use it in GitHub Desktop.
# 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
@cveneziani
Copy link

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