Port more call sites
This commit is contained in:
parent
2c73d4d9b7
commit
eb2b990575
@ -231,7 +231,7 @@ module Cask
|
|||||||
already_installed_artifacts = []
|
already_installed_artifacts = []
|
||||||
|
|
||||||
odebug "Installing artifacts"
|
odebug "Installing artifacts"
|
||||||
odebug "#{artifacts.length} #{"artifact".pluralize(artifacts.length)} defined", artifacts
|
odebug "#{artifacts.length} #{::Utils::Inflection.pluralize("artifact", artifacts.length)} defined", artifacts
|
||||||
|
|
||||||
artifacts.each do |artifact|
|
artifacts.each do |artifact|
|
||||||
next unless artifact.respond_to?(:install_phase)
|
next unless artifact.respond_to?(:install_phase)
|
||||||
@ -460,7 +460,7 @@ module Cask
|
|||||||
artifacts = @cask.artifacts
|
artifacts = @cask.artifacts
|
||||||
|
|
||||||
odebug "Uninstalling artifacts"
|
odebug "Uninstalling artifacts"
|
||||||
odebug "#{artifacts.length} #{"artifact".pluralize(artifacts.length)} defined", artifacts
|
odebug "#{artifacts.length} #{::Utils::Inflection.pluralize("artifact", artifacts.length)} defined", artifacts
|
||||||
|
|
||||||
artifacts.each do |artifact|
|
artifacts.each do |artifact|
|
||||||
if artifact.respond_to?(:uninstall_phase)
|
if artifact.respond_to?(:uninstall_phase)
|
||||||
|
|||||||
@ -40,7 +40,8 @@ module Homebrew
|
|||||||
case args.named.first
|
case args.named.first
|
||||||
when nil, "state"
|
when nil, "state"
|
||||||
if env_vars.any?
|
if env_vars.any?
|
||||||
puts "Developer mode is enabled because #{env_vars.to_sentence} #{"is".pluralize(env_vars.count)} set."
|
puts "Developer mode is enabled because #{env_vars.to_sentence} #{Utils::Inflection.pluralize("",
|
||||||
|
env_vars.count, plural: "are", singular: "is")} set."
|
||||||
elsif Homebrew::Settings.read("devcmdrun") == "true"
|
elsif Homebrew::Settings.read("devcmdrun") == "true"
|
||||||
puts "Developer mode is enabled."
|
puts "Developer mode is enabled."
|
||||||
else
|
else
|
||||||
|
|||||||
@ -166,7 +166,7 @@ module Homebrew
|
|||||||
if args.retry? && (@fetch_tries[f] < FETCH_MAX_TRIES)
|
if args.retry? && (@fetch_tries[f] < FETCH_MAX_TRIES)
|
||||||
wait = 2 ** @fetch_tries[f]
|
wait = 2 ** @fetch_tries[f]
|
||||||
remaining = FETCH_MAX_TRIES - @fetch_tries[f]
|
remaining = FETCH_MAX_TRIES - @fetch_tries[f]
|
||||||
what = "try".pluralize(remaining)
|
what = Utils::Inflection.pluralize("tr", remaining, plural: "ies", singular: "y")
|
||||||
|
|
||||||
ohai "Retrying download in #{wait}s... (#{remaining} #{what} left)"
|
ohai "Retrying download in #{wait}s... (#{remaining} #{what} left)"
|
||||||
sleep wait
|
sleep wait
|
||||||
|
|||||||
@ -124,7 +124,7 @@ module Homebrew
|
|||||||
return unless HOMEBREW_CELLAR.exist?
|
return unless HOMEBREW_CELLAR.exist?
|
||||||
|
|
||||||
count = Formula.racks.length
|
count = Formula.racks.length
|
||||||
puts "#{count} #{"keg".pluralize(count)}, #{HOMEBREW_CELLAR.dup.abv}"
|
puts "#{count} #{Utils::Inflection.pluralize("keg", count)}, #{HOMEBREW_CELLAR.dup.abv}"
|
||||||
end
|
end
|
||||||
|
|
||||||
sig { params(args: CLI::Args).void }
|
sig { params(args: CLI::Args).void }
|
||||||
|
|||||||
@ -57,10 +57,10 @@ module Homebrew
|
|||||||
command_count += tap.command_files.size
|
command_count += tap.command_files.size
|
||||||
private_count += 1 if tap.private?
|
private_count += 1 if tap.private?
|
||||||
end
|
end
|
||||||
info = "#{tap_count} #{"tap".pluralize(tap_count)}"
|
info = "#{tap_count} #{Utils::Inflection.pluralize("tap", tap_count)}"
|
||||||
info += ", #{private_count} private"
|
info += ", #{private_count} private"
|
||||||
info += ", #{formula_count} #{"formula".pluralize(formula_count)}"
|
info += ", #{formula_count} #{Utils::Inflection.pluralize("formula", formula_count, plural: "e")}"
|
||||||
info += ", #{command_count} #{"command".pluralize(command_count)}"
|
info += ", #{command_count} #{Utils::Inflection.pluralize("command", command_count)}"
|
||||||
info += ", #{Tap::TAP_DIRECTORY.dup.abv}" if Tap::TAP_DIRECTORY.directory?
|
info += ", #{Tap::TAP_DIRECTORY.dup.abv}" if Tap::TAP_DIRECTORY.directory?
|
||||||
puts info
|
puts info
|
||||||
else
|
else
|
||||||
|
|||||||
@ -199,7 +199,8 @@ module Homebrew
|
|||||||
|
|
||||||
unless updated_taps.empty?
|
unless updated_taps.empty?
|
||||||
auto_update_header args: args
|
auto_update_header args: args
|
||||||
puts "Updated #{updated_taps.count} #{"tap".pluralize(updated_taps.count)} (#{updated_taps.to_sentence})."
|
puts "Updated #{updated_taps.count} #{Utils::Inflection.pluralize("tap",
|
||||||
|
updated_taps.count)} (#{updated_taps.to_sentence})."
|
||||||
updated = true
|
updated = true
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -584,11 +585,12 @@ class ReporterHub
|
|||||||
output_dump_formula_or_cask_report "Outdated Casks", outdated_casks
|
output_dump_formula_or_cask_report "Outdated Casks", outdated_casks
|
||||||
elsif report_all
|
elsif report_all
|
||||||
if (changed_formulae = select_formula_or_cask(:M).count) && changed_formulae.positive?
|
if (changed_formulae = select_formula_or_cask(:M).count) && changed_formulae.positive?
|
||||||
ohai "Modified Formulae", "Modified #{changed_formulae} #{"formula".pluralize(changed_formulae)}."
|
ohai "Modified Formulae",
|
||||||
|
"Modified #{changed_formulae} #{Utils::Inflection.pluralize("formula", changed_formulae, plural: "e")}."
|
||||||
end
|
end
|
||||||
|
|
||||||
if (changed_casks = select_formula_or_cask(:MC).count) && changed_casks.positive?
|
if (changed_casks = select_formula_or_cask(:MC).count) && changed_casks.positive?
|
||||||
ohai "Modified Casks", "Modified #{changed_casks} #{"cask".pluralize(changed_casks)}."
|
ohai "Modified Casks", "Modified #{changed_casks} #{Utils::Inflection.pluralize("cask", changed_casks)}."
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
outdated_formulae = Formula.installed.select(&:outdated?).map(&:name)
|
outdated_formulae = Formula.installed.select(&:outdated?).map(&:name)
|
||||||
@ -609,12 +611,14 @@ class ReporterHub
|
|||||||
msg = ""
|
msg = ""
|
||||||
|
|
||||||
if outdated_formulae.positive?
|
if outdated_formulae.positive?
|
||||||
msg += "#{Tty.bold}#{outdated_formulae}#{Tty.reset} outdated #{"formula".pluralize(outdated_formulae)}"
|
msg += "#{Tty.bold}#{outdated_formulae}#{Tty.reset} outdated #{Utils::Inflection.pluralize("formula",
|
||||||
|
outdated_formulae, plural: "e")}"
|
||||||
end
|
end
|
||||||
|
|
||||||
if outdated_casks.positive?
|
if outdated_casks.positive?
|
||||||
msg += " and " if msg.present?
|
msg += " and " if msg.present?
|
||||||
msg += "#{Tty.bold}#{outdated_casks}#{Tty.reset} outdated #{"cask".pluralize(outdated_casks)}"
|
msg += "#{Tty.bold}#{outdated_casks}#{Tty.reset} outdated #{Utils::Inflection.pluralize("cask",
|
||||||
|
outdated_casks)}"
|
||||||
end
|
end
|
||||||
|
|
||||||
return if msg.blank?
|
return if msg.blank?
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user