Commit Graph

488 Commits

Author SHA1 Message Date
Paul Hinze 93b63bd583 clean up and pull out link checker / audit common code 2013-03-13 13:03:12 -05:00
Paul Hinze 972ed76799 add fake HTTP HEAD checking for google code URLs
this allows google code urls to pass link checking.

refs #131
2013-03-13 12:42:54 -05:00
Paul Hinze 78834bfbd0 extract link checker from audit process
did not duplicate content lentgh check in preparation for the removal of
content_length as discussed in #131
2013-03-13 12:41:16 -05: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
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
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 97b715b27d demockify actions_tests 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 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 31719b32f5 clean up includes 2012-11-18 12:27:14 -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 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 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 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 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