Skip to content

Instantly share code, notes, and snippets.

@HashNuke
Last active September 3, 2024 04:21
Show Gist options
  • Save HashNuke/f9f74c68168af26c1440a1f18e563cf4 to your computer and use it in GitHub Desktop.
Save HashNuke/f9f74c68168af26c1440a1f18e563cf4 to your computer and use it in GitHub Desktop.

Revisions

  1. HashNuke renamed this gist Sep 3, 2024. 1 changed file with 5 additions and 3 deletions.
    8 changes: 5 additions & 3 deletions irbrc-emoji-prompts.rb → irbrc-emoji-prompts.md
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,6 @@
    # Add this to the .irbrc file in the rails app directory
    #
    Add this to the .irbrc file in the rails app directory.

    ```ruby
    rails_env = "🤗"
    if ENV['RAILS_ENV'] == 'production'
    rails_env = "🥶"
    @@ -13,4 +14,5 @@
    :PROMPT_C=>"#{rails_env} %N(%m):%03n* ",
    :RETURN=>"#{rails_env} => %s\n"
    }
    IRB.conf[:PROMPT_MODE] = :RAILS_APP
    IRB.conf[:PROMPT_MODE] = :RAILS_APP
    ```
  2. HashNuke renamed this gist Sep 3, 2024. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  3. HashNuke renamed this gist Sep 3, 2024. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  4. HashNuke created this gist Sep 3, 2024.
    16 changes: 16 additions & 0 deletions .irbrc
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,16 @@
    # 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