Rubygems 2.0
# File lib/bundler/rubygems_integration.rb, line 444 def all_specs Gem::Specification.to_a end
# File lib/bundler/rubygems_integration.rb, line 476 def build(spec) require 'rubygems/package' Gem::Package.build(spec) end
# File lib/bundler/rubygems_integration.rb, line 452 def fetch_all_remote_specs fetched, errors = Gem::SpecFetcher.new.available_specs(:complete) # only raise if we don't get any specs back. # this means we still work if prerelease_specs.4.8.gz # don't exist but specs.4.8.gz do if fetched.empty? && error = errors.detect {|e| e.is_a?(Gem::SourceFetchProblem) } raise Gem::RemoteFetcher::FetchError.new(error.error, error.source) end hash = {} fetched.each do |source, tuples| hash[source.uri] = tuples.map { |tuple| tuple.to_a } end hash end
# File lib/bundler/rubygems_integration.rb, line 448 def find_name(name) Gem::Specification.find_all_by_name name end
# File lib/bundler/rubygems_integration.rb, line 469 def gem_from_path(path, policy = nil) require 'rubygems/package' p = Gem::Package.new(path) p.security_policy = policy if policy return p end
# File lib/bundler/rubygems_integration.rb, line 436 def stub_rubygems(specs) Gem::Specification.all = specs Gem.post_reset { Gem::Specification.all = specs } end