Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Kevin <[email protected]>
  • Loading branch information
2 people authored and MikeMcQuaid committed Nov 5, 2024
1 parent 521c463 commit a2612e2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Library/Homebrew/cask/cask.rb
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def uninstall_flight_blocks?
def install_time
# <caskroom_path>/.metadata/<version>/<timestamp>/Casks/<token>.{rb,json} -> <timestamp>
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)) }
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/cleanup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a2612e2

Please sign in to comment.