Commit Graph

416 Commits

Author SHA1 Message Date
Roland Walker 1c72aa0c64 Merge pull request #4948 from rolandwalker/test_repo_layout
add tests for expected layout of files in repo
2014-06-18 09:46:01 -04:00
Roland Walker ad4989416a add tests for expected layout of files in repo
References: #4914
2014-06-17 09:06:43 -04:00
Roland Walker 3cb729095d suggested (not enforced) order for Cask stanzas
References: #4914
2014-06-16 13:32:08 -04:00
Roland Walker 4f3ecb1cc3 Downgrade Cask install errors to warnings
Including the case where a Cask is already installed.
Always continue installing when multiple Casks are specified,
only raising an exception at the end of the command (if some
portion of the attempted install actions failed).  Never
exit with an error code if "already installed" was the only
problem seen during the run.

Also tweak error messages.

Fixes #1347, #2677, #4785

Required disabling two tests regarding suggestions on Cask
spelling errors.
2014-06-10 12:13:59 -04:00
Roland Walker d8ad14aaa5 Merge pull request #4757 from rolandwalker/https_in_create
prompt for HTTPS URLs in `brew cask create`
2014-06-07 15:35:45 -04:00
Roland Walker 154eb2b12f prompt for HTTPS URLs in `brew cask create` 2014-06-07 14:36:35 -04:00
Roland Walker f0ea05316d Merge pull request #4743 from NanoXD/add_versioned_cask_with_no_checksum_test
Add audit for versioned casks with no checksum
2014-06-07 13:51:11 -04:00
Roland Walker cf89f7f7e8 regularize whitespace 2014-06-07 11:43:40 -04:00
Fernando Paredes a4d479c3c4 Add audit for versioned casks with no checksum
* Check if version is not latest and has a sha256 :no_check for checksum
2014-06-06 21:22:19 -07:00
Fernando Paredes b767f9f1e6 Add OS X 10.10 as a known OS version
* In Yosemite the tests failed for being unknown
2014-06-06 10:56:41 -07:00
Roland Walker 0ef4606e0c retire support for `no_checksum` stanza 2014-06-04 23:26:09 -04:00
Roland Walker abd66acba1 Merge pull request #4370 from rolandwalker/uninstall_signal
add `:signal` directive for `uninstall`
2014-05-14 06:26:49 -04:00
Roland Walker 6815ef272e don't use doubledash on launchctl remove
it appears to be incorrect here: removal of jobs is hindered
2014-05-13 18:52:35 -04:00
Roland Walker b38d6a6977 add `:signal` directive for `uninstall`
to send arbitrary Unix signals.  Per discussion in #4328, some
processes are resistant to the `:quit` directive, and can be
made to shut down via a signal.
2014-05-13 13:04:10 -04:00
Roland Walker cfc6ae7a13 Merge pull request #4264 from rolandwalker/retire_sha1
Retire support for `sha1` stanza.
2014-05-08 18:37:00 -04:00
Roland Walker 25c7ee5962 Re-enable failing "search" test
This test used to selectively fail only on Travis.  The problem
was never isolated.  However, it was apparently recently fixed,
probably in #4042.
2014-05-08 16:05:35 -04:00
Roland Walker 34df5309d4 Retire support for `sha1` stanza.
We haven't received new submissions using `sha1` for quite
some time.
2014-05-08 12:01:32 -04:00
Roland Walker c436ddc5fd transition docs/tests/messages to sha256 :no_check
`sha256 :no_check` has been supported syntax for a couple of months,
and now is being transitioned to the preferred syntax, replacing
the `no_checksum` stanza (which will still be supported, but
deprecated)
2014-05-08 08:42:44 -04:00
Roland Walker 4f82dda065 Merge pull request #4242 from rolandwalker/cat_documentation
update docs and messages for `brew cask cat`
2014-05-07 22:34:07 -04:00
Roland Walker e910467b39 update docs and messages for `brew cask cat` 2014-05-07 10:32:15 -04:00
Roland Walker e9f6c196f8 Merge pull request #4229 from rolandwalker/defend_unusual_homebrew
Defend against unusual Homebrew setups
2014-05-07 10:12:58 -04:00
Roland Walker 0153c19f7a Defend against unusual Homebrew setups
To aid in Tap transition.  Require Homebrew 0.9.5, rescue
`rename_tags_dir_if_necessary` (`respond_to?` won't work there
because `rename_tags_dir_if_necessary` is a private method.

References: #4192, @Jackiebo in #4096
2014-05-07 09:50:42 -04:00
Lincoln Lee 227ac512bc Add `brew cask cat` command mentioned in #4018 2014-05-05 22:46:28 +08:00
Paul Hinze f54eaf7082 update all references to new caskroom org home
global replace of:
  'phinze/homebrew-cask' -> 'caskroom/homebrew-cask'
  'phinze/cask' -> 'caskroom/cask'
  'phinze/homebrew-testcasks' -> 'caskroom/homebrew-testcasks'

and various other specific places that needed updates

<3 the homebrew-cask community!
2014-05-03 10:29:17 -05:00
Roland Walker 400433be20 Adapt to homebrew's move of the tap directory
Closes #4035. Closes #4029. Closes #4026.
2014-04-26 09:42:16 -04:00
Roland Walker 5bc2b62b25 Merge pull request #3667 from rolandwalker/artifacts_in_info
display artifact summary in `brew cask info`
2014-03-28 09:33:23 -04:00
Roland Walker 5c8640d6fe Merge pull request #2706 from rolandwalker/install_suggest
suggest replacements on "brew cask install" fail
2014-03-27 08:51:13 -04:00
Roland Walker 421eafaec8 display artifact summary in `brew cask info`
Per discussion with @drew-gross in closed issue #3280.
Limitation: does not show link targets.
2014-03-26 08:55:58 -04:00
Roland Walker be255dcdbc Merge pull request #3515 from rolandwalker/unload_service
explicitly unload :launchctl service before remove
2014-03-14 21:12:14 -04:00
Roland Walker 815168546a update test suite to use sha256
also convert no_checksum to sha256 :no_check in some cases
2014-03-14 09:24:53 -04:00
Roland Walker ba8473a766 explicitly unload :launchctl service before remove 2014-03-14 08:41:18 -04:00
Roland Walker a8acf3de1a bugfix: preserve resource forks when unzipping
Use the unarchiving ability built into the `ditto` utility,
rather explicitly calling the `unzip` utility.  Fixes
caskroom/homebrew-fonts#90.
2014-03-11 08:46:38 -04:00
Pedro Silva e58f3f89ca add new CurlPostDownloadStrategy
- lib/cask/url.rb: initialize(): add new `:data` attribute to hold post parameters
- lib/cask/download.rb: perform(): dispatch to new class based on `:using => :post`
- lib/cask/download_strategy.rb: Cask::CurlPostDownloadStrategy:
  			extend curl_args with x-www-form-urlencoded data
- doc/CASK_LANGUAGE_REFERENCE.md: HTTP URLs: document new strategy
- test/cask/test_download_strategy.rb: Cask::CurlPostDownloadStrategy: test new strategy
2014-03-07 20:51:35 +01:00
Roland Walker 726a650ebd Merge pull request #3106 from rolandwalker/emojii
Emoji and disk usage stats at install success
2014-03-06 21:40:37 -05:00
Roland Walker c95a7f2534 suggest replacements on "brew cask install" fail 2014-03-01 15:04:12 -05:00
Roland Walker 17be66076d remove constant HOMEBREW_TAP_FORMULA_REGEX
we no longer need to set this, as Homebrew added it to
testing_env.rb
2014-03-01 11:42:49 -05:00
Roland Walker c805b2b328 provide fallback setting for homebrew_path
this cannot hurt, and fixed a local problem
2014-03-01 11:40:54 -05:00
Paul Hinze c0f470cd55 Merge pull request #3011 from rolandwalker/force_container_type
ability to specify container type, not detect
2014-02-28 09:23:01 -06:00
Ko-Chih Wu 59e3b183e2 Fix broken `brew cask alfred link`
- Remove quotes from `defaults write` args. With quotes the value is
  written as a string instead of a dictionary, which breaks the search
  scope in alfred.
- Make the default scope consistent with alfred default
2014-02-28 01:00:00 -08:00
Roland Walker 6dd21fbe77 rename intellij-idea-community.rb
to intellij-idea-ce.rb
per naming rules in CONTRIBUTING.md
2014-02-26 09:48:48 -05:00
Roland Walker d5872b20a2 rename intellij-idea-ultimate.rb
to intellij-idea.rb
per naming rules in CONTRIBUTING.md
2014-02-26 08:59:42 -05:00
Roland Walker bf49dc9fa8 ability to specify container type, not detect
Fixes #2997.  Interface is optional DSL stanza `container_type`.
This should only be used in rare instances.  It is needed for the
case of a naked executable which should not be unpacked.
2014-02-25 16:39:12 -05:00
Roland Walker c7e0e5b2e5 support Bzip2 containers
bzips of tarballs are already supported via `tar`.  This
adds support for a single file asset within a bzip2 container.
2014-02-25 16:36:36 -05:00
Roland Walker 9fa39c2681 add support for RAR containers
this will not pass Travis until #2744 is merged
2014-02-25 16:29:24 -05:00
Roland Walker 76eab0ad8a Merge pull request #3040 from rolandwalker/stuffit_containers
add support for Stuffit containers
2014-02-25 16:27:16 -05:00
Roland Walker d639889a3a temporary hack to for travis while test is fixed 2014-02-25 13:11:49 -05:00
Roland Walker fe90e266f5 Merge pull request #2705 from rolandwalker/search_exact
Divide search output into sections
2014-02-25 12:59:53 -05:00
Roland Walker b90633d92a add support for Stuffit containers
This will not pass Travis until #2744 is merged
2014-02-25 12:54:49 -05:00
Roland Walker 76602af5cf Merge pull request #2744 from rolandwalker/sevenzip_containers
Add 7z container support
2014-02-25 12:51:21 -05:00
Võ Anh Duy 33a97a1a5f CLI - Fetch
Add `fetch` command to cli like suggestion at the end of #2528
2014-02-26 00:44:22 +07:00
Roland Walker a75a4840cf Add 7z container support
relevant Casks must use `depends_on_formula unar`
2014-02-25 12:32:37 -05:00
Roland Walker cb627e463c Merge pull request #3073 from rolandwalker/add_target_metadata
add extended attributes for `:target` links
2014-02-25 12:30:15 -05:00
Roland Walker a7647426ce Merge pull request #2467 from vmrob/adobe-air-apps
Add support for Adobe Air app container
2014-02-25 12:23:08 -05:00
Roland Walker 2d8e90eb32 rename rest-client.rb
to `wiztoolsorg-restclient.rb`, per naming rules in `CONTRIBUTING.md`.
This requires making changes to the test suite, as the tests used this
cask.  Imported special test Casks for the relevant test no longer has
a dependency on real Casks.
2014-02-25 09:13:54 -05:00
Roland Walker 6f6a07fc0f mass whitespace cleanup 2014-02-22 21:13:52 -05:00
Roland Walker d40195e8d4 Emoji and disk usage stats at install success
- consistent with Homebrew output
- respects Homebrew environment variables
- does not add any Homebrew code dependency
- really just for fun
2014-02-22 18:24:56 -05:00
Roland Walker 605003228f Merge pull request #2931 from rolandwalker/remove_md5
remove md5 checksum support
2014-02-22 15:31:26 -05:00
Roland Walker 3ad2d6c31c create target directories on-demand
closes #2996.  Moves the logic for creating target directores
from init-time in cask.rb to install-time within the artifact
classes.  Removes the need for special-case mkpath for each
new artifact type.
2014-02-21 09:22:37 -05:00
Roland Walker 066d58d336 add extended attributes for :target links
fixes #2847.  This PR adds OS X-specific extended attributes
(metadata) whenever :target is used on an artifact.  The
extended attributes are available for search software such
as Spotlight or Alfred to discover the artifact under the
:target name.

Limitations: Spotlight specifically chooses to ignore this
attribute for App bundles.  Alfred will also ignore this
attribute until the upcoming 2.2 release.
2014-02-21 08:49:07 -05:00
Roland Walker 664bcb3c4e caveats DSL os_version_only spelling
change method name to follow documentation
2014-02-19 18:51:45 -05:00
Victor Robertson 026ca0c6e1 Add support for Adobe Air app installations
Adobe Air applications take the form of a .air file that the Adobe Air
runtime then installs and creates a .app -- typically in
/Applications.  This patch provides a new container for those .air
files which the Adobe Air runtime installs to the Caskroom as well as
tests for Adobe Air app installations.

Presently, if homebrew-cask doesn't detect the Adobe Air runtime, it
will provide an informative error message and instructions to obtain
it via `brew cask install adobe-air`.  This is obviously not ideal and
the installation process for the runtime should be automated in the
future.
2014-02-17 11:36:01 -06:00
Roland Walker 16ae31edf3 FakeSystemCommand.run! should follow usual case 2014-02-15 12:21:27 -05:00
Roland Walker e4554a170a force consistent timestamps for SVN downloads
to make checksumming work correctly
2014-02-15 12:04:00 -05:00
Roland Walker b67b2c53f2 make clear that only Alfred 2.x is supported
fixes #2891
2014-02-14 19:39:45 -05:00
Roland Walker 15f437ed7b remove md5 checksum support
Following up on #2719.  MD5 checksums are
* nowhere mentioned in our docs
* not used in any existing Cask
* deprecated in Homebrew
Therefore it seems sensible to delete this code.
2014-02-14 19:15:55 -05:00
Roland Walker 82452b3181 Merge pull request #2822 from rolandwalker/svn_download_strategy
add Cask::SubversionDownloadStrategy
2014-02-14 13:27:13 -05:00
Roland Walker 82b9d30a57 Merge pull request #2742 from rolandwalker/before_install
add `before_install` and `before_uninstall`
2014-02-13 11:19:33 -05:00
Roland Walker 44b49b1ee3 Merge pull request #2890 from rolandwalker/portable_class_undefine
Ruby 1.8.7-compat way to undef test classes
2014-02-13 09:38:52 -05:00
Roland Walker 3b5871db8d Ruby 1.8.7-compat way to undef test classes
add cleanup after each definition
2014-02-13 09:21:47 -05:00
Roland Walker aae522966e Merge pull request #2875 from rolandwalker/caveats_formatting_2
trailing blank lines so caveats don't run together
2014-02-12 18:29:39 -05:00
Roland Walker d12acbdf9d Merge pull request #2739 from rolandwalker/allow_untrusted
add `:allow_untrusted` modifier on `install`
2014-02-12 09:39:45 -05:00
Roland Walker eb7f9eb078 trailing blank lines so caveats don't run together 2014-02-12 09:27:49 -05:00
Roland Walker 18a92caf57 Merge pull request #2392 from rolandwalker/list_managed_links
Show managed links in "brew cask list"
2014-02-12 08:11:44 -05:00
Roland Walker 45ed67c64f add :allow_untrusted modifier on install 2014-02-11 14:40:16 -05:00
Roland Walker 8450a29a6a Show managed links in "brew cask list"
Fixes #2261
2014-02-08 16:26:23 -05:00
Roland Walker d6c8a6917d add command `brew cask cleanup`
plus new option --outdated
2014-02-08 14:40:53 -05:00
Roland Walker b55f1804f0 add Cask::SubversionDownloadStrategy
abstract out module `Cask::DownloadStrategy`, add some commentary
2014-02-08 13:30:21 -05:00
Paul Hinze 1f5cc4e1e8 Merge pull request #2719 from lgarron/sha256
Change the template hash function to SHA-256.
2014-02-08 12:20:33 -06:00
Paul Hinze 9faa44e6cc Merge pull request #1992 from rolandwalker/core_fonts
CAB containers
2014-02-08 12:14:18 -06:00
Roland Walker 65292780aa exit with errorcode 1 when a list error occurs
Fixes #2817.  This is now more consistent with Homebrew's
`list`, though not completely, because Homebrew's `list`
refuses to give any output when there is an invalid Formula
argument.  Our `list` stumbles forward instead, giving such
output as is possible based on valid args, but still exiting
with error when invalid args are seen.
2014-02-08 10:03:26 -05:00
Roland Walker 895b838d1d Merge pull request #2748 from rolandwalker/only_once
enforce: certain DSL elements may appear only 1x
2014-02-07 07:48:44 -05:00
Victor Robertson 7f5fbf448c Process SystemCommand arguments in list format
Previously, SystemCommand commands and arguments were processed as
strings which caused problems during shell interpretation if the
arguments were not escaped properly.  Now all commands are expressed
as arrays and no longer require their arguments to be escaped.
Additionally, stderr and stdout could have been interleaved in the
past and now they are always separated.
2014-02-07 06:27:05 -06:00
Roland Walker 50864dc4b3 add `before_install` and `before_uninstall` 2014-02-06 08:32:12 -05:00
Roland Walker 320f8a46d8 Merge pull request #2637 from rolandwalker/version_caveats
add os_version_only to caveats DSL
2014-02-06 08:25:40 -05:00
Roland Walker 34f38caf3e add os_version_only to caveats DSL 2014-02-06 08:25:17 -05:00
Roland Walker f3803afa49 Merge pull request #2741 from rolandwalker/after_block
make sure "after" blocks really run last
2014-02-06 08:22:41 -05:00
Roland Walker d911e0310f Merge pull request #2762 from rolandwalker/rename_curl_download_strategy
rename class to `Cask::CurlDownloadStrategy`
2014-02-06 08:21:13 -05:00
Lucas Garron 913f3e6f76 Change default hash to SHA-256. 2014-02-05 18:16:18 -08:00
Roland Walker 5fabf362c6 Merge pull request #2733 from rolandwalker/testing_constants
add HOMEBREW_TAP_FORMULA_REGEX constant in tests
2014-02-05 10:54:40 -05:00
Roland Walker 9df14ceb4f rename class to `Cask::CurlDownloadStrategy`
To make room to use some of the other download strategies
classes provided by Homebrew, be explicit that we are currently
using only the curl class.
2014-02-05 10:30:58 -05:00
Roland Walker a530a9005c enforce: certain DSL elements may appear only 1x
add CaskInvalidError exception, which ought to be used in
several other places as well
2014-02-04 08:27:12 -05:00
Roland Walker 15d1fe8bbf Merge pull request #2613 from rolandwalker/double_dash
Doubledash hygiene for external commands
2014-02-03 17:00:29 -08:00
Roland Walker 36ce20a4ee support CAB archives 2014-02-03 18:37:20 -05:00
Roland Walker d03239e3c1 make sure "after" blocks really run last
and make it self-documenting by changing class name
2014-02-03 11:22:22 -05:00
Fernando Paredes 9428cad768 Merge pull request #2631 from rolandwalker/rename_cocoa-rest-client
rename cocoa-rest-client.rb
2014-02-02 21:14:02 -08:00
Roland Walker 3633384036 add HOMEBREW_TAP_FORMULA_REGEX constant in tests
because our code tries to use it when throwing exceptions
also move HOMEBREW_BREW_FILE from doctor_test.rb to test_helper.rb
2014-02-01 12:47:05 -05:00
Roland Walker 3a1c9484a3 Divide search output into sections
typically "Exact Match" and "Partial Matches"
2014-01-31 20:20:30 -05:00
Roland Walker 06395054d6 doubledash hygiene for external cmd: open 2014-01-31 13:05:09 -05:00
Roland Walker 6038fd221d doubledash hygiene for external cmd: ditto 2014-01-31 13:05:09 -05:00
Roland Walker 3cc22374f9 doubledash hygiene for external cmd: sudo, AND
also includes doubledash hygiene for any child commands following each sudo
2014-01-31 12:58:39 -05:00
Roland Walker 28a84baf92 Merge pull request #2545 from rolandwalker/search_followups
search docs/test/fix tapname-search
2014-01-29 09:14:26 -08:00
Roland Walker 216444849e Add copious debugging with --debug
- add new file "cask/utils.rb" analogous to "utils.rb" in Homebrew
- define odebug and odumpcask, analogs of ohai and friends, but
  which only give output when --debug is in effect
- move the debug setting from an instance variable in Cask::CLI
  to a method Cask.debug, defined in "lib/cask/options.rb", which
  was added in #2276. (Perhaps options.rb should be merged back
  into Cask::CLI).
