- re-added a lost nil guard on `Dmg` containers
- `FakeSystemCommand` was still returning an array of split lines
instead of a string, even though its real counterpart switched to
string when install/uninstall landed
- flushed out an alfred cli bug
- moved plist parsing down to SystemCommand layer
`Cask::Installer` was already much too complex, so I took this
opportunity to throw a `Cask::Container` abstraction around the
extraction part of the package install step.
It goes like this: a Cask's URL points to a Container of some sort. The
containers we currently support are: dmg, zip, tar, and (new) naked.
Naked refers to a raw file that just needs to be copied in place. This
currently just means a pkg file, but in the future it may expand.
A Container knows how to do two things: identify a path as being its
type (`Container.me?`) and extracting the contents of its container to
the proper destination for a Cask (`Container#extract`).
The first Cask we have that supports the naked pkg type is
`heroku-toolbelt`. (Thanks to @sheerun for the Cask definition.)
Other miscellania batched in with this refactor:
- switched to an explicit require strategy rather than globbing
- `Cask::Installer` is instantiated now to match its interface with
other similar collaorators
- simplified zip and tar identification to shorter strings rather than
exact matches of full `file -Izb` output
- `Cask::SystemCommand` gets explicit output redirection options
- many rogue backticks replaced to properly use `SystemCommand`
- fixed misnamed test file `link_checker_spec.rb`
- remove some extraneous `after` clauses in tests; leaning more on
`test/support/cleanup.rb` to uninstall for us
- pkg uninstall `:files` gets a `-rf` to support removing dirs
refs #839 and #1043
accepts a single argument, which is a relative path to a pkg
inside the extracted Cask; homebrew-cask will attempt to install this
pkg after the Cask is extracted via `installer`
because of the many different ways uninstallers work, this
has several features:
- `:script`: a script in the Cask which serves as an uninstaller (e.g.
Vagrant, VirtualBox), uses `:args`, and `:input` keys to interact
with said script
- `:pkgutil`: a regexp which captures all package_ids installed by this
cask; homebrew-cask will list all files installed under these ids and
remove them
- `:launchctl`: a list of bundle_ids for services that should be
removed by homebrew-cask
- `:files`: a fallback list of files to manually remove; helps when
uninstallers miss something
refs #661
- the vagrant cask is our guinea pig
- works for me
- only basic testing at the moment
- i wanted to push something to get the gears turning on this
it turns out the concept is pretty simple. specify a list of pkgs to
install; borrow the patterns from linkables for that. then basically
just run "sudo installer"
refs #14
this way travis will be able to cover incoming pull requests of new
casks by running the audit on them. cool!
also:
- add checksums to audit
- fix missing checksums
Options can be passed on the command-line and/or using
the HOMEBREW_CASK_OPTS environment variable (which has
lowest priority). There is a single --appdir=PATH option
right now, but this commit enables future awesomeness!
Other minor changes:
* `brew cask help` now returns the same thing as `brew cask`
instead of saying there was “no such command as help”.
* The HEREDOC block now uses Homebrew's #undent instead of the
customed-rolled #gsub version. Cleaner and more flexible.
* `Cask.set_appdir` has been renamed to `Cask.appdir=`. This
is more Rubyish, and of little consequence (the only place
it was previously used was in the tests).
`md5`, `sha1`, `sha256` all take a hexdigest string, e.g:
sha1 'f645e9da45a621415a07a7492c45923b1a1fd4d4'
`no_checksum` takes no argument, and indicates there is no checksum
for this cask. This is *not recommended*, and should only be used for
casks that have no versioned downloads.
`brew cask install` will complain if there is no sum provided (unless
`no_checksum` has been invoked), or if the sums do not match. It will
provide the computed checksum so the cask can be easily amended.
Adapted from @passcod's work in 82cc199ae6
should take care of #104
this was a subtle one - after i reorganized the requires, plist/parser
was getting double required, which broke plist parsing and hence dmg
installs