Rename to_kegs to to_keg

This commit is contained in:
Connor Mann 2021-05-18 09:52:19 -04:00
parent f92300f129
commit d46881c5e2
4 changed files with 7 additions and 7 deletions

View File

@ -209,8 +209,8 @@ module Homebrew
end
sig { returns(T::Array[Keg]) }
def to_kegs
@to_kegs ||= begin
def to_keg
@to_keg ||= begin
to_formulae_and_casks(only: :formula, method: :keg).freeze
rescue NoSuchKegError => e
if (reason = MissingFormula.suggest_command(e.name, "uninstall"))

View File

@ -129,9 +129,9 @@ module Homebrew
safe_system "ls", *ls_args, Cask::Caskroom.path
end
elsif args.verbose? || !$stdout.tty?
system_command! "find", args: args.named.to_kegs.map(&:to_s) + %w[-not -type d -print], print_stdout: true
system_command! "find", args: args.named.to_keg.map(&:to_s) + %w[-not -type d -print], print_stdout: true
else
args.named.to_kegs.each { |keg| PrettyListing.new keg }
args.named.to_keg.each { |keg| PrettyListing.new keg }
end
end

View File

@ -31,7 +31,7 @@ module Homebrew
options = { dry_run: args.dry_run?, verbose: args.verbose? }
args.named.to_kegs.each do |keg|
args.named.to_keg.each do |keg|
if args.dry_run?
puts "Would remove:"
keg.unlink(**options)

View File

@ -35,10 +35,10 @@ module Homebrew
args = linkage_args.parse
CacheStoreDatabase.use(:linkage) do |db|
kegs = if args.named.to_kegs.empty?
kegs = if args.named.to_keg.empty?
Formula.installed.map(&:any_installed_keg).reject(&:nil?)
else
args.named.to_kegs
args.named.to_keg
end
kegs.each do |keg|
ohai "Checking #{keg.name} linkage" if kegs.size > 1