- sprinkle odebug statements liberally throughout the codebase
- update tests
2014-01-28 10:15:43 -05:00
Paul Hinze 36bd6f7554 Merge pull request #2576 from rolandwalker/project_homepage
`brew cask home` with no args opens project page
2014-01-28 06:30:15 -08:00
Paul Hinze ae2d5822e1 Merge pull request #2592 from rolandwalker/arch_caveats
add arch_only to caveats mini-DSL
2014-01-28 06:29:16 -08:00
Roland Walker fabb5cfd9c Merge pull request #2618 from rolandwalker/launchctl_careful_unload
carefully unload launchctl services at uninstall
2014-01-28 03:21:07 -08:00
Roland Walker da67069aa7 rename cocoa-rest-client.rb
to cocoarestclient.rb
per naming rules in CONTRIBUTING.md
2014-01-27 08:42:29 -05:00
Roland Walker 2f2865f6b6 carefully unload lanchctl services at uninstall
Fixes #2601
- do a soft test to see if the service is loaded before attempting remove
- test/unload as both superuser and user as the service can be installed
  differently according to the original packags
- add tests for uninstall :launchctl; there were none previously
2014-01-27 08:26:45 -05:00
Roland Walker 60493a0556 can't init a CONSTANT with ||= in Ruby 1.8.x
test suite could only run under Ruby 1.9 or above
2014-01-25 21:53:23 -05:00
Roland Walker 039b10d681 Merge pull request #2543 from rolandwalker/test_alt_target
tests for #2532 - customizing target symlink
2014-01-25 09:04:08 -08:00
Roland Walker 1ce6a8ba77 tests for #2532
Travis won't like this until/if #2532 is merged.
2014-01-25 10:25:05 -05:00
Roland Walker 768b21eae8 always submit external commands in list form
For safety.
- This is a step toward reworking system_command.rb so that
invocations are done in list form on the back end, avoiding
surprises from quoting and shell metacharacters.
- There is one transitional hack here: the _quote method in
Cask::SystemCommand is modified to avoid double-quoting.  The
_quote method itself will go away in a future revision when
only list-forms are used.
- Casks using system are not touched. It seems natural to
address that when creating the DSL for after_install/before_install.
2014-01-24 20:58:03 -05:00
Paul Hinze ce615d54b9 Merge pull request #2418 from rolandwalker/doctor_version
Numerous additions to "brew cask doctor"
2014-01-24 07:50:22 -08:00
Roland Walker 9d2d6e3575 add arch_only to caveats mini-DSL
Relevant to points raised by @goxberry in #2581
2014-01-24 10:43:00 -05:00
Roland Walker a5ce3cdbd8 search docs/test/fix tapname-search
This is the promised followup to #2496
- docs
- test
- bugfix: search string was being tested against fully-qualified
  Cask name including Tap, so "brew cask search phinze" would
  (confusingly) return all Casks.
