Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Commit

Permalink
don't unnecessarily fetch all specs
Browse files Browse the repository at this point in the history
  • Loading branch information
hone committed Aug 4, 2011
1 parent c9c9828 commit b466264
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions lib/bundler/source.rb
Expand Up @@ -222,12 +222,17 @@ def remote_specs
idx.use @fetchers[uri].specs(dependency_names, self)
end

# need to fetch again for cross repo deps
unmet_dependency_names = idx.unmet_dependency_names

if unmet_dependency_names.any?
@fetchers.values.select {|fetcher| fetcher.has_api }.each do |fetcher|
idx.use fetcher.specs(unmet_dependency_names, self)
# don't need to fetch all specifications for every gem/version on
# the rubygems repo if there's no api endpoints to search over
api_fetchers = @fetchers.values.select {|fetcher| fetcher.has_api }
if api_fetchers.any?
# this will fetch all the specifications on the rubygems repo
unmet_dependency_names = idx.unmet_dependency_names

if unmet_dependency_names.any?
@fetchers.values.select {|fetcher| fetcher.has_api }.each do |fetcher|
idx.use fetcher.specs(unmet_dependency_names, self)
end
end
end

Expand Down

0 comments on commit b466264

Please sign in to comment.