diff options
author | Samuel Giddins <segiddins@segiddins.me> | 2018-09-27 09:20:58 -0700 |
---|---|---|
committer | David RodrÃguez <deivid.rodriguez@riseup.net> | 2020-03-10 17:47:39 +0100 |
commit | 627b2e2d56db1daffa76a98c215b3d4a7c64c027 (patch) | |
tree | b178cf2518598b934d94dcb629684fa901a4aee8 | |
parent | 143f900ab4fd89b2e87f2ca2eb9456dac182f855 (diff) | |
download | bundler-627b2e2d56db1daffa76a98c215b3d4a7c64c027.tar.gz |
Only check for infinite loop on #missing_extensions?
-rw-r--r-- | lib/bundler/stub_specification.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/bundler/stub_specification.rb b/lib/bundler/stub_specification.rb index deaa7905c9..2333a4318a 100644 --- a/lib/bundler/stub_specification.rb +++ b/lib/bundler/stub_specification.rb @@ -36,7 +36,7 @@ module Bundler # This is defined directly to avoid having to load every installed spec def missing_extensions? - stub.missing_extensions? + stub(true).missing_extensions? end def activated @@ -82,8 +82,8 @@ module Bundler # from `Gem.loaded_specs`, which can end up being self. # #_remote_specification has logic to handle this case, so delegate to that in that situation, # because otherwise we can end up with a stack overflow when calling #missing_extensions? - def stub - if @_remote_specification.nil? && @stub.instance_variable_get(:@data) && Gem.loaded_specs[name].equal?(self) + def stub(check = false) + if check && @_remote_specification.nil? && @stub.instance_variable_get(:@data) && Gem.loaded_specs[name].equal?(self) _remote_specification end @stub @@ -95,7 +95,7 @@ module Bundler @_remote_specification ||= begin rs = @stub.to_spec if rs.equal?(self) # happens when to_spec gets the spec from Gem.loaded_specs - rs = Gem::Specification.load(@stub.loaded_from) + rs = Bundler.load_gemspec(@stub.loaded_from) Bundler.rubygems.stub_set_spec(@stub, rs) end |