2014-01-23 17:50:45 -05:00
Roland Walker e42f0f8dc1 Merge pull request #2546 from rolandwalker/indenting
indent to two spaces
2014-01-23 14:45:16 -08:00
Roland Walker 19f4ce3cfb `brew cask home` with no args opens project page
- in duplication of similar functionality in Homebrew
- in celebration of proposed design by @ndr-qef
2014-01-23 17:17:33 -05:00
Roland Walker 7a0f9ef37f always use full path to external utilities
per #2029
2014-01-23 12:20:32 -05:00
Roland Walker da520b82f0 Numerous additions to "brew cask doctor"
New versions, paths, environment variables, and tests.
Side effect: release version must be stored in two locations.
2014-01-22 15:20:05 -05:00
Roland Walker 9b54342e42 indent to two spaces
This patch contains only whitespace changes, plus a short
addition to CONTRIBUTING.md on the project-wide indent style
2014-01-22 13:08:34 -05:00
Roland Walker 329c48298a caveats first-class in DSL, gets own mini-DSL
Make caveats a first-class member of the Cask DSL.  It no longer has to
be specified with "def caveats", but can be given as "caveats do ... end"
as with after_install blocks.

In addition, create a mini-DSL which can be used within caveats blocks,
providing standard messages when manual installers must be used,
reboot-required, etc.

