Skip to content

Commit

Permalink
Update gemspec to use require_relative
Browse files Browse the repository at this point in the history
  • Loading branch information
adfoster-r7 committed May 23, 2024
1 parent 50a220b commit d231ecb
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions metasploit-framework.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@
# we must manually define the project root
if ENV['MSF_ROOT']
lib = File.realpath(File.expand_path('lib', ENV['MSF_ROOT']))
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'metasploit/framework/version'
require 'metasploit/framework/rails_version_constraint'
require 'msf/util/helper'
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__))
# XXX: Use explicit calls to require_relative to ensure that static analysis tools such as dependabot work
require_relative 'lib/metasploit/framework/version'
require_relative 'lib/metasploit/framework/rails_version_constraint'
require_relative 'lib/msf/util/helper'
end

$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
require 'metasploit/framework/version'
require 'metasploit/framework/rails_version_constraint'
require 'msf/util/helper'

Gem::Specification.new do |spec|
spec.name = 'metasploit-framework'
spec.version = Metasploit::Framework::GEM_VERSION
Expand Down

0 comments on commit d231ecb

Please sign in to comment.