Files
metasploit-gs/config/boot.rb
T
Luke Imhoff 78e6c3a65b Fix merge error
While helping Dave Maloney port the changes from lib/msfenv.rb to
config/boot.rb for the Gemfile.local support, I failed to notice that
root was only defined in the unless block when it is needed no matter
what.
2014-06-20 14:32:29 -05:00

40 lines
755 B
Ruby

require 'pathname'
require 'rubygems'
GEMFILE_EXTENSIONS = [
'.local',
''
]
msfenv_real_pathname = Pathname.new(__FILE__).realpath
root = msfenv_real_pathname.parent.parent
unless ENV['BUNDLE_GEMFILE']
require 'pathname'
GEMFILE_EXTENSIONS.each do |extension|
extension_pathname = root.join("Gemfile#{extension}")
if extension_pathname.readable?
ENV['BUNDLE_GEMFILE'] = extension_pathname.to_path
break
end
end
end
begin
require 'bundler'
rescue LoadError
$stderr.puts "[*] Metasploit requires the Bundler gem to be installed"
$stderr.puts " $ gem install bundler"
exit(0)
end
Bundler.setup
lib_path = root.join('lib').to_path
unless $LOAD_PATH.include? lib_path
$LOAD_PATH.unshift lib_path
end