16d7a9315b
This reverts commit6494603510, reversing changes made to5d3b8f8030. By defining the missing constant early in startup we can force reline to detect Fiddle as version '0.0.0' when the class is provide by a Ruby 2.x implementation that has an documented version.
59 lines
1.3 KiB
Ruby
59 lines
1.3 KiB
Ruby
require 'fiddle'
|
|
Fiddle.const_set(:VERSION, '0.0.0') unless Fiddle.const_defined?(:VERSION)
|
|
|
|
require 'rails'
|
|
require File.expand_path('../boot', __FILE__)
|
|
|
|
all_environments = [
|
|
:development,
|
|
:production,
|
|
:test
|
|
]
|
|
|
|
Bundler.require(
|
|
*Rails.groups(
|
|
coverage: [:test],
|
|
db: all_environments,
|
|
pcap: all_environments
|
|
)
|
|
)
|
|
|
|
#
|
|
# Railties
|
|
#
|
|
|
|
# For compatibility with jquery-rails (and other engines that need action_view) in pro
|
|
require 'action_controller/railtie'
|
|
require 'action_view/railtie'
|
|
|
|
#
|
|
# Project
|
|
#
|
|
|
|
require 'metasploit/framework/common_engine'
|
|
require 'metasploit/framework/database'
|
|
module Metasploit
|
|
module Framework
|
|
class Application < Rails::Application
|
|
include Metasploit::Framework::CommonEngine
|
|
|
|
config.paths['log'] = "#{Msf::Config.log_directory}/#{Rails.env}.log"
|
|
config.paths['config/database'] = [Metasploit::Framework::Database.configurations_pathname.try(:to_path)]
|
|
config.autoloader = :zeitwerk
|
|
|
|
case Rails.env
|
|
when "development"
|
|
config.eager_load = false
|
|
when "test"
|
|
config.eager_load = false
|
|
when "production"
|
|
config.eager_load = true
|
|
end
|
|
end
|
|
end
|
|
end
|
|
|
|
# Silence warnings about this defaulting to true
|
|
I18n.enforce_available_locales = true
|
|
require 'msfenv'
|