1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Added one-letter aliases for the three default environments to script/console, so script/console p will load the production environment (t for test, d for development) [DHH]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5655 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
David Heinemeier Hansson 2006-12-01 00:08:33 +00:00
parent cd2be89b7c
commit 9040f40682
2 changed files with 10 additions and 1 deletions

View file

@ -1,5 +1,7 @@
*SVN*
* Added one-letter aliases for the three default environments to script/console, so script/console p will load the production environment (t for test, d for development) [DHH]
* Fixed that script/server running against Mongrel should tail the proper log regardless of the environment [DHH]
* Update initializer to load Rails::VERSION as soon as possible. Closes #6698. [Nicholas Seckar]

View file

@ -15,7 +15,14 @@ libs << " -r console_app"
libs << " -r console_sandbox" if options[:sandbox]
libs << " -r console_with_helpers"
ENV['RAILS_ENV'] = ARGV.first || ENV['RAILS_ENV'] || 'development'
ENV['RAILS_ENV'] = case ARGV.first
when "p": "production"
when "d": "development"
when "t": "test"
else
ARGV.first || ENV['RAILS_ENV'] || 'development'
end
if options[:sandbox]
puts "Loading #{ENV['RAILS_ENV']} environment in sandbox."
puts "Any modifications you make will be rolled back on exit."