Add alternate form: caveats can also accept a compile-time string for
simple cases.

This is 99% compatible with old Casks, as it still works by defining
a caveats method.  However, all Casks containing caveats are cleaned
up and adapted according to the new DSL.

Full docs in CONTRIBUTING.md.
2014-01-20 11:54:46 -05:00
Roland Walker 81744a038d bugfix: make uninstall :script accept a hash
The indentation in CONTRIBUTING.md implies that :script accepts a hash.
But that is not the case. Instead :script accesses the entire hash defined
by uninstall.  Unrelated install keys such as :quit leak through to
@command.run! when attempting to exec :script.  Result: contrary to docs,
:script cannot be combined with other uninstall keys.

This PR makes uninstall :script accept a hash.  When :args or :input are not
needed, :script can still accept a plain string, so many Casks require no
alteration.

In addition
- adds key :executable, required when using hash argument to :script
- keys to :script are validated and sanitized before being passed to
  @command.run!
- adds :quit to with-installable.rb test to protect against regression
  on leaky keys
2014-01-11 12:20:59 -05:00
Paul Hinze fead909887 Merge pull request #2263 from rolandwalker/faster_uninstall
uninstall files in chunks of 500.
2014-01-10 11:09:06 -08:00
Paul Hinze 9135ff5730 Merge pull request #2258 from rolandwalker/hardlink_fonts
use hard links for fonts instead of symlinks
2014-01-10 11:06:17 -08:00
Paul Hinze b850d78427 Merge pull request #2240 from linc01n/audit
Check no_checksum if version is latest in audit
2014-01-10 10:59:36 -08:00
Paul Hinze 9bd923fafa Merge pull request #2152 from Dillon-Benson/patch-2
shows that there are no casks matching a search term that did not result...
2014-01-10 10:58:45 -08:00
Stratos Moros 7136269198 implement `binary` artifact 2014-01-05 22:55:18 +02:00
Roland Walker 61a09e9af8 fix test cruft introduced by #2304 2014-01-04 13:16:16 -05:00
Roland Walker 4123b05efa use hard links for fonts instead of symlinks
per an issue reported by @jgarber623.  Recast for compatibility
with #2300.
2014-01-04 12:39:37 -05:00
Roland Walker a4149be6ef refactor artifacts
- abstracts out common logic, much code removed
- fixes one bug/inconsistency: some artifacts failed to
  "return false" when the target exists in "preflight_checks".
