[rubygems/rubygems] Refactor ambiguous gems check

a00c79a4da
This commit is contained in:
David Rodríguez 2022-03-25 20:57:43 +01:00 committed by git
parent 7e1788e180
commit d5288c8aad

View file

@ -157,9 +157,7 @@ module Bundler
# by rubygems.org are broken and wrong. # by rubygems.org are broken and wrong.
if spec.remote if spec.remote
# Check for this spec from other sources # Check for this spec from other sources
uris = [spec.remote.anonymized_uri] uris = [spec.remote, *remotes_for_spec(spec)].map(&:anonymized_uri).uniq
uris += remotes_for_spec(spec).map(&:anonymized_uri)
uris.uniq!
Installer.ambiguous_gems << [spec.name, *uris] if uris.length > 1 Installer.ambiguous_gems << [spec.name, *uris] if uris.length > 1
path = fetch_gem(spec, options[:previous_spec]) path = fetch_gem(spec, options[:previous_spec])