Skip to content

bundle: dump full cask names#21417

Merged
MikeMcQuaid merged 1 commit intoHomebrew:mainfrom
gromgit:bundle/dump-full-cask-names
Jan 17, 2026
Merged

bundle: dump full cask names#21417
MikeMcQuaid merged 1 commit intoHomebrew:mainfrom
gromgit:bundle/dump-full-cask-names

Conversation

@gromgit
Copy link
Copy Markdown
Contributor

@gromgit gromgit commented Jan 17, 2026

This mirrors existing 3rd-party formulae disambiguation.

Fixes #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"
  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same change?
  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your changes? Here's an example.
  • Have you successfully run brew lgtm (style, typechecking and tests) with your changes locally?

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"
```
Copy link
Copy Markdown
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @gromgit!

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
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a little weird but not a blocker; when doesn't it respond to full_name?

Copy link
Copy Markdown
Contributor Author

@gromgit gromgit Jan 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll see what I can do.

@MikeMcQuaid MikeMcQuaid added this pull request to the merge queue Jan 17, 2026
Merged via the queue into Homebrew:main with commit 98c10f6 Jan 17, 2026
55 of 56 checks passed
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.
@gromgit gromgit mentioned this pull request Jan 18, 2026
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

brew bundle install should install taps first

2 participants