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

Fix console to accept [environment] [options] as specified in docs.

This commit is contained in:
Emilio Tagua 2011-04-14 23:00:28 -03:00
parent 3d44e45758
commit 434d75705f

View file

@ -51,6 +51,6 @@ module Rails
end
# Has to set the RAILS_ENV before config/application is required
if ARGV.first && !ARGV.first.index("-") && env = ARGV.pop # has to pop the env ARGV so IRB doesn't freak
if ARGV.first && !ARGV.first.index("-") && env = ARGV.shift # has to shift the env ARGV so IRB doesn't freak
ENV['RAILS_ENV'] = %w(production development test).detect {|e| e =~ /^#{env}/} || env
end