diff options
author | André Arko <mail@arko.net> | 2015-04-29 21:10:29 -0700 |
---|---|---|
committer | André Arko <mail@arko.net> | 2015-04-29 21:10:29 -0700 |
commit | a2cd3b38ec5f77f6ea8ce78f2272bbfe48e152f4 (patch) | |
tree | 406e7971bd8d1e498ace1276f90377c69a3ab1b9 | |
parent | b10636fbf2c8defdb5cebb444d1f86e8d17fe0af (diff) | |
parent | f9b259221792643ce0aac8884fab262385238c8b (diff) | |
download | bundler-a2cd3b38ec5f77f6ea8ce78f2272bbfe48e152f4.tar.gz |
Merge pull request #3580 from bundler/seg-stubs
Use specification stubs with RubyGems 2.1+ when constructing the local i...
-rw-r--r-- | lib/bundler/remote_specification.rb | 20 | ||||
-rw-r--r-- | lib/bundler/rubygems_integration.rb | 8 |
2 files changed, 28 insertions, 0 deletions
diff --git a/lib/bundler/remote_specification.rb b/lib/bundler/remote_specification.rb index c80eaa40fc..456686dc0f 100644 --- a/lib/bundler/remote_specification.rb +++ b/lib/bundler/remote_specification.rb @@ -54,4 +54,24 @@ 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 + + def to_yaml + _remote_specification.to_yaml + end + + 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 e82311b3de..ee39fd7ff0 100644 --- a/lib/bundler/rubygems_integration.rb +++ b/lib/bundler/rubygems_integration.rb @@ -574,12 +574,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' |