Allow RAILS_ENV to override default environment of 'production'

MSP-10964
bug/bundler_fix
Luke Imhoff 2014-07-31 13:24:23 -05:00
parent 38c6e2d3e0
commit aa2e26f8f2
No known key found for this signature in database
GPG Key ID: 5B1FB01FB33356F8
1 changed files with 4 additions and 2 deletions

View File

@ -85,14 +85,16 @@ class Metasploit::Framework::ParsedOptions::Base
options.database.disable = false
options.database.migrations_paths = []
# If RAILS_ENV is set, then it will be used, but if RAILS_ENV is set and the --environment option is given, then
# --environment value will be used to reset ENV[RAILS_ENV].
options.environment = ENV['RAILS_ENV'] || DEFAULT_ENVIRONMENT
options.framework = ActiveSupport::OrderedOptions.new
options.framework.config = nil
options.modules = ActiveSupport::OrderedOptions.new
options.modules.path = nil
options.environment = DEFAULT_ENVIRONMENT
@options = options
end