lib/bundler/source/rubygems.rb in bundler-1.7.7 vs lib/bundler/source/rubygems.rb in bundler-1.7.8

- old
+ new

@@ -81,13 +81,12 @@ # Download the gem to get the spec, because some specs that are returned # by rubygems.org are broken and wrong. if spec.source_uri # Check for this spec from other sources - uris = [spec.source_uri] + uris = [spec.source_uri.without_credentials] uris += source_uris_for_spec(spec) - uris.compact! uris.uniq! Installer.ambiguous_gems << [spec.name, *uris] if uris.length > 1 s = Bundler.rubygems.spec_from_gem(fetch_gem(spec), Bundler.settings["trust-policy"]) spec.__swap__(s) @@ -184,18 +183,19 @@ else [] end end - protected + private def source_uris_for_spec(spec) - specs.search_all(spec.name).map{|s| s.source_uri } + specs.search_all(spec.name).inject([]) do |uris, spec| + uris << spec.source_uri.without_credentials if spec.source_uri + uris + end end - private - def cached_gem(spec) cached_gem = cached_path(spec) unless cached_gem raise Bundler::GemNotFound, "Could not find #{spec.file_name} for installation" end @@ -328,10 +328,10 @@ end end def fetch_gem(spec) return false unless spec.source_uri - Fetcher.download_gem_from_uri(spec, spec.source_uri) + Fetcher.download_gem_from_uri(spec, spec.source_uri.original_uri) end def builtin_gem?(spec) # Ruby 2.1, where all included gems have this summary return true if spec.summary =~ /is bundled with Ruby/