- one trivial functional change: artifact type and quotation marks
  added in all user feedback (quotes needed b/c of pathnames
  containing spaces)
2014-01-03 17:08:09 -05:00
Roland Walker cfee08ab9e uninstall files in chunks of 500.
This is intended to address #2122.
2013-12-31 19:47:31 -05:00
Lincoln Lee 70302a4420 Check no_checksum if version is latest
Added one more check in audit if version is latest and have sha1 it will
not pass.
2013-12-30 20:46:11 +08:00
Dillon Benson 12cc9d4006 remove colon and add quotes to search not found message 2013-12-19 12:14:50 -05:00
Dillon Benson fdf43d7873 change search results message 2013-12-19 12:03:42 -05:00
Dillon Benson 10d0feef27 shows that there are no casks matching a search term that did not result in anything 2013-12-19 00:02:38 -05:00
Paul Hinze e46b89c908 Merge pull request #2081 from leoj3n/services-support
[WIP] services support
2013-12-15 15:26:44 -06:00
Paul Hinze 57077feac2 fix build
extra command in uninstall stubs now that we're checking for kernel
extensions before unloaded
2013-12-15 15:11:23 -06:00
Paul Hinze 36b0d166df make method_missing message much more explicit 2013-12-15 14:16:22 -06:00
Paul Hinze f6f507b289 some refactoring around the new download strategy
- move the interface from top-level methods to hash arguments of URL to
   keep the cask DSL as skinny as possible
 - promote the Cask::Headers object up to a Cask::URL object that
   encapsulates all infornation about the URL
 - pull all knowledge about curl arguments into the DownloadStrategy,
   leaving URL to act as a value object to be queried for details
 - test at the DownloadStrategy level; setting up expected curl args
   and example casks
