1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[rubygems/rubygems] Simplify instantiating the gem version promoter

https://github.com/rubygems/rubygems/commit/c4e2737f2c
This commit is contained in:
David Rodríguez 2022-08-24 10:17:04 +02:00 committed by git
parent 6a21d196ba
commit dce73c8616

View file

@ -106,6 +106,7 @@ module Bundler
@locked_gems = nil
@locked_deps = {}
@locked_specs = SpecSet.new([])
@originally_locked_specs = @locked_specs
@locked_sources = []
@locked_platforms = []
end
@ -149,18 +150,7 @@ module Bundler
end
def gem_version_promoter
@gem_version_promoter ||= begin
locked_specs =
if unlocking? && @locked_specs.empty? && !@lockfile_contents.empty?
# Definition uses an empty set of locked_specs to indicate all gems
# are unlocked, but GemVersionPromoter needs the locked_specs
# for conservative comparison.
Bundler::SpecSet.new(@locked_gems.specs)
else
@locked_specs
end
GemVersionPromoter.new(locked_specs, @unlock[:gems])
end
@gem_version_promoter ||= GemVersionPromoter.new(@originally_locked_specs, @unlock[:gems])
end
def resolve_only_locally!