Merge pull request #105 from rapid7/bug/MSP-10684-electro-installers

MSP-10684 Allow declaring root via env var in gemspecs
bug/bundler_fix
Brandon Turner 2014-07-16 16:51:46 -05:00
commit ff017f83f7
1 changed files with 11 additions and 3 deletions

View File

@ -1,7 +1,15 @@
# coding: utf-8
# have to use realpath as metasploit-framework is often loaded through a symlink and tools like Coverage and debuggers
# require realpaths.
lib = File.realpath(File.expand_path('../lib', __FILE__))
# During build, the Gemfile is temporarily moved and
# we must manually define the project root
if ENV['MSF_ROOT']
lib = File.realpath(File.expand_path('lib', ENV['MSF_ROOT']))
else
# have to use realpath as metasploit-framework is often loaded through a symlink and tools like Coverage and debuggers
# require realpaths.
lib = File.realpath(File.expand_path('../lib', __FILE__))
end
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'metasploit/framework/version'