[rubygems/rubygems] Improve grammar of some error messages

https://github.com/rubygems/rubygems/commit/558a4765c7
This commit is contained in:
David Rodríguez 2025-03-12 18:38:10 +01:00 committed by Hiroshi SHIBATA
parent bb1b5877a7
commit 4e1df25b15
Notes: git 2025-03-24 04:25:32 +00:00
3 changed files with 6 additions and 5 deletions

View File

@ -539,8 +539,9 @@ module Bundler
reason = resolve_needed? ? change_reason : "some dependencies were deleted from your gemfile"
msg = String.new
msg << "#{reason.capitalize.strip}, but the lockfile can't be updated because #{update_refused_reason}"
msg = String.new("#{reason.capitalize.strip}, but ")
msg << "the lockfile " unless msg.start_with?("Your lockfile")
msg << "can't be updated because #{update_refused_reason}"
msg << "\n\nYou have added to the Gemfile:\n" << added.join("\n") if added.any?
msg << "\n\nYou have deleted from the Gemfile:\n" << deleted.join("\n") if deleted.any?
msg << "\n\nYou have changed in the Gemfile:\n" << changed.join("\n") if changed.any?

View File

@ -321,7 +321,7 @@ RSpec.describe "install in deployment or frozen mode" do
L
bundle :install, env: { "BUNDLE_FROZEN" => "true" }, raise_on_error: false, artifice: "compact_index"
expect(err).to include("Your lockfile is missing \"bar\", but the lockfile can't be updated because frozen mode is set")
expect(err).to include("Your lockfile is missing \"bar\", but can't be updated because frozen mode is set")
end
it "explodes if a path gem is missing" do
@ -550,7 +550,7 @@ RSpec.describe "install in deployment or frozen mode" do
pristine_system_gems :bundler
bundle "config set --local deployment true"
bundle "install --verbose"
expect(out).not_to include("but the lockfile can't be updated because frozen mode is set")
expect(out).not_to include("can't be updated because frozen mode is set")
expect(out).not_to include("You have added to the Gemfile")
expect(out).not_to include("You have deleted from the Gemfile")
expect(out).to include("vendor/cache/foo")

View File

@ -1683,7 +1683,7 @@ end
RUBY
end
expect(err).to include("Your lockfile does not include the current platform, but the lockfile can't be updated because file system is read-only")
expect(err).to include("Your lockfile does not include the current platform, but can't be updated because file system is read-only")
end
end
end