Last active
September 3, 2024 04:21
-
-
Save HashNuke/f9f74c68168af26c1440a1f18e563cf4 to your computer and use it in GitHub Desktop.
Emoji-powered IRB prompts to differentiate between Rails environments
This file contains hidden or 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 this to the .irbrc file in the rails app directory | |
| # | |
| rails_env = "🤗" | |
| if ENV['RAILS_ENV'] == 'production' | |
| rails_env = "🥶" | |
| elsif ENV['RAILS_ENV'] == 'staging' | |
| rails_env = "🧘" | |
| end | |
| IRB.conf[:PROMPT][:RAILS_APP] = { | |
| :PROMPT_I=>"#{rails_env} %N(%m):%03n> ", | |
| :PROMPT_S=>"#{rails_env} %N(%m):%03n%l ", | |
| :PROMPT_C=>"#{rails_env} %N(%m):%03n* ", | |
| :RETURN=>"#{rails_env} => %s\n" | |
| } | |
| IRB.conf[:PROMPT_MODE] = :RAILS_APP |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment