git grep -l Utils::Inflection | xargs gsed -i 's|Utils::Inflection|Utils|g'
This commit is contained in:
parent
86c500fdcc
commit
0eccc0e987
@ -85,7 +85,7 @@ module Cask
|
|||||||
|
|
||||||
if dry_run
|
if dry_run
|
||||||
if (casks_to_install = casks.reject(&:installed?).presence)
|
if (casks_to_install = casks.reject(&:installed?).presence)
|
||||||
plural = ::Utils::Inflection.pluralize("cask", casks_to_install.count)
|
plural = ::Utils.pluralize("cask", casks_to_install.count)
|
||||||
ohai "Would install #{casks_to_install.count} #{plural}:"
|
ohai "Would install #{casks_to_install.count} #{plural}:"
|
||||||
puts casks_to_install.map(&:full_name).join(" ")
|
puts casks_to_install.map(&:full_name).join(" ")
|
||||||
end
|
end
|
||||||
@ -97,7 +97,7 @@ module Cask
|
|||||||
.map(&:name)
|
.map(&:name)
|
||||||
next if dep_names.blank?
|
next if dep_names.blank?
|
||||||
|
|
||||||
plural = ::Utils::Inflection.pluralize("dependenc", dep_names.count, plural: "ies", singular: "y")
|
plural = ::Utils.pluralize("dependenc", dep_names.count, plural: "ies", singular: "y")
|
||||||
ohai "Would install #{dep_names.count} #{plural} for #{cask.full_name}:"
|
ohai "Would install #{dep_names.count} #{plural} for #{cask.full_name}:"
|
||||||
puts dep_names.join(" ")
|
puts dep_names.join(" ")
|
||||||
end
|
end
|
||||||
|
|||||||
@ -46,7 +46,7 @@ module Cask
|
|||||||
next if (versions = cask.versions).empty?
|
next if (versions = cask.versions).empty?
|
||||||
|
|
||||||
puts <<~EOS
|
puts <<~EOS
|
||||||
#{cask} #{versions.to_sentence} #{::Utils::Inflection.pluralize("", versions.count, plural: "are", singular: "is")} still installed.
|
#{cask} #{versions.to_sentence} #{::Utils.pluralize("", versions.count, plural: "are", singular: "is")} still installed.
|
||||||
Remove #{(versions.count == 1) ? "it" : "them all"} with `brew uninstall --cask --force #{cask}`.
|
Remove #{(versions.count == 1) ? "it" : "them all"} with `brew uninstall --cask --force #{cask}`.
|
||||||
EOS
|
EOS
|
||||||
end
|
end
|
||||||
|
|||||||
@ -121,7 +121,7 @@ module Cask
|
|||||||
|
|
||||||
if manual_installer_casks.present?
|
if manual_installer_casks.present?
|
||||||
count = manual_installer_casks.count
|
count = manual_installer_casks.count
|
||||||
ofail "Not upgrading #{count} `installer manual` #{::Utils::Inflection.pluralize("cask", versions.count)}."
|
ofail "Not upgrading #{count} `installer manual` #{::Utils.pluralize("cask", versions.count)}."
|
||||||
puts manual_installer_casks.map(&:to_s)
|
puts manual_installer_casks.map(&:to_s)
|
||||||
outdated_casks -= manual_installer_casks
|
outdated_casks -= manual_installer_casks
|
||||||
end
|
end
|
||||||
@ -142,7 +142,7 @@ module Cask
|
|||||||
end
|
end
|
||||||
|
|
||||||
verb = dry_run ? "Would upgrade" : "Upgrading"
|
verb = dry_run ? "Would upgrade" : "Upgrading"
|
||||||
oh1 "#{verb} #{outdated_casks.count} outdated #{::Utils::Inflection.pluralize("package",
|
oh1 "#{verb} #{outdated_casks.count} outdated #{::Utils.pluralize("package",
|
||||||
outdated_casks.count)}:"
|
outdated_casks.count)}:"
|
||||||
|
|
||||||
caught_exceptions = []
|
caught_exceptions = []
|
||||||
|
|||||||
@ -231,7 +231,7 @@ module Cask
|
|||||||
already_installed_artifacts = []
|
already_installed_artifacts = []
|
||||||
|
|
||||||
odebug "Installing artifacts"
|
odebug "Installing artifacts"
|
||||||
odebug "#{artifacts.length} #{::Utils::Inflection.pluralize("artifact", artifacts.length)} defined", artifacts
|
odebug "#{artifacts.length} #{::Utils.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} #{::Utils::Inflection.pluralize("artifact", artifacts.length)} defined", artifacts
|
odebug "#{artifacts.length} #{::Utils.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)
|
||||||
|
|||||||
@ -584,7 +584,7 @@ module Homebrew
|
|||||||
formulae_names = removable_formulae.map(&:full_name).sort
|
formulae_names = removable_formulae.map(&:full_name).sort
|
||||||
|
|
||||||
verb = dry_run ? "Would autoremove" : "Autoremoving"
|
verb = dry_run ? "Would autoremove" : "Autoremoving"
|
||||||
oh1 "#{verb} #{formulae_names.count} unneeded #{Utils::Inflection.pluralize("formula", formulae_names.count,
|
oh1 "#{verb} #{formulae_names.count} unneeded #{Utils.pluralize("formula", formulae_names.count,
|
||||||
plural: "e")}:"
|
plural: "e")}:"
|
||||||
puts formulae_names.join("\n")
|
puts formulae_names.join("\n")
|
||||||
return if dry_run
|
return if dry_run
|
||||||
|
|||||||
@ -684,7 +684,7 @@ module Homebrew
|
|||||||
arg_types = types.map { |type| type.to_s.tr("_", " ") }
|
arg_types = types.map { |type| type.to_s.tr("_", " ") }
|
||||||
.to_sentence two_words_connector: " or ", last_word_connector: " or "
|
.to_sentence two_words_connector: " or ", last_word_connector: " or "
|
||||||
|
|
||||||
"This command does not take more than #{maximum} #{arg_types} #{Utils::Inflection.pluralize("argument",
|
"This command does not take more than #{maximum} #{arg_types} #{Utils.pluralize("argument",
|
||||||
maximum)}."
|
maximum)}."
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -699,7 +699,7 @@ module Homebrew
|
|||||||
arg_types = types.map { |type| type.to_s.tr("_", " ") }
|
arg_types = types.map { |type| type.to_s.tr("_", " ") }
|
||||||
.to_sentence two_words_connector: " or ", last_word_connector: " or "
|
.to_sentence two_words_connector: " or ", last_word_connector: " or "
|
||||||
|
|
||||||
super "This command requires at least #{minimum} #{arg_types} #{Utils::Inflection.pluralize("argument",
|
super "This command requires at least #{minimum} #{arg_types} #{Utils.pluralize("argument",
|
||||||
minimum)}."
|
minimum)}."
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -713,7 +713,7 @@ module Homebrew
|
|||||||
arg_types = types.map { |type| type.to_s.tr("_", " ") }
|
arg_types = types.map { |type| type.to_s.tr("_", " ") }
|
||||||
.to_sentence two_words_connector: " or ", last_word_connector: " or "
|
.to_sentence two_words_connector: " or ", last_word_connector: " or "
|
||||||
|
|
||||||
super "This command requires exactly #{minimum} #{arg_types} #{Utils::Inflection.pluralize("argument",
|
super "This command requires exactly #{minimum} #{arg_types} #{Utils.pluralize("argument",
|
||||||
minimum)}."
|
minimum)}."
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@ -40,7 +40,7 @@ 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} #{Utils::Inflection.pluralize("",
|
puts "Developer mode is enabled because #{env_vars.to_sentence} #{Utils.pluralize("",
|
||||||
env_vars.count, plural: "are", singular: "is")} set."
|
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."
|
||||||
|
|||||||
@ -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 = Utils::Inflection.pluralize("tr", remaining, plural: "ies", singular: "y")
|
what = Utils.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} #{Utils::Inflection.pluralize("keg", count)}, #{HOMEBREW_CELLAR.dup.abv}"
|
puts "#{count} #{Utils.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} #{Utils::Inflection.pluralize("tap", tap_count)}"
|
info = "#{tap_count} #{Utils.pluralize("tap", tap_count)}"
|
||||||
info += ", #{private_count} private"
|
info += ", #{private_count} private"
|
||||||
info += ", #{formula_count} #{Utils::Inflection.pluralize("formula", formula_count, plural: "e")}"
|
info += ", #{formula_count} #{Utils.pluralize("formula", formula_count, plural: "e")}"
|
||||||
info += ", #{command_count} #{Utils::Inflection.pluralize("command", command_count)}"
|
info += ", #{command_count} #{Utils.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,7 @@ 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} #{Utils::Inflection.pluralize("tap",
|
puts "Updated #{updated_taps.count} #{Utils.pluralize("tap",
|
||||||
updated_taps.count)} (#{updated_taps.to_sentence})."
|
updated_taps.count)} (#{updated_taps.to_sentence})."
|
||||||
updated = true
|
updated = true
|
||||||
end
|
end
|
||||||
@ -586,11 +586,11 @@ class ReporterHub
|
|||||||
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",
|
ohai "Modified Formulae",
|
||||||
"Modified #{changed_formulae} #{Utils::Inflection.pluralize("formula", changed_formulae, plural: "e")}."
|
"Modified #{changed_formulae} #{Utils.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} #{Utils::Inflection.pluralize("cask", changed_casks)}."
|
ohai "Modified Casks", "Modified #{changed_casks} #{Utils.pluralize("cask", changed_casks)}."
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
outdated_formulae = Formula.installed.select(&:outdated?).map(&:name)
|
outdated_formulae = Formula.installed.select(&:outdated?).map(&:name)
|
||||||
@ -611,13 +611,13 @@ class ReporterHub
|
|||||||
msg = ""
|
msg = ""
|
||||||
|
|
||||||
if outdated_formulae.positive?
|
if outdated_formulae.positive?
|
||||||
msg += "#{Tty.bold}#{outdated_formulae}#{Tty.reset} outdated #{Utils::Inflection.pluralize("formula",
|
msg += "#{Tty.bold}#{outdated_formulae}#{Tty.reset} outdated #{Utils.pluralize("formula",
|
||||||
outdated_formulae, plural: "e")}"
|
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 #{Utils::Inflection.pluralize("cask",
|
msg += "#{Tty.bold}#{outdated_casks}#{Tty.reset} outdated #{Utils.pluralize("cask",
|
||||||
outdated_casks)}"
|
outdated_casks)}"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -172,7 +172,7 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
|
|
||||||
if !pinned.empty? && !args.ignore_pinned?
|
if !pinned.empty? && !args.ignore_pinned?
|
||||||
ofail "Not upgrading #{pinned.count} pinned #{Utils::Inflection.pluralize("package", pinned.count)}:"
|
ofail "Not upgrading #{pinned.count} pinned #{Utils.pluralize("package", pinned.count)}:"
|
||||||
puts pinned.map { |f| "#{f.full_specified_name} #{f.pkg_version}" } * ", "
|
puts pinned.map { |f| "#{f.full_specified_name} #{f.pkg_version}" } * ", "
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -180,7 +180,7 @@ module Homebrew
|
|||||||
oh1 "No packages to upgrade"
|
oh1 "No packages to upgrade"
|
||||||
else
|
else
|
||||||
verb = args.dry_run? ? "Would upgrade" : "Upgrading"
|
verb = args.dry_run? ? "Would upgrade" : "Upgrading"
|
||||||
oh1 "#{verb} #{formulae_to_install.count} outdated #{Utils::Inflection.pluralize("package",
|
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|
|
formulae_upgrades = formulae_to_install.map do |f|
|
||||||
if f.optlinked?
|
if f.optlinked?
|
||||||
|
|||||||
@ -277,22 +277,22 @@ module Homebrew
|
|||||||
if total_problems_count.positive?
|
if total_problems_count.positive?
|
||||||
puts new_formula_problem_lines.map { |s| " #{s}" }
|
puts new_formula_problem_lines.map { |s| " #{s}" }
|
||||||
|
|
||||||
errors_summary = "#{total_problems_count} #{Utils::Inflection.pluralize("problem", total_problems_count)}"
|
errors_summary = "#{total_problems_count} #{Utils.pluralize("problem", total_problems_count)}"
|
||||||
|
|
||||||
error_sources = []
|
error_sources = []
|
||||||
if formula_count.positive?
|
if formula_count.positive?
|
||||||
error_sources << "#{formula_count} #{Utils::Inflection.pluralize("formula", formula_count,
|
error_sources << "#{formula_count} #{Utils.pluralize("formula", formula_count,
|
||||||
plural: "e")}"
|
plural: "e")}"
|
||||||
end
|
end
|
||||||
error_sources << "#{cask_count} #{Utils::Inflection.pluralize("cask", cask_count)}" if cask_count.positive?
|
error_sources << "#{cask_count} #{Utils.pluralize("cask", cask_count)}" if cask_count.positive?
|
||||||
error_sources << "#{tap_count} #{Utils::Inflection.pluralize("tap", tap_count)}" if tap_count.positive?
|
error_sources << "#{tap_count} #{Utils.pluralize("tap", tap_count)}" if tap_count.positive?
|
||||||
|
|
||||||
errors_summary += " in #{error_sources.to_sentence}" if error_sources.any?
|
errors_summary += " in #{error_sources.to_sentence}" if error_sources.any?
|
||||||
|
|
||||||
errors_summary += " detected"
|
errors_summary += " detected"
|
||||||
|
|
||||||
if corrected_problem_count.positive?
|
if corrected_problem_count.positive?
|
||||||
errors_summary += ", #{corrected_problem_count} #{Utils::Inflection.pluralize("problem",
|
errors_summary += ", #{corrected_problem_count} #{Utils.pluralize("problem",
|
||||||
corrected_problem_count)} corrected"
|
corrected_problem_count)} corrected"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -61,7 +61,7 @@ module Homebrew
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
ohai "#{prs.count} matching pull #{Utils::Inflection.pluralize("request", prs.count)}:"
|
ohai "#{prs.count} matching pull #{Utils.pluralize("request", prs.count)}:"
|
||||||
pr_urls = []
|
pr_urls = []
|
||||||
prs.each do |pr|
|
prs.each do |pr|
|
||||||
puts "#{tap.full_name unless tap.core_tap?}##{pr["number"]}: #{pr["title"]}"
|
puts "#{tap.full_name unless tap.core_tap?}##{pr["number"]}: #{pr["title"]}"
|
||||||
|
|||||||
@ -906,11 +906,11 @@ module Homebrew
|
|||||||
0
|
0
|
||||||
end
|
end
|
||||||
|
|
||||||
"#{tap.path} (#{cask_count} #{Utils::Inflection.pluralize("cask", cask_count)})"
|
"#{tap.path} (#{cask_count} #{Utils.pluralize("cask", cask_count)})"
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
taps = Utils::Inflection.pluralize("tap", error_tap_paths.count)
|
taps = Utils.pluralize("tap", error_tap_paths.count)
|
||||||
"Unable to read from cask #{taps}: #{error_tap_paths.to_sentence}" if error_tap_paths.present?
|
"Unable to read from cask #{taps}: #{error_tap_paths.to_sentence}" if error_tap_paths.present?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -568,7 +568,7 @@ end
|
|||||||
class UnbottledError < RuntimeError
|
class UnbottledError < RuntimeError
|
||||||
def initialize(formulae)
|
def initialize(formulae)
|
||||||
msg = +<<~EOS
|
msg = +<<~EOS
|
||||||
The following #{Utils::Inflection.pluralize("formula", formulae.count, plural: "e")} cannot be installed from #{Utils::Inflection.pluralize("bottle", formulae.count)} and must be
|
The following #{Utils.pluralize("formula", formulae.count, plural: "e")} cannot be installed from #{Utils.pluralize("bottle", formulae.count)} and must be
|
||||||
built from source.
|
built from source.
|
||||||
#{formulae.to_sentence}
|
#{formulae.to_sentence}
|
||||||
EOS
|
EOS
|
||||||
|
|||||||
@ -52,10 +52,10 @@ module Formulary
|
|||||||
next if type == :formulary_factory
|
next if type == :formulary_factory
|
||||||
|
|
||||||
cached_objects.each_value do |klass|
|
cached_objects.each_value do |klass|
|
||||||
namespace = Utils::Inflection.deconstantize(klass.name)
|
namespace = Utils.deconstantize(klass.name)
|
||||||
next if Utils::Inflection.deconstantize(namespace) != name
|
next if Utils.deconstantize(namespace) != name
|
||||||
|
|
||||||
remove_const(Utils::Inflection.demodulize(namespace))
|
remove_const(Utils.demodulize(namespace))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@ -324,7 +324,7 @@ module Homebrew
|
|||||||
|
|
||||||
if dry_run
|
if dry_run
|
||||||
if (formulae_name_to_install = formulae_to_install.map(&:name))
|
if (formulae_name_to_install = formulae_to_install.map(&:name))
|
||||||
plural = Utils::Inflection.pluralize("formula", formulae_name_to_install.count, plural: "e")
|
plural = Utils.pluralize("formula", formulae_name_to_install.count, plural: "e")
|
||||||
ohai "Would install #{formulae_name_to_install.count} #{plural}:"
|
ohai "Would install #{formulae_name_to_install.count} #{plural}:"
|
||||||
puts formulae_name_to_install.join(" ")
|
puts formulae_name_to_install.join(" ")
|
||||||
|
|
||||||
@ -354,7 +354,7 @@ module Homebrew
|
|||||||
def print_dry_run_dependencies(formula, dependencies, &block)
|
def print_dry_run_dependencies(formula, dependencies, &block)
|
||||||
return if dependencies.empty?
|
return if dependencies.empty?
|
||||||
|
|
||||||
plural = Utils::Inflection.pluralize("dependenc", dependencies.count, plural: "ies", singular: "y")
|
plural = Utils.pluralize("dependenc", dependencies.count, plural: "ies", singular: "y")
|
||||||
ohai "Would install #{dependencies.count} #{plural} for #{formula.name}:"
|
ohai "Would install #{dependencies.count} #{plural} for #{formula.name}:"
|
||||||
formula_names = dependencies.map(&:first).map(&:to_formula).map(&block)
|
formula_names = dependencies.map(&:first).map(&:to_formula).map(&block)
|
||||||
puts formula_names.join(" ")
|
puts formula_names.join(" ")
|
||||||
|
|||||||
@ -61,7 +61,7 @@ module Homebrew
|
|||||||
constant = Strategy.const_get(const_symbol)
|
constant = Strategy.const_get(const_symbol)
|
||||||
next unless constant.is_a?(Class)
|
next unless constant.is_a?(Class)
|
||||||
|
|
||||||
@livecheck_strategy_names[constant] = Utils::Inflection.demodulize(T.must(constant.name))
|
@livecheck_strategy_names[constant] = Utils.demodulize(T.must(constant.name))
|
||||||
end
|
end
|
||||||
@livecheck_strategy_names.freeze
|
@livecheck_strategy_names.freeze
|
||||||
end
|
end
|
||||||
|
|||||||
@ -74,7 +74,7 @@ module Homebrew
|
|||||||
def self.find_versions(url:, regex: nil, **_unused, &block)
|
def self.find_versions(url:, regex: nil, **_unused, &block)
|
||||||
if regex.present? && block.blank?
|
if regex.present? && block.blank?
|
||||||
raise ArgumentError,
|
raise ArgumentError,
|
||||||
"#{Utils::Inflection.demodulize(T.must(name))} only supports a regex when using a `strategy` block"
|
"#{Utils.demodulize(T.must(name))} only supports a regex when using a `strategy` block"
|
||||||
end
|
end
|
||||||
|
|
||||||
match_data = { matches: {}, regex: regex, url: url }
|
match_data = { matches: {}, regex: regex, url: url }
|
||||||
|
|||||||
@ -98,11 +98,11 @@ module Homebrew
|
|||||||
def self.find_versions(cask:, url: nil, regex: nil, **_unused, &block)
|
def self.find_versions(cask:, url: nil, regex: nil, **_unused, &block)
|
||||||
if regex.present? && block.blank?
|
if regex.present? && block.blank?
|
||||||
raise ArgumentError,
|
raise ArgumentError,
|
||||||
"#{Utils::Inflection.demodulize(T.must(name))} only supports a regex when using a `strategy` block"
|
"#{Utils.demodulize(T.must(name))} only supports a regex when using a `strategy` block"
|
||||||
end
|
end
|
||||||
unless T.unsafe(cask)
|
unless T.unsafe(cask)
|
||||||
raise ArgumentError,
|
raise ArgumentError,
|
||||||
"The #{Utils::Inflection.demodulize(T.must(name))} strategy only supports casks."
|
"The #{Utils.demodulize(T.must(name))} strategy only supports casks."
|
||||||
end
|
end
|
||||||
|
|
||||||
match_data = { matches: {}, regex: regex, url: url }
|
match_data = { matches: {}, regex: regex, url: url }
|
||||||
|
|||||||
@ -93,7 +93,7 @@ module Homebrew
|
|||||||
}
|
}
|
||||||
def self.find_versions(url:, regex: nil, provided_content: nil, homebrew_curl: false, **_unused, &block)
|
def self.find_versions(url:, regex: nil, provided_content: nil, homebrew_curl: false, **_unused, &block)
|
||||||
if regex.blank? && block.blank?
|
if regex.blank? && block.blank?
|
||||||
raise ArgumentError, "#{Utils::Inflection.demodulize(T.must(name))} requires a regex or `strategy` block"
|
raise ArgumentError, "#{Utils.demodulize(T.must(name))} requires a regex or `strategy` block"
|
||||||
end
|
end
|
||||||
|
|
||||||
match_data = { matches: {}, regex: regex, url: url }
|
match_data = { matches: {}, regex: regex, url: url }
|
||||||
|
|||||||
@ -204,7 +204,7 @@ module Homebrew
|
|||||||
def self.find_versions(url:, regex: nil, **_unused, &block)
|
def self.find_versions(url:, regex: nil, **_unused, &block)
|
||||||
if regex.present? && block.blank?
|
if regex.present? && block.blank?
|
||||||
raise ArgumentError,
|
raise ArgumentError,
|
||||||
"#{Utils::Inflection.demodulize(T.must(name))} only supports a regex when using a `strategy` block"
|
"#{Utils.demodulize(T.must(name))} only supports a regex when using a `strategy` block"
|
||||||
end
|
end
|
||||||
|
|
||||||
match_data = { matches: {}, regex: regex, url: url }
|
match_data = { matches: {}, regex: regex, url: url }
|
||||||
|
|||||||
@ -475,15 +475,15 @@ class Tap
|
|||||||
contents = []
|
contents = []
|
||||||
|
|
||||||
if (command_count = command_files.count).positive?
|
if (command_count = command_files.count).positive?
|
||||||
contents << "#{command_count} #{Utils::Inflection.pluralize("command", command_count)}"
|
contents << "#{command_count} #{Utils.pluralize("command", command_count)}"
|
||||||
end
|
end
|
||||||
|
|
||||||
if (cask_count = cask_files.count).positive?
|
if (cask_count = cask_files.count).positive?
|
||||||
contents << "#{cask_count} #{Utils::Inflection.pluralize("cask", cask_count)}"
|
contents << "#{cask_count} #{Utils.pluralize("cask", cask_count)}"
|
||||||
end
|
end
|
||||||
|
|
||||||
if (formula_count = formula_files.count).positive?
|
if (formula_count = formula_files.count).positive?
|
||||||
contents << "#{formula_count} #{Utils::Inflection.pluralize("formula", formula_count, plural: "e")}"
|
contents << "#{formula_count} #{Utils.pluralize("formula", formula_count, plural: "e")}"
|
||||||
end
|
end
|
||||||
|
|
||||||
contents
|
contents
|
||||||
|
|||||||
@ -52,7 +52,7 @@ module Homebrew
|
|||||||
if rack.directory?
|
if rack.directory?
|
||||||
versions = rack.subdirs.map(&:basename)
|
versions = rack.subdirs.map(&:basename)
|
||||||
puts <<~EOS
|
puts <<~EOS
|
||||||
#{keg.name} #{versions.to_sentence} #{Utils::Inflection.pluralize("", versions.count, plural: "are", singular: "is")} still installed.
|
#{keg.name} #{versions.to_sentence} #{Utils.pluralize("", versions.count, plural: "are", singular: "is")} still installed.
|
||||||
To remove all versions, run:
|
To remove all versions, run:
|
||||||
brew uninstall --force #{keg.name}
|
brew uninstall --force #{keg.name}
|
||||||
EOS
|
EOS
|
||||||
@ -136,9 +136,9 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
|
|
||||||
def are_required_by_deps
|
def are_required_by_deps
|
||||||
"#{Utils::Inflection.pluralize("", reqs.count, plural: "are",
|
"#{Utils.pluralize("", reqs.count, plural: "are",
|
||||||
singular: "is")} required by #{deps.to_sentence}, " \
|
singular: "is")} required by #{deps.to_sentence}, " \
|
||||||
"which #{Utils::Inflection.pluralize("", deps.count, plural: "are", singular: "is")} currently installed"
|
"which #{Utils.pluralize("", deps.count, plural: "are", singular: "is")} currently installed"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -158,7 +158,7 @@ module Homebrew
|
|||||||
def output
|
def output
|
||||||
ofail <<~EOS
|
ofail <<~EOS
|
||||||
Refusing to uninstall #{reqs.to_sentence}
|
Refusing to uninstall #{reqs.to_sentence}
|
||||||
because #{Utils::Inflection.pluralize("", reqs.count, plural: "they", singular: "it")} #{are_required_by_deps}.
|
because #{Utils.pluralize("", reqs.count, plural: "they", singular: "it")} #{are_required_by_deps}.
|
||||||
You can override this and force removal with:
|
You can override this and force removal with:
|
||||||
#{sample_command}
|
#{sample_command}
|
||||||
EOS
|
EOS
|
||||||
|
|||||||
@ -299,7 +299,7 @@ module Homebrew
|
|||||||
.sort { |a, b| depends_on(a, b) }
|
.sort { |a, b| depends_on(a, b) }
|
||||||
|
|
||||||
if pinned_dependents.present?
|
if pinned_dependents.present?
|
||||||
plural = Utils::Inflection.pluralize("dependent", pinned_dependents.count)
|
plural = Utils.pluralize("dependent", pinned_dependents.count)
|
||||||
ohai "Not upgrading #{pinned_dependents.count} pinned #{plural}:"
|
ohai "Not upgrading #{pinned_dependents.count} pinned #{plural}:"
|
||||||
puts(pinned_dependents.map do |f|
|
puts(pinned_dependents.map do |f|
|
||||||
"#{f.full_specified_name} #{f.pkg_version}"
|
"#{f.full_specified_name} #{f.pkg_version}"
|
||||||
@ -310,8 +310,8 @@ module Homebrew
|
|||||||
if upgradeable_dependents.blank?
|
if upgradeable_dependents.blank?
|
||||||
ohai "No outdated dependents to upgrade!" unless dry_run
|
ohai "No outdated dependents to upgrade!" unless dry_run
|
||||||
else
|
else
|
||||||
dependent_plural = Utils::Inflection.pluralize("dependent", upgradeable_dependents.count)
|
dependent_plural = Utils.pluralize("dependent", upgradeable_dependents.count)
|
||||||
formula_plural = Utils::Inflection.pluralize("formula", installed_formulae.count, plural: "e")
|
formula_plural = Utils.pluralize("formula", installed_formulae.count, plural: "e")
|
||||||
upgrade_verb = dry_run ? "Would upgrade" : "Upgrading"
|
upgrade_verb = dry_run ? "Would upgrade" : "Upgrading"
|
||||||
ohai "#{upgrade_verb} #{upgradeable_dependents.count} #{dependent_plural} of upgraded #{formula_plural}:"
|
ohai "#{upgrade_verb} #{upgradeable_dependents.count} #{dependent_plural} of upgraded #{formula_plural}:"
|
||||||
Upgrade.puts_no_installed_dependents_check_disable_message_if_not_already!
|
Upgrade.puts_no_installed_dependents_check_disable_message_if_not_already!
|
||||||
@ -375,7 +375,7 @@ module Homebrew
|
|||||||
# Print the pinned dependents.
|
# Print the pinned dependents.
|
||||||
if outdated_pinned_broken_dependents.present?
|
if outdated_pinned_broken_dependents.present?
|
||||||
count = outdated_pinned_broken_dependents.count
|
count = outdated_pinned_broken_dependents.count
|
||||||
plural = Utils::Inflection.pluralize("dependent", outdated_pinned_broken_dependents.count)
|
plural = Utils.pluralize("dependent", outdated_pinned_broken_dependents.count)
|
||||||
onoe "Not reinstalling #{count} broken and outdated, but pinned #{plural}:"
|
onoe "Not reinstalling #{count} broken and outdated, but pinned #{plural}:"
|
||||||
$stderr.puts(outdated_pinned_broken_dependents.map do |f|
|
$stderr.puts(outdated_pinned_broken_dependents.map do |f|
|
||||||
"#{f.full_specified_name} #{f.pkg_version}"
|
"#{f.full_specified_name} #{f.pkg_version}"
|
||||||
@ -387,7 +387,7 @@ module Homebrew
|
|||||||
ohai "No broken dependents to reinstall!"
|
ohai "No broken dependents to reinstall!"
|
||||||
else
|
else
|
||||||
count = reinstallable_broken_dependents.count
|
count = reinstallable_broken_dependents.count
|
||||||
plural = Utils::Inflection.pluralize("dependent", reinstallable_broken_dependents.count)
|
plural = Utils.pluralize("dependent", reinstallable_broken_dependents.count)
|
||||||
ohai "Reinstalling #{count} #{plural} with broken linkage from source:"
|
ohai "Reinstalling #{count} #{plural} with broken linkage from source:"
|
||||||
Upgrade.puts_no_installed_dependents_check_disable_message_if_not_already!
|
Upgrade.puts_no_installed_dependents_check_disable_message_if_not_already!
|
||||||
puts reinstallable_broken_dependents.map(&:full_specified_name)
|
puts reinstallable_broken_dependents.map(&:full_specified_name)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user