diff options
author | Samuel E. Giddins <segiddins@segiddins.me> | 2015-04-19 23:16:45 -0700 |
---|---|---|
committer | Samuel E. Giddins <segiddins@segiddins.me> | 2015-04-19 23:16:45 -0700 |
commit | 633fdb11ccd1755ee8a52496497c915898d5c77c (patch) | |
tree | 6dc5f8067ef2ff419c2b7098f2c9979b0e8b822d | |
parent | cd36aa6bfbf8e1fc4425b4099186812459c62a27 (diff) | |
download | bundler-633fdb11ccd1755ee8a52496497c915898d5c77c.tar.gz |
Use specification stubs with RubyGems 2.1+ when constructing the local index
-rw-r--r-- | lib/bundler/remote_specification.rb | 16 | ||||
-rw-r--r-- | lib/bundler/rubygems_integration.rb | 8 |
2 files changed, 24 insertions, 0 deletions
diff --git a/lib/bundler/remote_specification.rb b/lib/bundler/remote_specification.rb index c80eaa40fc..ec971487cb 100644 --- a/lib/bundler/remote_specification.rb +++ b/lib/bundler/remote_specification.rb @@ -54,4 +54,20 @@ module Bundler end end end + + class StubSpecification < RemoteSpecification + def self.from_stub(stub) + spec = new(stub.name, stub.version, stub.platform, nil) + spec.stub = stub + spec + end + + attr_accessor :stub + + private + + def _remote_specification + stub.to_spec + end + end end diff --git a/lib/bundler/rubygems_integration.rb b/lib/bundler/rubygems_integration.rb index 3c6c658299..8250b2fd9f 100644 --- a/lib/bundler/rubygems_integration.rb +++ b/lib/bundler/rubygems_integration.rb @@ -561,12 +561,20 @@ module Bundler end end + # RubyGems 2.1.0 class MoreFuture < Future def initialize super backport_ext_builder_monitor end + def all_specs + require 'bundler/remote_specification' + Gem::Specification.stubs.map do |stub| + StubSpecification.from_stub(stub) + end + end + def backport_ext_builder_monitor require 'rubygems/ext' |