diff --git a/Library/Homebrew/cask/cask.rb b/Library/Homebrew/cask/cask.rb index 901853d03a9cb..08ac1b3340d0c 100644 --- a/Library/Homebrew/cask/cask.rb +++ b/Library/Homebrew/cask/cask.rb @@ -174,7 +174,7 @@ def uninstall_flight_blocks? def install_time # /.metadata///Casks/.{rb,json} -> 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 sig { returns(T.nilable(Pathname)) } diff --git a/Library/Homebrew/cleanup.rb b/Library/Homebrew/cleanup.rb index e94a8c2e317c2..00ca1e00d049b 100644 --- a/Library/Homebrew/cleanup.rb +++ b/Library/Homebrew/cleanup.rb @@ -154,7 +154,7 @@ def stale_formula?(pathname, scrub) stable = formula.stable 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)) elsif resource_name && stable && (resource_version = stable.resources[resource_name]&.version) return true if resource_version != version