diff options
| author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2019-04-04 17:01:19 +0200 |
|---|---|---|
| committer | David RodrÃguez <deivid.rodriguez@riseup.net> | 2019-04-19 21:09:12 +0900 |
| commit | cf9a2883fea3c28c8d869c72b1b407162a28e0b3 (patch) | |
| tree | 99789b969cc63394e49ca145be3f456c339cb12f /lib/bundler/rubygems_integration.rb | |
| parent | e107f3f4cb2e11ef6fd46db21392a22fdab4eb2a (diff) | |
| download | bundler-cf9a2883fea3c28c8d869c72b1b407162a28e0b3.tar.gz | |
Prefer `require_relative` for internal requires
Due to the way rubygems monkey-patched require interacts with default
gems, and given that bundler is a default gem, and that bundler
manipulates the LOAD_PATH in very intricated ways, we can reduce the
risk of "leaking" to a different copy of `bundler` by using
`require_relative` for internal requires.
Diffstat (limited to 'lib/bundler/rubygems_integration.rb')
| -rw-r--r-- | lib/bundler/rubygems_integration.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/bundler/rubygems_integration.rb b/lib/bundler/rubygems_integration.rb index ca7dd32611..6d93ed6fa1 100644 --- a/lib/bundler/rubygems_integration.rb +++ b/lib/bundler/rubygems_integration.rb @@ -111,7 +111,7 @@ module Bundler end def configuration - require "bundler/psyched_yaml" + require_relative "psyched_yaml" Gem.configuration rescue Gem::SystemExitException, LoadError => e Bundler.ui.error "#{e.class}: #{e.message}" @@ -261,7 +261,7 @@ module Bundler def spec_from_gem(path, policy = nil) require "rubygems/security" - require "bundler/psyched_yaml" + require_relative "psyched_yaml" gem_from_path(path, security_policies[policy]).spec rescue Gem::Package::FormatError raise GemspecError, "Could not read gem at #{path}. It may be corrupted." @@ -686,7 +686,7 @@ module Bundler def use_gemdeps(gemfile) ENV["BUNDLE_GEMFILE"] ||= File.expand_path(gemfile) - require "bundler/gemdeps" + require_relative "gemdeps" runtime = Bundler.setup Bundler.ui = nil activated_spec_names = runtime.requested_specs.map(&:to_spec).sort_by(&:name) |