2013-12-15 13:18:47 -06:00
Paul Hinze 24a53c4af7 Merge pull request #1944 from jonahoffline/add_headers_download_strategy
Add DownloadStrategy with custom :headers support
2013-12-14 09:13:58 -06:00
Paul Hinze 0c6e97b8fd use absolute paths for all commands
closes #2029
2013-12-14 08:48:40 -06:00
Paul Hinze d318192854 change cleanup strategy; should speed up tests
the test cleanup was using an old strategy that loaded every cask to
search for ones that are installed. with the number of casks approaching
1000, this was adding ~0.5s __per test__.

switching to the newer strategy that bases off of files in a dir speeds
this up, which improves the build time drastically.
2013-12-14 08:45:54 -06:00
Paul Hinze 4bfc09ec02 Merge pull request #2066 from halo/master
Configurable Caskroom location, see #475
2013-12-14 06:00:31 -08:00
future bb2e3ab187 Improved the name of a test 2013-12-14 09:51:46 +01:00
Joel Kuzmarski 7432affc59 services support 2013-12-13 18:13:19 -06:00
Paul Hinze 8870f7c1fc Merge pull request #2008 from kevinSuttle/colorpickers 2013-12-13 10:40:36 -06:00
Paul Hinze 57da787bb5 fix pkg tests 2013-12-13 09:30:21 -06:00
Kevin Suttle 6dff4a35db Add support for colorpicker type 2013-12-12 22:59:58 -05:00
Jonah Ruiz 06be4b0d8e Add DownloadStrategy and Cask::Headers for custom :headers support
accepts a :user_agent argument and/or multiple :cookies
  headers :user_agent => 'Netscape/1.0', :cookies => { :cookey => "r00t" }

Also adds a standalone :fake_user_agent for a default UserAgent (Chrome)
  fake_user_agent
References #1175, #958
2013-12-12 21:29:12 -04:00
future 738479174c Added test for custom --caskroom argument 2013-12-12 17:48:46 +01:00
Fernando Paredes d9c77c65cb Add support for installing Widgets 2013-12-08 09:28:56 -08:00
Paul Hinze 79aa1b7275 allow casks to support arbitrary blocks
this allows us to experiment with behavior that we may not want to
promote to an official feature just yet.

i'm thinking about stuff like #544, and other things i can't foresee

