|
1 | 1 | #
|
2 |
| -# Shim load the bundled gem cache if the environment is set |
| 2 | +# Use bundler to load dependencies |
3 | 3 | #
|
4 | 4 |
|
5 |
| -_msf_gemcache = false |
6 |
| - |
7 |
| -# If the bundle option is explicitly set, load the gemcache |
8 |
| -unless ENV['MSF_BUNDLE_GEMS'].to_s.downcase =~ /^[nf0]/ # NO/FALSE/0 |
9 |
| - require 'msf/env/gemcache' |
10 |
| - _msf_gemcache = true |
11 |
| -else |
12 |
| - # If the bundle option is empty and this looks like an installer environment |
13 |
| - # also load the gem cache (but probably not the binary gem cache) |
14 |
| - if ENV['MSF_BUNDLE_GEMS'].to_s.length == 0 and |
15 |
| - ::File.exists?( File.join( File.dirname(__FILE__), "..", "..", "properties.ini") ) and |
16 |
| - ::File.directory?( File.join( File.dirname(__FILE__), "..", "..", "apps", "pro") ) |
17 |
| - require 'msf/env/gemcache' |
18 |
| - _msf_gemcache = true |
19 |
| - end |
20 |
| -end |
21 |
| - |
22 |
| -if not _msf_gemcache |
23 |
| - # The user is running outside of the installer environment and not using |
24 |
| - # our bundled gemset, so we fallback on bundler instead |
25 |
| - ENV['BUNDLE_GEMFILE'] ||= ::File.expand_path(::File.join(::File.dirname(__FILE__), "..", "Gemfile")) |
26 |
| - begin |
27 |
| - require 'bundler/setup' |
28 |
| - rescue ::LoadError |
29 |
| - $stderr.puts "[*] Metasploit requires the Bundler gem to be installed in development mode" |
30 |
| - $stderr.puts " $ rvmsudo gem install bundler" |
31 |
| - exit(0) |
32 |
| - end |
| 5 | +ENV['BUNDLE_GEMFILE'] ||= ::File.expand_path(::File.join(::File.dirname(__FILE__), "..", "Gemfile")) |
| 6 | +begin |
| 7 | + require 'bundler/setup' |
| 8 | +rescue ::LoadError |
| 9 | + $stderr.puts "[*] Metasploit requires the Bundler gem to be installed" |
| 10 | + $stderr.puts " $ gem install bundler" |
| 11 | + exit(0) |
33 | 12 | end
|
0 commit comments