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 c55728c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Library/Homebrew/cask/cask.rb
Original file line number Diff line number Diff line change
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
7 changes: 5 additions & 2 deletions Library/Homebrew/tap.rb
Original file line number Diff line number Diff line change
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 @@ -783,9 +784,11 @@ def cask_renames
end

# Hash with tap formula old names. Reverse of {#formula_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|
hash[new_name] ||= []
hash[new_name] << old_name
end
Expand Down

0 comments on commit c55728c

Please sign in to comment.