Skip to content

Commit

Permalink
Rename Tap#reverse_cask_renames to Tap#cask_reverse_renames.
Browse files Browse the repository at this point in the history
  • Loading branch information
reitermarkus committed Mar 1, 2024
1 parent f1eea64 commit c3c5437
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Library/Homebrew/cask/cask.rb
Expand Up @@ -87,7 +87,7 @@ def initialize(token, sourcefile_path: nil, source: nil, tap: nil, loaded_from_a
def old_tokens
@old_tokens ||= if (tap = self.tap)
Tap.reverse_tap_migrations_renames.fetch("#{tap}/#{token}", []) +
tap.reverse_cask_renames.fetch(token, [])
tap.cask_reverse_renames.fetch(token, [])
else
[]
end
Expand Down
9 changes: 6 additions & 3 deletions Library/Homebrew/tap.rb
Expand Up @@ -163,6 +163,7 @@ def clear_cache
@formula_files_by_name = nil
@cask_files = nil
@cask_files_by_name = nil
@cask_reverse_renames = nil
@alias_dir = nil
@alias_files = nil
@aliases = nil
Expand Down Expand Up @@ -782,10 +783,12 @@ def cask_renames
end
end

# Hash with tap formula old names. Reverse of {#formula_renames}.
# Mapping from new to old cask tokens. Reverse of {#cask_renames}.
#
# @private
sig { returns(T::Hash[String, T::Array[String]]) }
def reverse_cask_renames
@reverse_cask_renames ||= cask_renames.each_with_object({}) do |(old_name, new_name), hash|
def cask_reverse_renames
@cask_reverse_renames ||= cask_renames.each_with_object({}) do |(old_name, new_name), hash|

Check warning on line 791 in Library/Homebrew/tap.rb

View check run for this annotation

Codecov / codecov/patch

Library/Homebrew/tap.rb#L791

Added line #L791 was not covered by tests
hash[new_name] ||= []
hash[new_name] << old_name
end
Expand Down

0 comments on commit c3c5437

Please sign in to comment.