summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2019-07-11 11:02:35 +0200
committerDavid Rodríguez <deivid.rodriguez@riseup.net>2019-07-11 11:02:35 +0200
commit3810f9945ce17c180e8375af46eb75059d68de91 (patch)
tree6a2e7826bee2c7d144af01c17b018f2a08501baa
parent847db56c6b5d2156d27990d73a9949507693985a (diff)
downloadbundler-3810f9945ce17c180e8375af46eb75059d68de91.tar.gz
No need to make `Gem.refresh` a noop
The rubygems integration sets up a `post_reset` hook that resets the specs back to what bundler knows after `Gem::Specification.reset` is called (which is what `Gem.refresh` calls under the hood).
-rw-r--r--lib/bundler/rubygems_integration.rb8
-rw-r--r--spec/runtime/setup_spec.rb2
2 files changed, 1 insertions, 9 deletions
diff --git a/lib/bundler/rubygems_integration.rb b/lib/bundler/rubygems_integration.rb
index 734ac91bd9..15771e6c0a 100644
--- a/lib/bundler/rubygems_integration.rb
+++ b/lib/bundler/rubygems_integration.rb
@@ -441,13 +441,6 @@ module Bundler
end
end
- # Because Bundler has a static view of what specs are available,
- # we don't #refresh, so stub it out.
- def replace_refresh
- gem_class = (class << Gem; self; end)
- redefine_method(gem_class, :refresh) {}
- end
-
# Replace or hook into RubyGems to provide a bundlerized view
# of the world.
def replace_entrypoints(specs)
@@ -468,7 +461,6 @@ module Bundler
replace_gem(specs, specs_by_name)
stub_rubygems(specs)
replace_bin_path(specs_by_name)
- replace_refresh
Gem.clear_paths
end
diff --git a/spec/runtime/setup_spec.rb b/spec/runtime/setup_spec.rb
index 3866bebb44..562085bbe4 100644
--- a/spec/runtime/setup_spec.rb
+++ b/spec/runtime/setup_spec.rb
@@ -845,7 +845,7 @@ end
end
end
- it "stubs out Gem.refresh so it does not reveal system gems" do
+ it "does not reveal system gems even when Gem.refresh is called" do
system_gems "rack-1.0.0"
install_gemfile <<-G