Permalink
Browse files

Merge pull request #773 from charliesome/reduce-api_set-requests

Reduce APISet requests
  • Loading branch information...
drbrain committed Feb 6, 2014
2 parents ec6be17 + 234d1c6 commit ccde1e0e2e4dba6a7e0951aab37b70b9a93429db
Showing with 7 additions and 2 deletions.
  1. +1 −0 lib/rubygems/remote_fetcher.rb
  2. +4 −0 lib/rubygems/resolver/installer_set.rb
  3. +2 −2 lib/rubygems/source.rb
@@ -232,6 +232,7 @@ def fetch_http uri, last_modified = nil, head = false, depth = 0
case response
when Net::HTTPOK, Net::HTTPNotModified then
+ response.uri = uri
head ? response : response.body
when Net::HTTPMovedPermanently, Net::HTTPFound, Net::HTTPSeeOther,
Net::HTTPTemporaryRedirect then
@@ -146,6 +146,10 @@ def find_all req
res
end
+ def prefetch(reqs)
+ @remote_set.prefetch(reqs)
+ end
+
def inspect # :nodoc:
always_install = @always_install.map { |s| s.full_name }
View
@@ -82,11 +82,11 @@ def dependency_resolver_set # :nodoc:
begin
fetcher = Gem::RemoteFetcher.fetcher
- fetcher.fetch_path bundler_api_uri, nil, true
+ response = fetcher.fetch_path bundler_api_uri, nil, true
rescue Gem::RemoteFetcher::FetchError
Gem::Resolver::IndexSet.new self
else
- Gem::Resolver::APISet.new bundler_api_uri
+ Gem::Resolver::APISet.new response.uri
end
end

0 comments on commit ccde1e0

Please sign in to comment.