summaryrefslogtreecommitdiff
path: root/spec/support/rubygems_ext.rb
diff options
context:
space:
mode:
authorBundlerbot <bot@bundler.io>2019-11-11 16:51:13 +0000
committerDavid Rodríguez <deivid.rodriguez@riseup.net>2019-11-11 23:17:08 +0100
commitdb79526704d76fc69027f94332a811387cf483e2 (patch)
tree5bce1d9ad0baa4a93ed4df7d60a7c47c963fde08 /spec/support/rubygems_ext.rb
parent27ae25003bb410c42d313a6e2b216b94495bebeb (diff)
downloadbundler-db79526704d76fc69027f94332a811387cf483e2.tar.gz
Merge #7434
7434: More lazy loading and relative requires r=deivid-rodriguez a=deivid-rodriguez ### What was the end-user problem that led to this PR? The problem was that testing the latest version of bundler as a vendored copy inside rubygems surfaced some more issues about requiring the wrong code, or activating default gems too early. ### What was your diagnosis of the problem? My diagnosis was that we should follow similar techniques I've used in other PRs: delay as much as possible requiring default gems, and don't rely on the LOAD_PATH for internal requires. ### What is your fix for the problem, implemented in this PR? My fix does just that, and also removes a bunch of `require`'s that were not necessary at all. Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net> (cherry picked from commit 147b9aa079f531ba5bf216d6d694fce5d36cfbfc)
Diffstat (limited to 'spec/support/rubygems_ext.rb')
-rw-r--r--spec/support/rubygems_ext.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/spec/support/rubygems_ext.rb b/spec/support/rubygems_ext.rb
index 1093362d81..8c5dff880b 100644
--- a/spec/support/rubygems_ext.rb
+++ b/spec/support/rubygems_ext.rb
@@ -1,7 +1,6 @@
# frozen_string_literal: true
require_relative "path"
-require "fileutils"
module Spec
module Rubygems
@@ -50,6 +49,8 @@ module Spec
end
def setup
+ require "fileutils"
+
Gem.clear_paths
ENV["BUNDLE_PATH"] = nil