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

Fix an issue with --debug and _dump on Ruby 1.8.7 #7893

Merged
merged 1 commit into from
Dec 8, 2014
Merged

Fix an issue with --debug and _dump on Ruby 1.8.7 #7893

merged 1 commit into from
Dec 8, 2014

Conversation

claui
Copy link
Contributor

@claui claui commented Dec 8, 2014

This is a very minor issue I bumped into while working on brew cask search. For casks that have an installer stanza, the internal command brew cask _dump would fail on Ruby 1.8.7. One example where this occurs is the Cask adobe-air.

Assuming both rbenv and 1.8.7-p375 installed, the issue can be reproduced like so:

RBENV_VERSION=1.8.7-p375 HOMEBREW_BREW_FILE=/usr/local/bin/brew ruby /usr/local/Library/brew.rb /usr/local/bin/brew-cask _dump adobe-air

This would result in the following error:

Warning: adobe-air was not found or would not load: wrong number of arguments (1 for 0)
Error: nothing to dump
/usr/local/Cellar/brew-cask/0.49.0/rubylib/cask/cli/internal_dump.rb:8:in `run'
/usr/local/Cellar/brew-cask/0.49.0/rubylib/cask/cli.rb:81:in `run_command'
/usr/local/Cellar/brew-cask/0.49.0/rubylib/cask/cli.rb:121:in `process'
/usr/local/bin/brew-cask.rb:42
/usr/local/Library/brew.rb:59:in `require'
/usr/local/Library/brew.rb:59:in `require?'
/usr/local/Library/brew.rb:118

This fixes an issue where both the `--debug` option and the `brew cask _dump` command would fail on Ruby 1.8.7 when the Cask has an `installer` stanza, e. g. `adobe-air`.
@claui claui added the core Issue with Homebrew itself rather than with a specific cask. label Dec 8, 2014
@rolandwalker
Copy link
Contributor

Right, because installer is just a species of artifact, and artifacts are dumped together. Those methods look like copypasta (from me).

Perhaps the class name Cask::DSL::Installer could be changed to clarify that it is an artifact. Then again, all the other DSL classes are named exactly after the stanza name.

Certainly we could gain clarity by changing/breaking apart Cask::Installer (lib/cask/installer.rb).

I hope to revisit _dump soon to define a static downstream JSON Cask representation based on DSL 1.0. The YAML should be changed as well, to represent the entire Cask within a single structure.

rolandwalker added a commit that referenced this pull request Dec 8, 2014
Fix an issue with `--debug` and `_dump` on Ruby 1.8.7
@rolandwalker rolandwalker merged commit 25ff854 into Homebrew:master Dec 8, 2014
@claui claui deleted the fix-brew-cask-dump-ruby18 branch December 8, 2014 12:52
@miccal miccal removed the core Issue with Homebrew itself rather than with a specific cask. label Dec 23, 2016
@Homebrew Homebrew locked and limited conversation to collaborators May 8, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants