[rubygems/rubygems] Fix little UI issue when bundler shows duplicated gems in a list

https://github.com/rubygems/rubygems/commit/3f71d882e9
This commit is contained in:
David Rodríguez 2022-10-03 12:10:05 +02:00 committed by git
parent 139e79e5a9
commit 358fe26b31
2 changed files with 19 additions and 1 deletions

View File

@ -140,7 +140,7 @@ module Bundler
@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

View File

@ -82,6 +82,24 @@ RSpec.describe Bundler::Definition do
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"