Merge pull request #20356 from Homebrew/kernel-sigs
extend/kernel: tighten up some type signatures
This commit is contained in:
commit
f2c32156e8
@ -234,36 +234,36 @@ module Kernel
|
|||||||
odeprecated(method, replacement, disable: true, disable_on:, disable_for_developers:, caller:)
|
odeprecated(method, replacement, disable: true, disable_on:, disable_for_developers:, caller:)
|
||||||
end
|
end
|
||||||
|
|
||||||
sig { params(formula: T.any(String, Formula)).returns(String) }
|
sig { params(string: String).returns(String) }
|
||||||
def pretty_installed(formula)
|
def pretty_installed(string)
|
||||||
if !$stdout.tty?
|
if !$stdout.tty?
|
||||||
formula.to_s
|
string
|
||||||
elsif Homebrew::EnvConfig.no_emoji?
|
elsif Homebrew::EnvConfig.no_emoji?
|
||||||
Formatter.success("#{Tty.bold}#{formula} (installed)#{Tty.reset}")
|
Formatter.success("#{Tty.bold}#{string} (installed)#{Tty.reset}")
|
||||||
else
|
else
|
||||||
"#{Tty.bold}#{formula} #{Formatter.success("✔")}#{Tty.reset}"
|
"#{Tty.bold}#{string} #{Formatter.success("✔")}#{Tty.reset}"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
sig { params(formula: T.any(String, Formula)).returns(String) }
|
sig { params(string: String).returns(String) }
|
||||||
def pretty_outdated(formula)
|
def pretty_outdated(string)
|
||||||
if !$stdout.tty?
|
if !$stdout.tty?
|
||||||
formula.to_s
|
string
|
||||||
elsif Homebrew::EnvConfig.no_emoji?
|
elsif Homebrew::EnvConfig.no_emoji?
|
||||||
Formatter.error("#{Tty.bold}#{formula} (outdated)#{Tty.reset}")
|
Formatter.error("#{Tty.bold}#{string} (outdated)#{Tty.reset}")
|
||||||
else
|
else
|
||||||
"#{Tty.bold}#{formula} #{Formatter.warning("⚠")}#{Tty.reset}"
|
"#{Tty.bold}#{string} #{Formatter.warning("⚠")}#{Tty.reset}"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
sig { params(formula: T.any(String, Formula)).returns(String) }
|
sig { params(string: String).returns(String) }
|
||||||
def pretty_uninstalled(formula)
|
def pretty_uninstalled(string)
|
||||||
if !$stdout.tty?
|
if !$stdout.tty?
|
||||||
formula.to_s
|
string
|
||||||
elsif Homebrew::EnvConfig.no_emoji?
|
elsif Homebrew::EnvConfig.no_emoji?
|
||||||
Formatter.error("#{Tty.bold}#{formula} (uninstalled)#{Tty.reset}")
|
Formatter.error("#{Tty.bold}#{string} (uninstalled)#{Tty.reset}")
|
||||||
else
|
else
|
||||||
"#{Tty.bold}#{formula} #{Formatter.error("✘")}#{Tty.reset}"
|
"#{Tty.bold}#{string} #{Formatter.error("✘")}#{Tty.reset}"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user