class Bundler::RubygemsIntegration::Future
Rubygems 2.0
Public Instance Methods
all_specs()
click to toggle source
# File lib/bundler/rubygems_integration.rb, line 561 def all_specs Gem::Specification.to_a end
build(spec, skip_validation = false)
click to toggle source
# File lib/bundler/rubygems_integration.rb, line 616 def build(spec, skip_validation = false) require "rubygems/package" Gem::Package.build(spec, skip_validation) end
download_gem(spec, uri, path)
click to toggle source
# File lib/bundler/rubygems_integration.rb, line 595 def download_gem(spec, uri, path) uri = Bundler.settings.mirror_for(uri) fetcher = gem_remote_fetcher fetcher.headers = { "X-Gemfile-Source" => spec.remote.original_uri.to_s } if spec.remote.original_uri fetcher.download(spec, uri, path) end
fetch_all_remote_specs(remote)
click to toggle source
# File lib/bundler/rubygems_integration.rb, line 580 def fetch_all_remote_specs(remote) # Since SpecFetcher now returns NameTuples, we just fetch directly # and unmarshal the array ourselves. hash = {} source = remote.uri source = URI.parse(source.to_s) unless source.is_a?(URI) hash[source] = fetch_specs(source, remote, "specs") pres = fetch_specs(source, remote, "prerelease_specs") hash[source].push(*pres) if pres && !pres.empty? hash end
fetch_specs(source, remote, name)
click to toggle source
# File lib/bundler/rubygems_integration.rb, line 569 def fetch_specs(source, remote, name) path = source + "#{name}.#{Gem.marshal_version}.gz" fetcher = gem_remote_fetcher fetcher.headers = { "X-Gemfile-Source" => remote.original_uri.to_s } if remote.original_uri string = fetcher.fetch_path(path) Bundler.load_marshal(string) rescue Gem::RemoteFetcher::FetchError => e # it's okay for prerelease to fail raise e unless name == "prerelease_specs" end
find_name(name)
click to toggle source
# File lib/bundler/rubygems_integration.rb, line 565 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 609 def gem_from_path(path, policy = nil) require "rubygems/package" p = Gem::Package.new(path) p.security_policy = policy if policy p end
gem_remote_fetcher()
click to toggle source
# File lib/bundler/rubygems_integration.rb, line 602 def gem_remote_fetcher require "resolv" proxy = configuration[:http_proxy] dns = Resolv::DNS.new Bundler::GemRemoteFetcher.new(proxy, dns) end
repository_subdirectories()
click to toggle source
# File lib/bundler/rubygems_integration.rb, line 621 def repository_subdirectories Gem::REPOSITORY_SUBDIRECTORIES end
stub_rubygems(specs)
click to toggle source
# File lib/bundler/rubygems_integration.rb, line 553 def stub_rubygems(specs) Gem::Specification.all = specs Gem.post_reset do Gem::Specification.all = specs end end