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
c4e2737f2c
This commit is contained in:
parent
6a21d196ba
commit
dce73c8616
1 changed files with 2 additions and 12 deletions
|
@ -106,6 +106,7 @@ module Bundler
|
||||||
@locked_gems = nil
|
@locked_gems = nil
|
||||||
@locked_deps = {}
|
@locked_deps = {}
|
||||||
@locked_specs = SpecSet.new([])
|
@locked_specs = SpecSet.new([])
|
||||||
|
@originally_locked_specs = @locked_specs
|
||||||
@locked_sources = []
|
@locked_sources = []
|
||||||
@locked_platforms = []
|
@locked_platforms = []
|
||||||
end
|
end
|
||||||
|
@ -149,18 +150,7 @@ module Bundler
|
||||||
end
|
end
|
||||||
|
|
||||||
def gem_version_promoter
|
def gem_version_promoter
|
||||||
@gem_version_promoter ||= begin
|
@gem_version_promoter ||= GemVersionPromoter.new(@originally_locked_specs, @unlock[:gems])
|
||||||
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
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def resolve_only_locally!
|
def resolve_only_locally!
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue