[前][次][番号順一覧][スレッド一覧]

ruby-changes:73528

From: David <ko1@a...>
Date: Mon, 12 Sep 2022 22:13:43 +0900 (JST)
Subject: [ruby-changes:73528] dce73c8616 (master): [rubygems/rubygems] Simplify instantiating the gem version promoter

https://git.ruby-lang.org/ruby.git/commit/?id=dce73c8616

From dce73c8616eb2e91cb0330c9b32f3edf8e771a67 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?David=20Rodr=C3=ADguez?= <deivid.rodriguez@r...>
Date: Wed, 24 Aug 2022 10:17:04 +0200
Subject: [rubygems/rubygems] Simplify instantiating the gem version promoter

https://github.com/rubygems/rubygems/commit/c4e2737f2c
---
 lib/bundler/definition.rb | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)

diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb
index 79369ec374..a46d7387de 100644
--- a/lib/bundler/definition.rb
+++ b/lib/bundler/definition.rb
@@ -106,6 +106,7 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/definition.rb#L106
         @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 https://github.com/ruby/ruby/blob/trunk/lib/bundler/definition.rb#L150
     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!
-- 
cgit v1.2.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]