Commit Graph

232 Commits

Author SHA1 Message Date
phinze 0dbb81b0e1 rename 'open' -> 'home' to match homebrew
closes #167
2013-02-22 16:32:02 -06:00
phinze ff80676b29 add `brew cask info` command
thanks to @passcod for original implementation on his fork

refs #72
2013-02-17 14:25:23 -06:00
phinze f866a18725 add `brew cask open` command
thanks to @passcod for original implementation on his fork

refs #72
2013-02-17 14:07:59 -06:00
phinze 9189bd5be6 Out of the Cellar, into the Caskroom
Install casks into HOMEBREW_PREFIX/"Caskroom" instead of the Cellar.
This prevents us from colliding with normal Homebrew Formulae.

NOTE: this will be a breaking change, with the following effects:

- all installed casks will no longer be reported as installed
- orphans all existing casks in the Cellar
- no automated facility for cleanup or migration of existing casks

refs #38, where we can discuss the implications of this before cutting a
new release
2013-02-17 12:54:44 -06:00
Mikko Kouhia d36b9ffdda Update test cask
Test cask previously contained only attributes `url`, `homepage` and
`version`.  Add also `content_length` and `sha1`.
2013-01-06 13:46:04 +02:00
Paul Hinze fca6c49beb Merge pull request #117 from passcod/options-support
Add options to the cli
2012-12-19 22:51:40 -08:00
Félix Saparelli 5ad6796bcd Add options to the cli
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).
2012-12-19 00:54:49 +13:00
phinze 0d1f831b79 Add checksum support to Casks.
`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
2012-12-17 17:04:22 -07:00
phinze f1221be6c2 double gsub to properly get title for BootXChange
thanks to @passcod for this
2012-12-17 17:00:35 -07:00
phinze c8621c92c1 remove mock-filled test for Cask.init 2012-11-25 15:49:16 -06:00
phinze 067973074d demockify install_test 2012-11-25 15:49:16 -06:00
phinze 97b715b27d demockify actions_tests 2012-11-25 15:49:16 -06:00
phinze c96ea20317 get linkapps tests de-mockified 2012-11-25 15:49:16 -06:00
phinze 3ad61a5d56 halfway through ripping out mocha 2012-11-25 15:49:09 -06:00
phinze 3ac3ae6360 fix linkapps and cleanup output
damn i'm getting burned by mocking in my tests - going to have to fix
something here
2012-11-21 17:53:15 -06:00
phinze 259ed643f9 fix dmg plist parsing problem
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
2012-11-21 16:12:45 -06:00
phinze ef25273d96 allow test suite to be run without internet 2012-11-21 15:51:03 -06:00
phinze 2a22a74415 fix broken cask list 2012-11-20 10:21:28 -06:00
phinze 2f99d29693 brew cask audit
for a given cask:
 - checks required fields
 - checks URL responds successfully
 - checks content_length specified
2012-11-18 23:12:21 -06:00
phinze e2d074e216 separate Cask.all_titles from Cask.all 2012-11-18 23:11:22 -06:00
phinze 9e509d289b uninstall no longer depends uses homebrew
- should make tests a bit more reliable
2012-11-18 12:17:50 -06:00
phinze 3539767745 fix uninstall to work with multiple casks at once
homebrew does internal caching in ARGV that prevents us from doing the
`ARGV.clear; ARGV << 'newarg'` trick twice.

rather than try to further reach in to homebrew's innards, i figure it's
better to just pass multiple arguments down to homebrew code at once,
since it already supports that

refs #47
2012-10-20 13:34:11 -05:00
phinze ab57da07ea add brew cask uninstall
this delegates to homebrew's uninstall to get its work done. vanilla
`brew uninstall` actually works, but this gives us a more consistent
interface.

as discussed in #47
2012-10-20 13:01:41 -05:00
phinze c40dc63737 fix typo in Cask.init :(
💩 this is what i get for doing things outside of test coverage

added a smoke test this time
2012-10-15 19:25:35 -05:00
phinze 9b2f2c7ecd allow `brew cask linkapps` to accept arguments
arguments scope linkapps command to just those casks

also added unit tests around the CLI code - whee!
2012-10-15 18:45:55 -05:00
phinze 96cff81979 have linkapps recognizes apps in subdirs
should address #33

includes cleanup and tests

i'm not crazy about leaning on installing/uninstalling caffeine in the
tests. it makes for some unnecessarily heavy tests and downloads. but
i'd rather get tests in place first then fix the warts.
2012-10-15 18:28:36 -05:00
phinze 1a7e278935 a bona fide cask install test; and more splitting
I chose Caffeine since it's relatively small to download. Eventually I'd
like to switch this up so we bundle a dmg, zip, etc that the test suite
wires in to verify that we do the Right Thing (tm) with all those file
types. Probably will want to support `file://` URLs in Casks to help us
for that use case.
2012-10-13 16:48:25 -05:00
phinze a0434184b0 basic testing and separation of the Cask DSL 2012-10-13 16:30:59 -05:00
phinze f35cda322c add test coverage and start to split up cask.rb
ahhhhh the joys of refactoring under test coverage
2012-10-13 16:17:52 -05:00
phinze 550ea38adc mkdir HOMEBREW_CACHE to allow downloads in tests 2012-10-13 16:17:27 -05:00
phinze ab564ef254 handle multiple casks with install
should address #52

includes better error handling if a nonexistent cask is referenced

first test-driven commit, suckas!
2012-10-13 15:28:59 -05:00
phinze cd70474aa9 moving back from spec/ -> test/
since various tooling keeps guessing we're using rspec
2012-10-13 15:24:45 -05:00