diff options
author | Samuel Giddins <segiddins@segiddins.me> | 2017-04-07 12:02:47 -0500 |
---|---|---|
committer | Samuel Giddins <segiddins@segiddins.me> | 2017-04-07 12:03:15 -0500 |
commit | 7c1549eaa091211cca355a0452a348e8b2052582 (patch) | |
tree | 3cb16e9c89466d71f54d7e05ac4e0485c0463912 /lib/bundler/stub_specification.rb | |
parent | 7cb108d62bad5448a7e7b3b9c12717747ad41ca5 (diff) | |
download | bundler-7c1549eaa091211cca355a0452a348e8b2052582.tar.gz |
[StubSpecification] Move availability logic to RubygemsIntegration
Diffstat (limited to 'lib/bundler/stub_specification.rb')
-rw-r--r-- | lib/bundler/stub_specification.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/bundler/stub_specification.rb b/lib/bundler/stub_specification.rb index a9c79a03f5..6f94de7b10 100644 --- a/lib/bundler/stub_specification.rb +++ b/lib/bundler/stub_specification.rb @@ -48,8 +48,10 @@ module Bundler stub.loaded_from end - def matches_for_glob(glob) - stub.matches_for_glob(glob) + if Bundler.rubygems.stubs_provide_full_functionality? + def matches_for_glob(glob) + stub.matches_for_glob(glob) + end end def raw_require_paths @@ -69,7 +71,7 @@ module Bundler rs = stub.to_spec if rs.equal?(self) # happens when to_spec gets the spec from Gem.loaded_specs rs = Gem::Specification.load(loaded_from) - stub.instance_variable_set(:@spec, rs) + Bundler.rubygems.stub_set_spec(stub, rs) end unless rs |