Files
metasploit-gs/lib/msfenv.rb
T

20 lines
722 B
Ruby
Raw Normal View History

2012-04-15 23:35:38 -05:00
#
2013-01-08 22:58:45 -06:00
# Use bundler to load dependencies
2012-04-15 23:35:38 -05:00
#
2014-05-12 15:37:59 -05:00
# Override the normal rails default, so that msfconsole will come up in production mode instead of development mode
# unless the `--environment` flag is passed.
ENV['RAILS_ENV'] ||= 'production'
require 'pathname'
root = Pathname.new(__FILE__).expand_path.parent.parent
config = root.join('config')
require config.join('boot')
2014-06-02 12:41:22 -05:00
# Requiring environment will define the Metasploit::Framework::Application as the one and only Rails::Application in
# this process and cause an error if a Rails.application is already defined, such as when loading msfenv through
# msfconsole in Metasploit Pro.
unless defined?(Rails) && !Rails.application.nil?
require config.join('environment')
end