mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Remove support for rails server RAILS_ENV=env-name
This commit is contained in:
parent
cdd6d9b53a
commit
dce0afd47f
2 changed files with 2 additions and 7 deletions
|
@ -32,11 +32,6 @@ module Rails
|
||||||
|
|
||||||
opt_parser.parse! args
|
opt_parser.parse! args
|
||||||
|
|
||||||
# Handle's environment like RAILS_ENV=production passed in directly
|
|
||||||
if index = args.index {|arg| arg.include?("RAILS_ENV")}
|
|
||||||
options[:environment] ||= args.delete_at(index).split('=').last
|
|
||||||
end
|
|
||||||
|
|
||||||
options[:server] = args.shift
|
options[:server] = args.shift
|
||||||
options
|
options
|
||||||
end
|
end
|
||||||
|
|
|
@ -4,14 +4,14 @@ require 'rails/commands/server'
|
||||||
class Rails::ServerTest < ActiveSupport::TestCase
|
class Rails::ServerTest < ActiveSupport::TestCase
|
||||||
|
|
||||||
def test_environment_with_server_option
|
def test_environment_with_server_option
|
||||||
args = ["thin", "RAILS_ENV=production"]
|
args = ["thin", "-e", "production"]
|
||||||
options = Rails::Server::Options.new.parse!(args)
|
options = Rails::Server::Options.new.parse!(args)
|
||||||
assert_equal 'production', options[:environment]
|
assert_equal 'production', options[:environment]
|
||||||
assert_equal 'thin', options[:server]
|
assert_equal 'thin', options[:server]
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_environment_without_server_option
|
def test_environment_without_server_option
|
||||||
args = ["RAILS_ENV=production"]
|
args = ["-e", "production"]
|
||||||
options = Rails::Server::Options.new.parse!(args)
|
options = Rails::Server::Options.new.parse!(args)
|
||||||
assert_equal 'production', options[:environment]
|
assert_equal 'production', options[:environment]
|
||||||
assert_nil options[:server]
|
assert_nil options[:server]
|
||||||
|
|
Loading…
Reference in a new issue