Commit Graph

1075 Commits

Author SHA1 Message Date
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
Sean T Allen 444973c5b4 Add cask for Jumpcut.
Jumpcut is a tgz file whose handling isn't currently supported.
This commit adds support for it.

The test for tar.gz and tar.bz are very similar and could probably
be refactored. Leaving that as an exercise for another time.
Should have more use cases before opening that up.
2012-10-14 04:30:39 -04:00
phinze c44192c1d3 eat ditto warnings
a cheap way to address #17.

i don't really like it, but after a bunch of research and
experimentation to figure out if we can skip `.Trashes` or remove it,
this was the best i could come up with.
2012-10-13 17:00:37 -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 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 f1932a4d8c OMG a test suite!
Just getting started of course, but this piggy backs on Homebrew's
testing strategy to give us a platform for a fully featured test suite.
Neato!

And the tests provide value right away, as I added some better error
handling to `Cask.load`.

Big things ahead. Just you wait.
2012-10-13 14:39:00 -05:00
phinze eb04e6784a properly recognize existing symlinks in linkapps
turns out a symlink of a directory is both a symlink and a directory, so
you have to test for symlink first if you want to catch it.

this should address #36
2012-10-10 13:46:51 -05:00
phinze 501d1bad58 consistently quote shell commands to handle spaces
addresses issues brought up in #34
2012-10-10 13:18:41 -05:00
phinze cf2470b96a fix a little typo that got in linkapps' way 2012-10-05 10:48:13 -05:00
Félix Saparelli f9ac30cf2d Fix broken linkapps command 2012-10-06 03:08:32 +13:00
Félix Saparelli 51e5760615 Allow wider definition for _zip?
Some zip files have a different definition, e.g.
Minecraft has:

    application/xml; charset=utf-8 compressed-encoding=application/zip;
      charset=binary; charset=binary

Most other zips have:

    application/x-empty; compressed-encoding=application/zip;
      charset=binary; charset=binary

But the result is the same. So now we test only for:

    compressed-encoding=application/zip; charset=binary; charset=binary
2012-09-24 16:26:50 +12:00
Félix Saparelli 4de758bca3 Add tap support to `edit` and `list`
Most notably, Cask.all returns an array of strings,
not of Cask instances. This makes things easier, as
well as faster, as there's no need to run map(&:to_s)
everywhere anymore.

self.path is a utility method which returns the path
of the cask from its title. There's something subtle
going in there:

 - If `cask_title` is fully qualified, e.g.
   "phinze-cask/alfred", it's straightforward.

 - If `cask_title` is only the name, e.g.
   "firefox-aurora", the name is matched from
   the full list (self.all) (which isn't sorted)
   and the first result is returned.

Hence, self.path with only the name is not precise.
There might be the possibility to apply heuristics
to do a better match (prefer phinze-cask, or maybe
installed casks?) but that's for another issue :-)

self.nice_listing is another utility method used
in `search` and `list`. It returns a list where
unique casks don't have a prefix, and duplicates
do. The prefix is the tap name. The list is then
sorted. For an example or two, look at the first
comment on phinze/#12.
2012-09-24 16:10:51 +12:00
Félix Saparelli 5b51542ccf Use puts_columns 2012-09-24 16:10:51 +12:00
Félix Saparelli 4a6e0b2513 Sort search results 2012-09-24 16:10:50 +12:00
Félix Saparelli 3d3207bf5d Add basic taps functionality; partial phinze/#12 support
Instead of only listing `Taps/phinze-cask/Casks`, now list
every taps that has a `Casks` directory. Might conflict with
a few commands for the moment, works OK with `brew cask search`.
2012-09-24 16:10:50 +12:00
phinze b45974c224 support `brew cask edit` 2012-09-21 23:32:19 -05:00
phinze 029bd855db support tar-bzip archives so we can add macvim 2012-09-21 23:05:10 -05:00
phinze 9e421ee368 ohai the success message 2012-09-21 23:04:53 -05:00
phinze ff6f5c75fa fix broken downloads due to changed interface
fixes #9
2012-08-25 21:22:52 -05:00
phinze 0962ab3b47 reference Casks from permanent home under Taps 2012-08-25 20:59:34 -05:00
phinze e342897a91 fix linkapps, which was making circular symlinks
whoopsie
2012-03-10 14:25:42 -06:00
phinze 5a0d1d5556 quick sketchy first release of code/ideas
this is a first draft of an idea i've had kicking around for awhile

pushing out some code so i can get a conversation started
2012-03-09 22:43:50 -06:00