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

ruby-changes:73864

From: David <ko1@a...>
Date: Thu, 6 Oct 2022 05:13:53 +0900 (JST)
Subject: [ruby-changes:73864] 358fe26b31 (master): [rubygems/rubygems] Fix little UI issue when bundler shows duplicated gems in a list

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

From 358fe26b31c25033cc1857a4b44634f51d0ee354 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?David=20Rodr=C3=ADguez?= <deivid.rodriguez@r...>
Date: Mon, 3 Oct 2022 12:10:05 +0200
Subject: [rubygems/rubygems] Fix little UI issue when bundler shows duplicated
 gems in a list

https://github.com/rubygems/rubygems/commit/3f71d882e9
---
 lib/bundler/definition.rb               |  2 +-
 spec/bundler/bundler/definition_spec.rb | 18 ++++++++++++++++++
 2 files changed, 19 insertions(+), 1 deletion(-)

diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb
index a46d7387de..21db42f772 100644
--- a/lib/bundler/definition.rb
+++ b/lib/bundler/definition.rb
@@ -140,7 +140,7 @@ module Bundler https://github.com/ruby/ruby/blob/trunk/lib/bundler/definition.rb#L140
         @unlock[:gems] ||= @dependencies.map(&:name)
       else
         eager_unlock = expand_dependencies(@unlock[:gems] || [], true)
-        @unlock[:gems] = @locked_specs.for(eager_unlock, false, platforms).map(&:name)
+        @unlock[:gems] = @locked_specs.for(eager_unlock, false, platforms).map(&:name).uniq
       end
 
       @dependency_changes = converge_dependencies
diff --git a/spec/bundler/bundler/definition_spec.rb b/spec/bundler/bundler/definition_spec.rb
index 13688c2b3d..e7235a4e78 100644
--- a/spec/bundler/bundler/definition_spec.rb
+++ b/spec/bundler/bundler/definition_spec.rb
@@ -82,6 +82,24 @@ RSpec.describe Bundler::Definition do https://github.com/ruby/ruby/blob/trunk/spec/bundler/bundler/definition_spec.rb#L82
       G
     end
 
+    it "with an explicit update" do
+      build_repo4 do
+        build_gem("ffi", "1.9.23") {|s| s.platform = "java" }
+        build_gem("ffi", "1.9.23")
+      end
+
+      gemfile <<-G
+        source "#{file_uri_for(gem_repo4)}"
+        gem "ffi"
+      G
+
+      bundle "lock --add-platform java"
+
+      bundle "update ffi", :env => { "DEBUG" => "1" }
+
+      expect(out).to match(/because bundler is unlocking gems: \(ffi\)/)
+    end
+
     it "for a path gem with deps and no changes" do
       build_lib "foo", "1.0", :path => lib_path("foo") do |s|
         s.add_dependency "rack", "1.0"
-- 
cgit v1.2.1


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

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