diff --git a/Library/Homebrew/cask/cmd/upgrade.rb b/Library/Homebrew/cask/cmd/upgrade.rb index 2c4b98691d..9200926973 100644 --- a/Library/Homebrew/cask/cmd/upgrade.rb +++ b/Library/Homebrew/cask/cmd/upgrade.rb @@ -143,7 +143,7 @@ module Cask verb = dry_run ? "Would upgrade" : "Upgrading" oh1 "#{verb} #{outdated_casks.count} outdated #{::Utils.pluralize("package", - outdated_casks.count)}:" + outdated_casks.count)}:" caught_exceptions = [] diff --git a/Library/Homebrew/cleanup.rb b/Library/Homebrew/cleanup.rb index 6c6e73f687..3964dc5a4b 100644 --- a/Library/Homebrew/cleanup.rb +++ b/Library/Homebrew/cleanup.rb @@ -585,7 +585,7 @@ module Homebrew verb = dry_run ? "Would autoremove" : "Autoremoving" oh1 "#{verb} #{formulae_names.count} unneeded #{Utils.pluralize("formula", formulae_names.count, - plural: "e")}:" + plural: "e")}:" puts formulae_names.join("\n") return if dry_run diff --git a/Library/Homebrew/cli/parser.rb b/Library/Homebrew/cli/parser.rb index fc6f15bd8f..ea9a898200 100644 --- a/Library/Homebrew/cli/parser.rb +++ b/Library/Homebrew/cli/parser.rb @@ -685,7 +685,7 @@ module Homebrew .to_sentence two_words_connector: " or ", last_word_connector: " or " "This command does not take more than #{maximum} #{arg_types} #{Utils.pluralize("argument", - maximum)}." + maximum)}." end end end @@ -700,7 +700,7 @@ module Homebrew .to_sentence two_words_connector: " or ", last_word_connector: " or " super "This command requires at least #{minimum} #{arg_types} #{Utils.pluralize("argument", - minimum)}." + minimum)}." end end @@ -714,7 +714,7 @@ module Homebrew .to_sentence two_words_connector: " or ", last_word_connector: " or " super "This command requires exactly #{minimum} #{arg_types} #{Utils.pluralize("argument", - minimum)}." + minimum)}." end end end diff --git a/Library/Homebrew/cmd/developer.rb b/Library/Homebrew/cmd/developer.rb index aebe05654e..03d0561573 100755 --- a/Library/Homebrew/cmd/developer.rb +++ b/Library/Homebrew/cmd/developer.rb @@ -40,8 +40,8 @@ module Homebrew case args.named.first when nil, "state" if env_vars.any? - puts "Developer mode is enabled because #{env_vars.to_sentence} #{Utils.pluralize("", - env_vars.count, plural: "are", singular: "is")} set." + verb = Utils.pluralize("", env_vars.count, plural: "are", singular: "is") + puts "Developer mode is enabled because #{env_vars.to_sentence} #{verb} set." elsif Homebrew::Settings.read("devcmdrun") == "true" puts "Developer mode is enabled." else diff --git a/Library/Homebrew/cmd/update-report.rb b/Library/Homebrew/cmd/update-report.rb index fceb705f08..69efca25f3 100644 --- a/Library/Homebrew/cmd/update-report.rb +++ b/Library/Homebrew/cmd/update-report.rb @@ -200,7 +200,7 @@ module Homebrew unless updated_taps.empty? auto_update_header args: args puts "Updated #{updated_taps.count} #{Utils.pluralize("tap", - updated_taps.count)} (#{updated_taps.to_sentence})." + updated_taps.count)} (#{updated_taps.to_sentence})." updated = true end @@ -612,13 +612,13 @@ class ReporterHub if outdated_formulae.positive? msg += "#{Tty.bold}#{outdated_formulae}#{Tty.reset} outdated #{Utils.pluralize("formula", - outdated_formulae, plural: "e")}" + outdated_formulae, plural: "e")}" end if outdated_casks.positive? msg += " and " if msg.present? msg += "#{Tty.bold}#{outdated_casks}#{Tty.reset} outdated #{Utils.pluralize("cask", - outdated_casks)}" + outdated_casks)}" end return if msg.blank? diff --git a/Library/Homebrew/cmd/upgrade.rb b/Library/Homebrew/cmd/upgrade.rb index 9927c5ffcf..9016bc9706 100644 --- a/Library/Homebrew/cmd/upgrade.rb +++ b/Library/Homebrew/cmd/upgrade.rb @@ -181,7 +181,7 @@ module Homebrew else verb = args.dry_run? ? "Would upgrade" : "Upgrading" oh1 "#{verb} #{formulae_to_install.count} outdated #{Utils.pluralize("package", - formulae_to_install.count)}:" + formulae_to_install.count)}:" formulae_upgrades = formulae_to_install.map do |f| if f.optlinked? "#{f.full_specified_name} #{Keg.new(f.opt_prefix).version} -> #{f.pkg_version}" diff --git a/Library/Homebrew/dev-cmd/audit.rb b/Library/Homebrew/dev-cmd/audit.rb index 356b8f13b1..e37b5d7f23 100644 --- a/Library/Homebrew/dev-cmd/audit.rb +++ b/Library/Homebrew/dev-cmd/audit.rb @@ -282,7 +282,7 @@ module Homebrew error_sources = [] if formula_count.positive? error_sources << "#{formula_count} #{Utils.pluralize("formula", formula_count, - plural: "e")}" + plural: "e")}" end error_sources << "#{cask_count} #{Utils.pluralize("cask", cask_count)}" if cask_count.positive? error_sources << "#{tap_count} #{Utils.pluralize("tap", tap_count)}" if tap_count.positive? @@ -293,7 +293,7 @@ module Homebrew if corrected_problem_count.positive? errors_summary += ", #{corrected_problem_count} #{Utils.pluralize("problem", - corrected_problem_count)} corrected" + corrected_problem_count)} corrected" end ofail errors_summary diff --git a/Library/Homebrew/livecheck/strategy/json.rb b/Library/Homebrew/livecheck/strategy/json.rb index a6353ddd58..91a7fbe30f 100644 --- a/Library/Homebrew/livecheck/strategy/json.rb +++ b/Library/Homebrew/livecheck/strategy/json.rb @@ -100,7 +100,7 @@ module Homebrew ).returns(T::Hash[Symbol, T.untyped]) } def self.find_versions(url:, regex: nil, provided_content: nil, homebrew_curl: false, **_unused, &block) - raise ArgumentError, "#{T.must(name).demodulize} requires a `strategy` block" if block.blank? + raise ArgumentError, "#{Utils.demodulize(T.must(name))} requires a `strategy` block" if block.blank? match_data = { matches: {}, regex: regex, url: url } return match_data if url.blank? || block.blank? diff --git a/Library/Homebrew/uninstall.rb b/Library/Homebrew/uninstall.rb index 2a7fcafbf9..4905e26e6e 100644 --- a/Library/Homebrew/uninstall.rb +++ b/Library/Homebrew/uninstall.rb @@ -137,7 +137,7 @@ module Homebrew def are_required_by_deps "#{Utils.pluralize("", reqs.count, plural: "are", - singular: "is")} required by #{deps.to_sentence}, " \ + singular: "is")} required by #{deps.to_sentence}, " \ "which #{Utils.pluralize("", deps.count, plural: "are", singular: "is")} currently installed" end end