class Bundler::RubygemsIntegration::Future

Rubygems 2.0

Public Instance Methods

all_specs() click to toggle source
# File lib/bundler/rubygems_integration.rb, line 444
def all_specs
  Gem::Specification.to_a
end
build(spec) click to toggle source
# File lib/bundler/rubygems_integration.rb, line 476
def build(spec)
  require 'rubygems/package'
  Gem::Package.build(spec)
end
fetch_all_remote_specs() click to toggle source
# 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
find_name(name) click to toggle source
# File lib/bundler/rubygems_integration.rb, line 448
def find_name(name)
  Gem::Specification.find_all_by_name name
end
gem_from_path(path, policy = nil) click to toggle source
# 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
stub_rubygems(specs) click to toggle source
# File lib/bundler/rubygems_integration.rb, line 436
def stub_rubygems(specs)
  Gem::Specification.all = specs

  Gem.post_reset {
    Gem::Specification.all = specs
  }
end