Apply suggestions from code review

Co-authored-by: Kevin <apainintheneck@gmail.com>
This commit is contained in:
Douglas Eichelberger 2024-11-03 08:58:14 -08:00 committed by Mike McQuaid
parent 521c463e36
commit a2612e23dc
No known key found for this signature in database
2 changed files with 2 additions and 2 deletions

View File

@ -174,7 +174,7 @@ module Cask
def install_time def install_time
# <caskroom_path>/.metadata/<version>/<timestamp>/Casks/<token>.{rb,json} -> <timestamp> # <caskroom_path>/.metadata/<version>/<timestamp>/Casks/<token>.{rb,json} -> <timestamp>
caskfile = installed_caskfile caskfile = installed_caskfile
caskfile ? Time.strptime(caskfile.dirname.dirname.basename.to_s, Metadata::TIMESTAMP_FORMAT) : nil Time.strptime(caskfile.dirname.dirname.basename.to_s, Metadata::TIMESTAMP_FORMAT) if caskfile
end end
sig { returns(T.nilable(Pathname)) } sig { returns(T.nilable(Pathname)) }

View File

@ -154,7 +154,7 @@ module Homebrew
stable = formula.stable stable = formula.stable
if resource_name == "patch" if resource_name == "patch"
patch_hashes = stable&.patches&.filter_map { _1.resource.version if _1.external } patch_hashes = stable&.patches&.filter_map { _1.resource.version if _1.external? }
return true unless patch_hashes&.include?(Checksum.new(version.to_s)) return true unless patch_hashes&.include?(Checksum.new(version.to_s))
elsif resource_name && stable && (resource_version = stable.resources[resource_name]&.version) elsif resource_name && stable && (resource_version = stable.resources[resource_name]&.version)
return true if resource_version != version return true if resource_version != version