bundle: dump full cask names#21417
Merged
MikeMcQuaid merged 1 commit intoHomebrew:mainfrom Jan 17, 2026
Merged
Conversation
This mirrors existing 3rd-party formulae disambiguation. Addresses Homebrew#21416. Before: ``` % brew bundle dump --file=- | grep -E '(jq|pup|font)' tap "colindean/fonts-nonfree" brew "jq" brew "gromgit/tap/pup" cask "font-dseg" cask "font-lato" cask "font-microsoft-office" ``` After: ``` % brew bundle dump --file=- | grep -E '(jq|pup|font)' tap "colindean/fonts-nonfree" brew "jq" brew "gromgit/tap/pup" cask "rami3l/tap/font-dseg" cask "font-lato" cask "colindean/fonts-nonfree/font-microsoft-office" ```
MikeMcQuaid
approved these changes
Jan 17, 2026
| sig { params(describe: T::Boolean).returns(String) } | ||
| def self.dump(describe: false) | ||
| casks.map do |cask| | ||
| name = cask.respond_to?(:full_name) ? cask.full_name : cask.to_s |
Member
There was a problem hiding this comment.
This is a little weird but not a blocker; when doesn't it respond to full_name?
Contributor
Author
There was a problem hiding this comment.
Yup. brew install dump works just fine if I just do cask.full_name, but brew tests kept throwing errors like:
Failures:
1) Homebrew::Bundle::CaskDumper when casks `foo`, `bar` and `baz` are installed, with `baz` being a formula requirement dumps as `cask 'baz'` and `cask 'foo' cask 'bar'` plus descriptions and config values
Got 4 failures:
1.1) Failure/Error: expect(dumper.dump(describe: true)).to eql(expected.chomp)
#<InstanceDouble(Cask::Cask) (anonymous)> received unexpected message :full_name with (no args)
# ./bundle/cask_dumper.rb:42:in 'block in Homebrew::Bundle::CaskDumper.dump'
# ./bundle/cask_dumper.rb:39:in 'Array#map'
# ./bundle/cask_dumper.rb:39:in 'Homebrew::Bundle::CaskDumper.dump'
# ./test/bundle/cask_dumper_spec.rb:80:in 'block (3 levels) in <main>'
1.2) Failure/Error: expect(dumper.dump(describe: true)).to eql(expected.chomp)
#<InstanceDouble(Cask::Cask) (anonymous)> received unexpected message :full_name with (no args)
# ./bundle/cask_dumper.rb:42:in 'block in Homebrew::Bundle::CaskDumper.dump'
# ./bundle/cask_dumper.rb:39:in 'Array#map'
# ./bundle/cask_dumper.rb:39:in 'Homebrew::Bundle::CaskDumper.dump'
# ./test/bundle/cask_dumper_spec.rb:80:in 'block (3 levels) in <main>'
1.3) Failure/Error: expect(dumper.dump(describe: true)).to eql(expected.chomp)
#<InstanceDouble(Cask::Cask) (anonymous)> received unexpected message :full_name with (no args)
# ./bundle/cask_dumper.rb:42:in 'block in Homebrew::Bundle::CaskDumper.dump'
# ./bundle/cask_dumper.rb:39:in 'Array#map'
# ./bundle/cask_dumper.rb:39:in 'Homebrew::Bundle::CaskDumper.dump'
# ./test/bundle/cask_dumper_spec.rb:80:in 'block (3 levels) in <main>'
1.4) Failure/Error: expect(dumper.dump(describe: true)).to eql(expected.chomp)
expected: "cask \"foo\"\ncask \"bar\", args: { fontdir: \"/Library/Fonts\", language: \"zh-TW\" }\n# Software\ncask \"baz\""
got: "cask \"#<RSpec::Expectations::FailureAggregator::AggregatedFailure:0x0000000121e50c00>\"\ncask \"#<RSpec::Expectations::FailureAggregator::AggregatedFailure:0x0000000121e50c00>\", args: { fontdir: \"/Library/Fonts\", language: \"zh-TW\" }\n# Software\ncask \"#<RSpec::Expectations::FailureAggregator::AggregatedFailure:0x0000000121e50c00>\""
(compared using eql?)
Diff:
@@ -1,4 +1,4 @@
-cask "foo"
-cask "bar", args: { fontdir: "/Library/Fonts", language: "zh-TW" }
+cask "#<RSpec::Expectations::FailureAggregator::AggregatedFailure:0x0000000121e50c00>"
+cask "#<RSpec::Expectations::FailureAggregator::AggregatedFailure:0x0000000121e50c00>", args: { fontdir: "/Library/Fonts", language: "zh-TW" }
# Software
-cask "baz"
+cask "#<RSpec::Expectations::FailureAggregator::AggregatedFailure:0x0000000121e50c00>"
# ./test/bundle/cask_dumper_spec.rb:80:in 'block (3 levels) in <main>'
I think it's because the test cask objects aren't fully populated like actual cask objects.
Member
There was a problem hiding this comment.
@gromgit Thanks! If you can be bothered: ideally populate those test cask double objects in the cask_dumper_spec instead so it always provides a full_name? No worries if not.
Contributor
Author
There was a problem hiding this comment.
I'll see what I can do.
gromgit
added a commit
to gromgit/homebrew-brew
that referenced
this pull request
Jan 18, 2026
Followup to Homebrew#21417. This removes the needs for `respond_to?` gymnastics.
gromgit
added a commit
to gromgit/homebrew-brew
that referenced
this pull request
Jan 18, 2026
Followup to Homebrew#21417. This removes the needs for `respond_to?` gymnastics.
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This mirrors existing 3rd-party formulae disambiguation.
Fixes #21416.
Before:
After:
brew lgtm(style, typechecking and tests) with your changes locally?