Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename Tap#reverse_cask_renames to Tap#cask_reverse_renames. #16782

Merged
merged 1 commit into from
Mar 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
9 changes: 6 additions & 3 deletions Library/Homebrew/tap.rb
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@
@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 @@
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