diff options
Diffstat (limited to 'lib/bundler/fetcher.rb')
-rw-r--r-- | lib/bundler/fetcher.rb | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/lib/bundler/fetcher.rb b/lib/bundler/fetcher.rb index a453157e68..89103fe1ec 100644 --- a/lib/bundler/fetcher.rb +++ b/lib/bundler/fetcher.rb @@ -129,17 +129,15 @@ module Bundler specs = fetchers.last.specs(gem_names) else specs = [] - fetchers.shift until fetchers.first.available? || fetchers.empty? - fetchers.dup.each do |f| - break unless f.api_fetcher? && !gem_names || !specs = f.specs(gem_names) - fetchers.delete(f) + @fetchers = fetchers.drop_while do |f| + !f.available? || (f.api_fetcher? && !gem_names) || !specs = f.specs(gem_names) end @use_api = false if fetchers.none?(&:api_fetcher?) end specs.each do |name, version, platform, dependencies, metadata| spec = if dependencies - EndpointSpecification.new(name, version, platform, dependencies, metadata) + EndpointSpecification.new(name, version, platform, self, dependencies, metadata) else RemoteSpecification.new(name, version, platform, self) end @@ -272,8 +270,7 @@ module Bundler # cached gem specification path, if one exists def gemspec_cached_path(spec_file_name) paths = Bundler.rubygems.spec_cache_dirs.map {|dir| File.join(dir, spec_file_name) } - paths = paths.select {|path| File.file? path } - paths.first + paths.find {|path| File.file? path } end HTTP_ERRORS = [ @@ -301,8 +298,6 @@ module Bundler store end - private - def remote_uri @remote.uri end |