[rubygems/rubygems] Show missing spec in lockfile incomplete error message

https://github.com/rubygems/rubygems/commit/b86caaa3d5
This commit is contained in:
David Rodríguez 2023-06-09 23:42:20 +02:00 committed by Hiroshi SHIBATA
parent 21238f38a8
commit 2ff9b7b93d
2 changed files with 6 additions and 6 deletions

View File

@ -146,7 +146,7 @@ module Bundler
@dependency_changes = converge_dependencies @dependency_changes = converge_dependencies
@local_changes = converge_locals @local_changes = converge_locals
@incomplete_lockfile = check_missing_lockfile_specs @missing_lockfile_dep = check_missing_lockfile_dep
end end
def gem_version_promoter def gem_version_promoter
@ -474,7 +474,7 @@ module Bundler
private :sources private :sources
def nothing_changed? def nothing_changed?
!@source_changes && !@dependency_changes && !@new_platform && !@path_changes && !@local_changes && !@incomplete_lockfile !@source_changes && !@dependency_changes && !@new_platform && !@path_changes && !@local_changes && !@missing_lockfile_dep
end end
def no_resolve_needed? def no_resolve_needed?
@ -615,7 +615,7 @@ module Bundler
[@new_platform, "you added a new platform to your gemfile"], [@new_platform, "you added a new platform to your gemfile"],
[@path_changes, "the gemspecs for path gems changed"], [@path_changes, "the gemspecs for path gems changed"],
[@local_changes, "the gemspecs for git local gems changed"], [@local_changes, "the gemspecs for git local gems changed"],
[@incomplete_lockfile, "your lock file is missing some gems"], [@missing_lockfile_dep, "your lock file is missing \"#{@missing_lockfile_dep}\""],
].select(&:first).map(&:last).join(", ") ].select(&:first).map(&:last).join(", ")
end end
@ -670,7 +670,7 @@ module Bundler
!sources_with_changes.each {|source| @unlock[:sources] << source.name }.empty? !sources_with_changes.each {|source| @unlock[:sources] << source.name }.empty?
end end
def check_missing_lockfile_specs def check_missing_lockfile_dep
all_locked_specs = @locked_specs.map(&:name) << "bundler" all_locked_specs = @locked_specs.map(&:name) << "bundler"
missing = @locked_specs.select do |s| missing = @locked_specs.select do |s|
@ -680,7 +680,7 @@ module Bundler
if missing.any? if missing.any?
@locked_specs.delete(missing) @locked_specs.delete(missing)
true missing.first.name
else else
false false
end end

View File

@ -1371,7 +1371,7 @@ RSpec.describe "the lockfile format" do
L L
bundle "install --verbose" bundle "install --verbose"
expect(out).to include("re-resolving dependencies because your lock file is missing some gems") expect(out).to include("re-resolving dependencies because your lock file is missing \"minitest-bisect\"")
expect(lockfile).to eq <<~L expect(lockfile).to eq <<~L
GEM GEM