This project is archived and is in readonly mode.

#2641 ✓wontfix
Gravis

Display RAILS_ENV in script/console

Reported by Gravis | May 13th, 2009 @ 02:10 PM | in 2.x

to avoid stupid errors (yes, we all need some sleep sometimes), I think we should display the current env in the rails console.

I've set this in my .irbrc file :

# Prompts
IRB.conf[:PROMPT][:CUSTOM] = { 
  :PROMPT_N => "[#{ENV["RAILS_ENV"].capitalize}]>> ",
  :PROMPT_I => "[#{ENV["RAILS_ENV"].capitalize}]>> ",
  :PROMPT_S => nil,
  :PROMPT_C => "?> ",
  :RETURN => "=> %s\n"
}   

# Set default prompt
IRB.conf[:PROMPT_MODE] = :CUSTOM

So it displays :

[Development]>> 1+1
=> 2

Maybe this could be included in ./railties/lib/commands/console.rb ?

Thanks

Comments and changes to this ticket

  • Pratik

    Pratik May 17th, 2009 @ 01:28 PM

    • State changed from “new” to “wontfix”

    I don't really see much value keeping this in core. 99% times people are always on the development shell.

    Thanks.

  • Gravis

    Gravis May 17th, 2009 @ 01:31 PM

    "99% times people are always on the development shell." Wow, are you sure ? Am I the only person to use the console in staging / preproduction / production mode ?

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

People watching this ticket

Pages