we'll have to be careful to not let this get out of hand, but i think
it could be helpful for cask authors to be able to try and problem solve
locally.
2013-12-05 21:02:59 -06:00
Paul Hinze f75c47e32f Merge pull request #1948 from phinze/non-ruby-backed-casks
support non-ruby-backed casks
2013-12-05 18:28:31 -08:00
Paul Hinze 5dba177bf1 Merge pull request #1860 from rolandwalker/fonts
add support for installing fonts
2013-12-05 18:27:02 -08:00
phinze 10db2d5d3c support non-ruby-backed casks
- brew cask list now displays casks without backing ruby files
- casks without a source are displayed as "caskname (!)"
- these casks can be uninstalled, with the caveat that it only removes
  their files from the caskroom (doesn't run pkg uninstall or anything,
  since there's no ruby file to define what to do)
2013-12-05 20:10:19 -06:00
Fernando Paredes 302f150670 Merge pull request #1882 from Peeja/quicklook-auto-init-qlplugindir
Create qlplugindir during init.
2013-12-01 09:54:14 -08:00
Pavel Sakun 680dbfd889 Intellij idea casks renamed to include full product name 2013-12-01 03:24:49 +03:00
Peter Jaros fff4bb06ca Test qlplugindir auto-creation. 2013-11-29 12:01:11 -05:00
Roland Walker 5da6e642bf add support for installing fonts 2013-11-26 08:38:43 -05:00
Lucas Garron ee30f839d2 QuickLook plugin support. 2013-11-14 20:26:07 -08:00
Shane Watson 0627d3a909 Use exit codes 2013-11-10 13:30:11 -08:00
phinze 1ba71a3554 remove empty app dirs from caskroom on uninstall
previously an install + uninstall would leave around an empty dir with
the app's name. now we clean that up.

refs #1461
2013-11-10 14:48:16 -06:00
Shane Watson 8ab01bc255 Guard against unspecified casks in CLI 2013-11-10 13:44:10 -06:00
Lincoln Lee 22ee53b1d3 Add caveats to info like homebrew 2013-11-09 18:45:50 +08:00
Paul Hinze d929e6a779 Merge pull request #1504 from phinze/1436-latest-sourceforge-links
new preferred sourceforge url style
2013-11-05 20:25:31 -08:00
Paul Hinze dea18ec540 Merge pull request #1501 from phinze/1083-test-tarballs
add test that exercises tar container
2013-11-05 20:09:59 -08:00
phinze 8feec1de14 new preferred sourceforge url style
- document sf link policy
 - change audit to accept old and new style links
 - need to keep old style links for projects where the 'latest' link
   does not point to something usable
 - link to official policy in audit warning message

refs #1436
2013-11-05 22:09:15 -06:00
phinze 06506c5643 add test that exercises tar container
refs #1083
2013-11-05 21:33:46 -06:00
Paul Hinze abb842bb44 Merge pull request #1499 from phinze/1035-fix-ambiguious-cask-load
use exact matching when loading a cask
2013-11-05 19:22:41 -08:00
phinze 58ac54ed29 use exact matching when loading a cask
fixes issue where casks with names that were a strict prefix of other
casks would always shadow them.

refs #1035
2013-11-05 21:07:52 -06:00
Paul Hinze 8baff93b12 Merge pull request #1462 from phinze/smarter-plist-parser
more robust plist parsing, and better error handling
2013-11-03 12:54:03 -08:00
phinze 27856b09f8 more robust plist parsing, and better error handling
hdiutil can output DMG agreement information before the output plist
xml, and our plist parser was choking on that text before the xml
started.

so now we scan to the beginning of an xml document before trying to
parse the xml.

also added much more explicit error handling around the plist parsing,
to hopefully catch related and future plist-related errors.

refs #914
2013-11-03 13:07:18 -06:00
phinze a1fa264465 brew cask list, when given args, list installed files
this mimics (and indeed steals code from) homebrew's behavior

refs #1417
2013-11-03 12:23:08 -06:00
phinze 7ae7a18932 fixes to pkg uninstaller to prevent madness
- do not remove *all* symlinks from referenced dirs, only broken ones
 - restore dir permission after use so we don't leave behind 777 dirs
 - add some better testing around `Cask::Pkg`
 - clean up `FakeSystemCommand` interface in tests

refs #1274
2013-10-24 14:56:29 -05:00
phinze a9df0c4c45 fix: reinstall attempt nukes existing files
oopsie!
2013-10-23 19:36:06 -05:00
phinze c85ef168fc require most commands to succeed; cleanup on install failure
- add `run!` method which raises if command does not succeed
- use `run!` when the command we are running must succeed for things to
  move forward. this should help produce clearer error messages in
  failure scenarios.
- move caveats earlier in the install process so reports can be made
  about potential failures
- remove the destination tree on cask install failure, so the cask will
  not be considered installed
2013-10-20 16:52:51 -05:00
Kevin Deldycke cc4e796a74 Add new cask for Prey project.
This cask install the batch version of Prey package, as detailed in:
http://support.preyproject.com/kb/installation/how-to-deploy-prey-in-batch-mode-mac-os

As it requires an API key to be installed, a warning is displayed to the
user with an explanation on how to fix the issue.

Also added -E option to sudo invocation so environment variables can be
passed to the installer.

closes #953

Signed-off-by: phinze <paul.t.hinze@gmail.com>
2013-10-20 13:18:54 -05:00
phinze c03ada18ec support for nested containers
- this allows us to support casks for things like "dmg in zip" "zip in
   tar", etc, etc
 - a nested container can be any format that homebrew-cask supports
 - the existing container support is now referred to as a Cask's
   "primary container"
 - use the `nested_container` artifact type to indicate the relative
   path to a nested container that you wanted extracted
 - multiple layers of nesting should work with multiple nested_container
   directives (though this is untested as yet)
 - add SpeedDownload as the first cask to use this feature; refs #602
2013-10-19 16:20:00 -05:00
Adam Stankiewicz 590a7bb572 fix: Allow for underscores in urls
Signed-off-by: phinze <paul.t.hinze@gmail.com>
2013-10-07 20:03:44 -05:00
phinze 18fb8fc028 support custom prefpanedir option 2013-10-07 17:45:58 -05:00
phinze fd3f3e7dde move cli tests to proper dir 2013-10-07 17:43:03 -05:00
phinze c244385eb2 prefpane support; artifact refactor
= New Concept: Cask::Artifact

An Artifact is a file in an extacted container for which homebrew-cask
should take some sort of action on install/uninstall.

== Current artifacts:

 - App: link/unlink to ~/Applications
 - Pkg: install/uninstall (with sudo)
 - Prefpane: link/unlink to ~/Library/PreferencePanes

= New Feature: Preference Pane Handling

Specifying `prefpane 'MyApp.prefPane'` in a Cask causes it to be linked
on install to the correct location for it to show up in System
Preferences.

refs #69

= Removed Commands: linkapps/unlinkapps

These were old and mostly unused and don't really make much sense when
linking/unlinking happens automatically in the install process.

= Changed Behavior: stricter relative pathname requirement

With this refactor, we remove the fuzzy searching for a file in an
extracted container when that file was referenced from `link`
or `install`. There may be some casks that need to be updated due to
this change.
2013-10-07 13:51:42 -05:00
phinze a9cd8e7101 fix a few bugs around recent changes
- 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
2013-09-22 14:44:31 -05:00
Paul Hinze 70ba5c43c0 pkg uninstall: support kernel extension unloading
this should complete support for `wav-tap` and finish out #839
2013-09-22 08:25:16 -05:00
Paul Hinze 357c49162c when uninstalling pkgs; sudo chmod before examining
this helps avoid a situation (which happened with `wav-tap`) where the
non-priveleged ruby code gets permision denied errors while examining the
contents of directories using `Pathname`.
2013-09-22 08:20:18 -05:00
Paul Hinze 21f1cc6544 naked pkg - save files with spaces properly 2013-09-22 08:19:34 -05:00
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
Paul Hinze 5d44948737 remove long-dead submodule directory
refs #348
2013-08-06 14:59:02 -07:00
Shane Delmore f5d1ccb76b Fixed uri in test case 2013-07-30 14:07:11 -07:00
Shane Delmore c28a444bc4 Fixing test file url 2013-07-27 15:08:51 -07:00
Shane Delmore 8ccb22749d Merge branch 'master' into cask-strategy
* master: (75 commits)
  Update Shuttle from version 1.1.1 to 1.1.2
  no version but latest
  OSX port of the awesome gqrx SDR software
  SdrDx – OS X and Windows SDR Software
  Updates version for LibreOffice to 4.1
  Adds cask for Simon.app
  DSP Radio - Software Defined Radio for Mac OS X
  CuteSdr, the QT based SDR project from RF-Space.
  Updated to Zotero 4.0.9
  add maratis 3.21
  updated xld to 20130720
  Rename HexFiend.rb to hexfiend.rb
  Add latest Hex Fiend.
  Add AeroFS cask
  Update link option.
  Add cask for MongoHub (https://github.com/fotonauts/MongoHub-Mac)
  Add cask for Robomongo (http://robomongo.org)
  Add cask for MongoHub (https://github.com/fotonauts/MongoHub-Mac)
  Adding 'Google Earth'.
  Add link to OpenOffice
  ...
2013-07-26 12:15:43 -07:00
Shane Delmore 583559d84e Issue #6. Adding load from url feature. 2013-07-26 11:54:40 -07:00
phinze 171456dc98 support for install/uninstall
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
2013-07-21 22:01:38 -05:00
Michael Ford 6b5c1af440 Correct Adium URL to fix failing unit test 2013-07-21 21:24:27 +08:00
Shane Delmore 489dfa49b2 Adding absolute cask location test 2013-07-17 10:10:03 -07:00
Shane Delmore 429eb80cbe Adding support for local casks outside of the casks directory 2013-07-16 15:12:16 -07:00
Robert Curth ba52f6377e [#583] Auditing of cask download and checksums
closes #688
2013-07-07 09:06:02 -05:00
Keith Smiley 6404f82d09 Verify appdir after reading command line opts
Helps prevent default appdir from being created regardless of whether
the user configured it or not.

Closes #496
2013-06-15 20:13:05 -05:00
James Anderson 11a2af136e Update cask template with shortened link syntax 2013-05-29 06:33:05 -07:00
phinze 71c97bb2e4 support new one-arg link syntax
refs #304

going forward, casks should use

    link 'Foo.app'

rather than

    link :app, 'Foo.app'
2013-05-23 21:03:37 -05:00