Rubygems 2.0
# File lib/bundler/rubygems_integration.rb, line 656 def all_specs Gem::Specification.to_a end
# File lib/bundler/rubygems_integration.rb, line 705 def build(spec, skip_validation = false) require "rubygems/package" Gem::Package.build(spec, skip_validation) end
# File lib/bundler/rubygems_integration.rb, line 684 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
# File lib/bundler/rubygems_integration.rb, line 675 def fetch_all_remote_specs(remote) source = remote.uri.is_a?(URI) ? remote.uri : URI.parse(source.to_s) specs = fetch_specs(source, remote, "specs") pres = fetch_specs(source, remote, "prerelease_specs") || [] specs.concat(pres) end
# File lib/bundler/rubygems_integration.rb, line 664 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
# File lib/bundler/rubygems_integration.rb, line 660 def find_name(name) Gem::Specification.find_all_by_name name end
# File lib/bundler/rubygems_integration.rb, line 698 def gem_from_path(path, policy = nil) require "rubygems/package" p = Gem::Package.new(path) p.security_policy = policy if policy p end
# File lib/bundler/rubygems_integration.rb, line 691 def gem_remote_fetcher require "resolv" proxy = configuration[:http_proxy] dns = Resolv::DNS.new Bundler::GemRemoteFetcher.new(proxy, dns) end
# File lib/bundler/rubygems_integration.rb, line 710 def repository_subdirectories Gem::REPOSITORY_SUBDIRECTORIES end
# File lib/bundler/rubygems_integration.rb, line 648 def stub_rubygems(specs) Gem::Specification.all = specs Gem.post_reset do Gem::Specification.all = specs end end