Commit Graph

36 Commits

Author SHA1 Message Date
Paul Hinze 3c9423e8c6 naked pkg support + major container refactor
`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
2013-09-21 21:59:07 -05:00
phinze fbc246fa5c fix overzealous cask already created error
this prevented any cask being created via `brew cask create` that was a
suffix substring of an existing cask.

refs #998
2013-09-09 11:16:26 -05:00
Michael Ford 6b5c1af440 Correct Adium URL to fix failing unit test 2013-07-21 21:24:27 +08:00
Robert Curth ba52f6377e [#583] Auditing of cask download and checksums
closes #688
2013-07-07 09:06:02 -05:00
James Anderson 11a2af136e Update cask template with shortened link syntax 2013-05-29 06:33:05 -07:00
Paul Hinze 9835591935 whoops! pass down force argument to installer
this was preventing the `brew cask install --force cask` syntax from
working

the test was wrong too - corrected that so now we're covered from future
breakage

refs #329
2013-05-14 18:08:59 -05:00
Paul Hinze 17026b6e93 don't reinstall already installed casks
thanks to @ccutrer for the catch; this implementation is based on his PR

refs #233
2013-05-11 23:32:17 -05:00
phinze fed2824c7f add bona fide `brew cask create` command
the create command opens up an editor with template to get started

remove --create override flag from `brew cask edit`

hopefully this will be more straightforward for contributors

refs #306
2013-05-11 19:24:17 -05:00
phinze 43296f201a whoops; missed a spot 2013-05-11 14:21:01 -05:00
phinze a8b343b869 fix github links in `brew cask info`
refs #294
2013-05-11 14:02:53 -05:00
phinze ce94c6de2a update alfred linking to work with Alfred 2.0
i'm not going to worry about backwards compatibility with Alfred 1.X -
forward to the future!

closes #18
2013-05-11 13:53:10 -05:00
phinze d4cecf35c9 programmatically modify alfred scope
refs #18
2013-04-28 13:56:26 -05:00
phinze 3a20b320d0 fix issue where linkapps would double symlink
since ln was not using the -h it was following the target symlink
destination and deciding it was a destination directory. madness
ensued.

also test cleanup and more output and change linkables to use sets
2013-04-13 18:17:20 -05:00
phinze 6cb1afa246 add unlinkapps for cli access to revert linkapps 2013-04-13 14:17:00 -05:00
phinze e16e1622c0 automatically link on install / unlink on uninstall 2013-04-13 14:10:37 -05:00
phinze 1585d52ddc linkapps 2.0 2013-04-07 12:56:55 -05:00
phinze 7bc2db2979 build fixes 2013-04-07 12:46:35 -05:00
phinze 9f9849134f a quixotic journey to a passing travis build
Squashed commit of the following:

commit 379d19d38da69a25f2ddf0b802a2e1c9cd2e40df
Author: phinze <paul.t.hinze@gmail.com>
Date:   Fri Apr 5 02:04:56 2013 -0600

    concat out+err?

commit 3414556d5e494c89a1b91322be666df9933d29f2
Author: phinze <paul.t.hinze@gmail.com>
Date:   Fri Apr 5 01:59:06 2013 -0600

    switch to capture_subprocces_io

commit d50a878bf20892db4d136530ff64e5cb94fe3ae4
Author: phinze <paul.t.hinze@gmail.com>
Date:   Fri Apr 5 01:42:41 2013 -0600

    ensure later version of minitest

commit 49078c48b024e1f1ed1b5d9785de60ec050ee261
Author: phinze <paul.t.hinze@gmail.com>
Date:   Fri Apr 5 01:30:12 2013 -0600

    pull down a newer minitest

    hopefully to fix must_output

commit 537b5ddd22de57f0fff812646a03b982725dfa23
Author: phinze <paul.t.hinze@gmail.com>
Date:   Fri Apr 5 01:24:53 2013 -0600

    run a brew update in the build

commit 1516456663f8840f5ffc22345e140c0b5aa23c96
Author: phinze <paul.t.hinze@gmail.com>
Date:   Fri Apr 5 01:22:31 2013 -0600

    remove stray puts

commit 4c8f8348f88ffd8eafd7a1f948f70dfbc881b416
Author: phinze <paul.t.hinze@gmail.com>
Date:   Fri Apr 5 01:16:10 2013 -0600

    add expand_path to see if that helps

commit c6e8aa160dd4c778497de4dca8f90f4519d76bd4
Author: phinze <paul.t.hinze@gmail.com>
Date:   Fri Apr 5 01:13:22 2013 -0600

    add debugging output for travis
2013-04-05 02:08:51 -06:00
phinze bf33643526 create casks with `brew cask edit foo --create` 2013-04-04 16:24:26 -06:00
phinze b156c04b84 basic tests around edit 2013-04-04 14:24:28 -06:00
phinze 6ac7b48ce2 fix broken info tests
prevent future breakage by relying on testcasks instead of live ones
2013-04-04 14:10:44 -06:00
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
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 067973074d demockify install_test 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 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 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 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 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