Remove unnecessary parameter from method

A boolean `resource` parameter was added to `#print_latest_version`
but its only purpose is to identify whether `info` corresponds to a
resource. This can be achieved using `info[:resource].present?`, so
this additional parameter isn't necessary and can be removed.
This commit is contained in:
Sam Ford 2022-09-27 00:36:33 -04:00
parent fb653c00d8
commit bd9c436d50
No known key found for this signature in database
GPG Key ID: 7AF5CBEE1DD6F76D

View File

@ -472,9 +472,9 @@ module Homebrew
end end
# Formats and prints the livecheck result for a formula/cask/resource. # Formats and prints the livecheck result for a formula/cask/resource.
sig { params(info: Hash, verbose: T::Boolean, ambiguous_cask: T::Boolean, resource: T::Boolean).void } sig { params(info: Hash, verbose: T::Boolean, ambiguous_cask: T::Boolean).void }
def print_latest_version(info, verbose: false, ambiguous_cask: false, resource: false) def print_latest_version(info, verbose: false, ambiguous_cask: false)
package_or_resource_s = resource ? " " : "" package_or_resource_s = info[:resource].present? ? " " : ""
package_or_resource_s += "#{Tty.blue}#{info[:formula] || info[:cask] || info[:resource]}#{Tty.reset}" package_or_resource_s += "#{Tty.blue}#{info[:formula] || info[:cask] || info[:resource]}#{Tty.reset}"
package_or_resource_s += " (cask)" if ambiguous_cask package_or_resource_s += " (cask)" if ambiguous_cask
package_or_resource_s += " (guessed)" if verbose && !info[:meta][:livecheckable] package_or_resource_s += " (guessed)" if verbose && !info[:meta][:livecheckable]
@ -501,11 +501,7 @@ module Homebrew
if r_info[:status] && r_info[:messages] if r_info[:status] && r_info[:messages]
SkipConditions.print_skip_information(r_info) SkipConditions.print_skip_information(r_info)
else else
print_latest_version( print_latest_version(r_info, verbose: verbose)
r_info,
verbose: verbose,
resource: true,
)
end end
end end
end end