From 6362bfdc337c1929a381734ded417b796f9767bf Mon Sep 17 00:00:00 2001 From: Martin Emde Date: Sun, 3 Sep 2023 08:17:16 -0700 Subject: [rubygems/rubygems] rename Index#== to Index#subset? https://github.com/rubygems/rubygems/commit/a96a561087 --- lib/bundler/definition.rb | 3 +-- lib/bundler/index.rb | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb index 5c605c47ac..9d13c18d37 100644 --- a/lib/bundler/definition.rb +++ b/lib/bundler/definition.rb @@ -657,8 +657,7 @@ module Bundler locked_index = Index.new locked_index.use(@locked_specs.select {|s| source.can_lock?(s) }) - # order here matters, since Index#== is checking source.specs.include?(locked_index) - locked_index != source.specs + !locked_index.subset?(source.specs) rescue PathError, GitError => e Bundler.ui.debug "Assuming that #{source} has not changed since fetching its specs errored (#{e})" false diff --git a/lib/bundler/index.rb b/lib/bundler/index.rb index 6a17d45eaf..df46facc88 100644 --- a/lib/bundler/index.rb +++ b/lib/bundler/index.rb @@ -145,8 +145,7 @@ module Bundler end # Whether all the specs in self are in other - # TODO: rename to #include? - def ==(other) + def subset?(other) all? do |spec| other_spec = other[spec].first other_spec && dependencies_eql?(spec, other_spec) && spec.source == other_spec.source -- cgit v1.2.3