mirror of
https://github.com/rapid7/metasploit-framework
synced 2024-10-29 18:07:27 +01:00
149c3ecc63
* --ask option ported to new location * --version option now works * MSF version updated * All specs passing
40 lines
755 B
Ruby
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
|