Commit Graph

717 Commits

Author SHA1 Message Date
Roland Walker 954de1332f Merge pull request #5598 from rolandwalker/allow_multiword_container_types
bug: `container_type :seven_zip` was ignored
2014-07-31 16:18:26 -04:00
Roland Walker f5063a2e8a Merge pull request #5599 from rolandwalker/generic_unar_container
refactor GenericUnar container class
2014-07-31 16:18:16 -04:00
Roland Walker c301b27043 force permissions and delete ACLs if rmtree fails
This logic is ugly as the installation directory will be left
in a mangled state if it fails partway through.  However, the
same is true when `rmtree` fails partway through, which this
code is intended to minimize.

References: #5504
2014-07-31 14:43:05 -04:00
Roland Walker cd18107db3 Merge pull request #5591 from rolandwalker/move_digest_require
move require 'digest' to where it is actually used
2014-07-31 14:35:45 -04:00
Roland Walker 04ea21e03c refactor GenericUnar container class
This is just a matter of semantics: renaming the abstract base
class `Cask::Container::UnarBase` so that it makes sense when
referring to it in a `container_type` stanza.
2014-07-31 11:18:50 -04:00
Roland Walker 9a20a564a4 bug: `container_type :seven_zip` was ignored
because interior capitalization was not done
2014-07-31 11:09:39 -04:00
Roland Walker 0c609fbfe6 cut v0.38.1 2014-07-31 09:24:45 -04:00
Roland Walker 14011ba507 move require 'digest' to where it is actually used 2014-07-31 09:17:47 -04:00
Roland Walker eaa1eef6b1 Merge pull request #5590 from rolandwalker/depends_on_via_cli
fix Formula dependencies by invoking Homebrew CLI
2014-07-31 09:17:39 -04:00
Roland Walker 42eea1f0bf fix Formula dependencies by invoking Homebrew CLI
According to the logic of #5080, we should move away from calling
Homebrew internals, in part because things break over time, as
happened here with the implementation of `depends_on_formula`
(shortly to become `depends_on :formula`).

This re-implements formula dependencies by invoking the Homebrew
CLI, which is the only stable API Homebrew guarantees.

Fixes #5475
Fixes #4010
2014-07-31 09:09:16 -04:00
Roland Walker 71c57b3569 bug: use install_phase in caskroom_only / qlplugin
Missed in #4865.  install method was renamed.
Bug exercised by Cask amazon_music.rb.
2014-07-30 13:11:57 -04:00
Roland Walker 465caffa0d Merge pull request #5569 from rolandwalker/dsl_conflicts_with
DSL: add `conflicts_with` stanza
2014-07-30 10:05:55 -04:00
Roland Walker 122cf34995 Merge pull request #5555 from rolandwalker/delete_bom_specials
Delete special files (eg symlinks) from pkg BOMs
2014-07-29 18:26:09 -04:00
Roland Walker 44f1a37546 DSL: add `conflicts_with` stanza
Forgotten in #4688, but should be considered part of Cask DSL 1.0.
A `depends_on` stanza is much less useful without the corresponding
`conflicts_with`.

References: #4896
2014-07-29 18:24:34 -04:00
Roland Walker 469bce88cc Merge pull request #5548 from rolandwalker/notify_pkg_install
Give users hint that pkg installs work differently
2014-07-29 09:15:48 -04:00
Roland Walker e795a56850 Delete special files (eg symlinks) from pkg BOMs
`pkgutil --only-files` plus `pkgutil --only-dirs` does not
cover all files in the BOM.

Closes #5491
2014-07-29 07:55:07 -04:00
Roland Walker cc95c18f07 Give users hint that pkg installs work differently
Users should not have to open the Cask file to figure out why one
cask installs differently than another.

Closes #5402.
2014-07-28 22:27:41 -04:00
Roland Walker 6c2b6686b1 add another special case for odd SourceForge URL
References: #5488
2014-07-28 18:02:55 -04:00
Roland Walker 30296d5ded cut v0.38.0 2014-07-28 15:13:12 -04:00
Roland Walker 573af3c8b7 Merge pull request #5540 from rolandwalker/amend_tags
Amend valid values for tags stanza
2014-07-28 14:46:29 -04:00
Roland Walker 3d9ea33ca0 Merge pull request #5365 from rolandwalker/remove_caskname_limitations
forward-compatibility to remove naming limitations on Casks
2014-07-28 14:18:19 -04:00
Roland Walker 583890a96e Merge pull request #5520 from rolandwalker/system_command_exit_status
Open.popen3 does not set `$?`
2014-07-28 14:16:23 -04:00
Roland Walker dcefd7ec09 Amend valid values for tags stanza
- remove font tags (per earlier discussion - they were left
  in by mistake)
- add tag `:name` for corner cases where the Cask name cannot
  adequately follow the product name.  Examples: non-English
  apps, App bundles which do not match publicized names.
2014-07-28 14:13:28 -04:00
Roland Walker f1cad8c7a2 Merge pull request #5517 from rolandwalker/pure_gzip_container
support pure gzip containers (not tar.gz)
2014-07-28 14:05:08 -04:00
Roland Walker 4713c79c89 Open.popen3 does not set $?, unless Ruby 1.8
This is possibly the cause of other glitches such as random
failures on Travis.

Ruby 1.8 popen3 does set global $? for the exit status, Ruby
1.9 and above does not.  For Ruby 2.0 users (Mavericks and
above with recent Homebrew), success or failure of the current
external command was determined by the exit status of some
previous command.

Closes caskroom/homebrew-fonts#186
2014-07-28 14:03:06 -04:00
Roland Walker 3e2eafb636 forward-compatibility to remove naming limitations
Currently, Casks names are constrained by the need to form
valid Ruby class names.  This change enables a new syntax,
in which the first line of a Cask will read like
```ruby
cask :v1 => 'my-app' do
```
where :v1 refers to the version of the DSL spec.
2014-07-28 13:36:44 -04:00
Roland Walker baba437ca1 Zip container does not need to `require 'tmpdir'` 2014-07-26 16:30:15 -04:00
Roland Walker 35e7997c35 support pure gzip containers (not tar.gz)
References: #5455
2014-07-26 15:58:49 -04:00
Roland Walker d9d3011c81 ignore non-XML hdiutil output preceding plists
unless `--debug` is in effect.  This reverts to previous
behavior WRT DMG licenses.  Trailing non-XML garbage will
still be emitted.
2014-07-14 14:15:51 -04:00
Roland Walker ecb66ac567 DSL: add `tags` stanza
only limited/defined keys are permitted
 - :vendor
 - :font_pitch
 - :font_serif
 - :font_weight
 - :font_slant

forward-compatibility: no associated functionality is
provided.  Intentionally left undocumented.

References: #4688
2014-07-02 18:54:13 -04:00
Roland Walker ea27fb8fc2 Merge pull request #4928 from rolandwalker/unininstall_trash_delete
DSL: add uninstall `:delete` and `:trash`
2014-07-02 18:31:04 -04:00
Roland Walker a8eb05867e add `install_script` artifact
name matches `uninstall :script`

References: #4688
2014-07-02 18:06:24 -04:00
Roland Walker 3807b888f7 read_script_arguments accepts defaults/overrides
as parameters.  Accept overridden keys when submitted by the
caller, but warn that they are ignored.
2014-06-28 15:30:48 -04:00
Roland Walker bb119655de harmonize error messages 2014-06-28 15:24:55 -04:00
Roland Walker bfc962595d generalize read_script_arguments
so that it can be called from multiple stanzas
2014-06-28 15:24:55 -04:00
Roland Walker ba797f043e move read_script_argument to Cask::Artifact::Base 2014-06-28 15:24:55 -04:00
Roland Walker 4c6e5e2b57 DSL add uninstall `:delete` and `:trash`
- `:delete` is intended to replace `:files`
- `:trash` is intended to move files to the OS X Trash
- `:trash` is only a stub — currently all three function identically

References: #4688
2014-06-28 14:51:38 -04:00
Roland Walker 743c0cf8f2 Merge pull request #4845 from rolandwalker/dsl_aliases
DSL: forward-compatible synonyms (WIP)
2014-06-28 14:37:42 -04:00
Roland Walker 2c06def3ba Merge pull request #4873 from rolandwalker/add_license_stanza
DSL: add `license` stanza
2014-06-28 10:32:22 -04:00
Roland Walker caeeaf2078 Merge pull request #4869 from rolandwalker/add_zap_stanza
DSL: add `zap` stanza
2014-06-28 10:30:25 -04:00
Roland Walker 99ba340a4d Merge pull request #4896 from rolandwalker/add_depends_on_stanza
DSL: add `depends_on` stanza
2014-06-28 10:19:18 -04:00
Roland Walker b2390ac3d8 Merge pull request #4848 from rolandwalker/add_gpg_stanza
DSL: add `gpg` stanza
2014-06-28 10:18:36 -04:00
Roland Walker 64313c7399 add `zap` stanza to DSL
The zap functionality here is in working form, but there is not a
corresponding `brew cask zap` command verb, which is to be supplied
in a separate PR.

Like other forward-compatible DSL extensions, it is intentionally
undocumented.

References: #4688
2014-06-28 10:16:54 -04:00
Roland Walker 0d01d35822 Merge pull request #4849 from rolandwalker/version_symbol_latest
DSL: allow `version :latest` (symbol not string)
2014-06-28 10:13:56 -04:00
Roland Walker cc7db15b5b Merge pull request #4847 from rolandwalker/extend_appcast_stanza
DSL: extend `appcast` stanza
2014-06-28 10:11:49 -04:00
Roland Walker 000487ba31 Merge pull request #4866 from rolandwalker/demote_caskroom_only
DSL: remove special properties of `caskroom_only` stanza
2014-06-28 10:11:37 -04:00
Roland Walker 52152016c2 Merge pull request #4865 from rolandwalker/allow_all_uninstall
DSL: allow all Casks to use `uninstall` stanzas
2014-06-28 10:09:19 -04:00
Roland Walker d2e302afbb Add `license` stanza to DSL
References: #4688.

For forward-compatibility; intentionally left undocumented.

The `license` stanza is not free-form.  There is a limited
set of valid symbols, of which the argument must be a member.
(The set will later be documented, and probably needs amendments.)

Version numbers and variants of licenses are intentionally
ommitted.  The use-case for `license` is filtering and listing
of Casks. We want to avoid becoming a detailed repository of
application descriptions: that information can be found at the
`homepage` URL.
2014-06-26 09:13:56 -04:00
Roland Walker 8db73ff333 cut v0.37.1 2014-06-25 20:48:31 -04:00
Roland Walker deb79403e5 Improve plist handling for `hdiutil` commands
- Raise `CaskError` instead of `Plist::ParseError` from module
- Improve error message when parse result is empty
- remove leading garbage text and emit it to stderr (seen in #5060)
- remove trailing garbage text and emit it to stderr (seen in #4819)

This has the incidental effect of emitting DMG licenses during
installation, which seems desirable as permanent functionality.

If not permanent, the warnings to STDERR should still be kept
temporarily to help get better bug reports on `hdiutil`.

A bug wrt DMG licenses must have been introduced in one of
#4892, #4887, #4889, #4900, #4975, #4978, or #4857.  Presumably,
the cause is that STDERR was previously silenced when running
`hdiutil`.  It would be cleaner (and more reliable) to redirect
STDERR and examine it separately, rather than clean up the
merged outputs.

closes #4819
closes #5060
2014-06-25 10:30:49 -04:00
Roland Walker b758a151da Merge pull request #5025 from rolandwalker/add_internal_stanza
add internal command `_stanza`
2014-06-23 06:44:07 -04:00
Roland Walker dffed9999a add internal command `_stanza`
to extract the compiled/interpolated values for a given stanza.
2014-06-21 16:23:53 -04:00
Roland Walker 29a6a1ec10 Extend subcommand dispatch to include full paths
Covering all cases
- external commands as executables
- external commands as Ruby libraries
- built-in command verbs

This is intended as a development aid.

A side benefit is that an external command can be constructed
to use a `run` method, rather than having to accomplish everything
at `require` time.
2014-06-21 14:51:57 -04:00
Roland Walker ddb9322882 Merge pull request #5011 from rolandwalker/internal_command_dump
create "internal use" command verbs: _dump, _help
2014-06-21 10:46:14 -04:00
Roland Walker 785da0ca93 whitespace 2014-06-21 09:37:39 -04:00
Roland Walker 584f77b637 add blank line to NullCommand message 2014-06-21 09:37:39 -04:00
Roland Walker b395df5428 refactor variable name max_command_len 2014-06-21 09:37:39 -04:00
Roland Walker a0e061b2d6 add `_help` internal command 2014-06-21 09:37:39 -04:00
Roland Walker 204bbe8927 add `_dump` internal-use verb 2014-06-21 09:37:39 -04:00
Roland Walker 8163745d4a create "internal use" command verbs
- based on abstract class `Cask::CLI::InternalUseBase`
- interal-use class file names follow `internal_<verb>.rb`, but the "internal" is dropped for the CLI
- internal-use verbs start with underscore at CLI
- internal-use verbs are invisible in the usage document
2014-06-21 09:37:39 -04:00
Roland Walker 604aaad3de simplify `lookup_command`
by `zip`ping `commands` with `command_classes`
2014-06-21 09:37:39 -04:00
Roland Walker 5c6a87639b recast `commands` method using `command_classes`
no longer a need for hardcoding constants to remove (such as
`:ISSUES_URL`), because `command_classes` checks for a `run`
method.
2014-06-21 09:37:38 -04:00
Roland Walker eb99afce83 recast help/usage with `command_classes`
invoking new `command_name` method from the base class when the
command verb string is needed
2014-06-21 09:37:38 -04:00
Roland Walker 5206d2bc2a add `command_classes` method 2014-06-21 09:37:38 -04:00
Vladimír Kriška 71f3a0d968 Show file contents instead of commits 2014-06-21 01:19:07 +02:00
Roland Walker 7956854e41 use `fetch` on ALIASES with default 2014-06-20 15:06:29 -04:00
Roland Walker 5005ad67f9 hoist ALIASES to top of class
with addtl formatting/comments
2014-06-20 15:06:29 -04:00
Roland Walker b7573b3838 create abstract Cask::CLI::Base
from which all commands inherit.  Add `visible` method
for future use.
2014-06-20 15:06:29 -04:00
Roland Walker de1858d905 conform all command verbs to a Class (not Module) 2014-06-20 15:06:29 -04:00
Roland Walker 1add47a55b Merge pull request #4994 from rolandwalker/sourceforge_url_format_updates
Sourceforge URL format updates
2014-06-20 06:01:09 -04:00
Fernando Paredes d1b4652053 Merge pull request #4998 from rolandwalker/doc_cache_symlinks
doc: tracker symlinks are in download cache
2014-06-19 21:19:13 -07:00
Roland Walker d4146fd77e Merge pull request #4991 from rolandwalker/silence_stderr_interface
Remove comment recommending :silence_stderr
2014-06-19 20:10:28 -04:00
Roland Walker bd6ebf85a4 doc: tracker symlinks are in download cache
At least mention tracker symlinks in the docs, since they
are displayed in the feedback messages.

References: #4995
2014-06-19 17:46:17 -04:00
Roland Walker b5a3c827d4 special-case brushviewql sourceforge URL
No alternative for this binary was found matching the standard URL patterns.

References: #4751
2014-06-19 16:13:04 -04:00
Roland Walker 0f50085ed3 escape metacharacters in sourceforce URL patterns 2014-06-19 16:08:54 -04:00
Roland Walker d811b3b32e Add `depends_on` stanza to DSL.
For forward-compatibility, intentionally undocumented.  Currently
works only as a synonym: `depends_on :formula` substitutes for
`depends_on_formula`, which is intended to be removed.

However, this PR also provides additional `depends_on` keys for
future expansion of functionality:
 - `:cask`
 - `:macos`
 - `:arch`
 - `:x11`
 - `:java`

The symbol names were chosen to match those used in Homebrew Formulae.

References: #4688, #2001
2014-06-19 15:58:21 -04:00
Roland Walker e61f297f9d cut v0.37.0 2014-06-19 15:38:38 -04:00
Roland Walker 99e6e02ab4 Remove comment recommending :silence_stderr
As parameter to the `run` method, but also exposed as interface to Cask authors
in eg `uninstall` `:script`.  The existing DSL design: `:stderr => :silence`
is more flexible/extensible.

References: #4688
2014-06-19 15:06:53 -04:00
Roland Walker bfc07561e5 detect cached downloads in doctor
and recommend "brew cask cleanup" if present.

Closes #4857
2014-06-19 14:51:32 -04:00
Roland Walker f65d422b82 refactor `brew cask cleanup`
Divide into more tractable methods. No functional change.

Change apparent typo in test regular expression
2014-06-19 14:25:56 -04:00
Roland Walker aa2bd83643 Extend `appcast` stanza to support multiple keys
- `:sha256`
- `:format` (default is `:sparkle`)
- `:latest_version` (experimental, may be removed)
2014-06-19 12:06:43 -04:00
Roland Walker 06c9bae613 don't check error code of `diskutil eject`
nstead, determine success by directly testing the intended effect:
does the mount path still exist?

Also:
 - retry once on failure.
 - silent success if the given mount point did not exist.

These changes are intended to help with unpredictable problems with
the test suite that manifest frequently on Travis.

References: #4975, #4900, #4857
2014-06-19 11:57:01 -04:00
Roland Walker ed5ea5ed4c recast install/uninstall methods: `install_phase`
and `uninstall_phase`, to improve clarity, now that we have an
independent `uninstall` artifact.
2014-06-18 20:22:24 -04:00
Roland Walker 3bd2e2a3f5 promote `:uninstall` to an independent artifact
- separated from class `Cask::Artifact::Pkg` (the `:uninstall` DSL key)
- `:uninstall` can now be invoked for all Casks
- `uninstall_test.rb` also had to be separated from `pkg_test.rb`
2014-06-18 20:22:24 -04:00
Roland Walker 077eecb731 recast uninstall_options as directives 2014-06-18 20:03:28 -04:00
Roland Walker 1e8bbd3c74 recast uninstall_set as directives_set 2014-06-18 20:03:28 -04:00
Roland Walker 57957e73d3 change hardcoded "uninstall" in msgs to stanza var 2014-06-18 20:03:27 -04:00
Roland Walker d534b0ea6f pass stanza by name to dispatch, instead of set
the set contains the uninstall directives from the DSL,
possibly more than one artifact
2014-06-18 20:01:35 -04:00
Roland Walker e3e6dca708 recast manually_uninstall method
as dispatch_uninstall_directives
2014-06-18 20:01:35 -04:00
Roland Walker 33f8cc431a add `gpg` stanza to DSL
For forward compatibility.  The stanza has no effect, and is
intentionally left undocumented at this time.

References: #4688
2014-06-18 19:59:54 -04:00
Roland Walker 05a121e483 Merge pull request #4975 from rolandwalker/diskutil_eject
switch to `diskutil` for eject
2014-06-18 19:20:07 -04:00
Roland Walker a0a5ba44df Merge pull request #4965 from rolandwalker/doctor_load_path_annotation
Annotatate unexpected $LOAD_PATH in doctor
2014-06-18 17:45:09 -04:00
Roland Walker 1e9c5de1dc Annotatate unexpected $LOAD_PATH in doctor
Warning if first element is not Homebrew-cask's own lib dir
2014-06-18 17:26:40 -04:00
Roland Walker e0dc8b4497 Merge pull request #4970 from rolandwalker/no_backtick_in_error_messages
don't use Markdown-style backtick in error msgs
2014-06-18 16:35:34 -04:00
Roland Walker 5b35f21345 Merge pull request #4969 from rolandwalker/doc_standard_upgrade_command
standardize the recommended upgrade command
2014-06-18 16:34:51 -04:00
Roland Walker 79e17ae450 Merge pull request #4963 from rolandwalker/doctor_brew_cleanup_needed
detect need for "brew cleanup" in doctor
2014-06-18 16:29:02 -04:00
Roland Walker 87b670e5cd switch to `diskutil` for eject
Mostly to see if this reduces random Travis errors, but also
because `diskutil eject` is a documented interface, and
`hdiutil eject` is not.
2014-06-18 16:04:17 -04:00
Roland Walker 0954ca4c8f don't use Markdown-style backtick in error msgs
Because backtick has a different meaning in the shell, and the user
may copy-and-paste such text.

Some light re-wording included as well, and a reference to "brew cask edit"
changed to "brew cask cat" for simplicity.
2014-06-18 15:16:26 -04:00
Roland Walker 2ffee346df standardize the recommended upgrade command
in both docs and error messages.

Recent bug reports indicate that `cleanup` commands are essential
in some situations.
2014-06-18 15:15:50 -04:00
Roland Walker b37e34e2c3 detect need for "brew cleanup" in doctor
User will receive a warning if more than one copy of Homebrew-cask
is installed.

References: #4857
2014-06-18 11:31:12 -04:00
Roland Walker 4c8e530570 move utility methods inside module namespace
Cask::Utils
2014-06-18 11:21:18 -04:00
Roland Walker 6fcf62e6aa Merge pull request #4924 from rolandwalker/suggested_stanza_order
suggested (not enforced) order for Cask stanzas
2014-06-17 05:57:29 -04:00
Roland Walker 3cb729095d suggested (not enforced) order for Cask stanzas
References: #4914
2014-06-16 13:32:08 -04:00
Roland Walker 2bfa4e554a add `version` helper method to `caveats` mini-DSL
As was already done (for convenience) for `title`.

References: #4921 .
2014-06-16 12:56:31 -04:00
Roland Walker df3b0566b0 Merge pull request #4900 from rolandwalker/allow_hdiutil_exit_code
permit `hdiutil` to exit with error code
2014-06-16 07:42:00 -04:00
Roland Walker 0b3134bc1c Merge pull request #4890 from rolandwalker/caskerror_exception_status
show process exit status in CaskError exception text
2014-06-14 20:33:28 -04:00
Roland Walker bca0abb6bc process exit status in CaskError exception text 2014-06-14 20:19:59 -04:00
Roland Walker 30c8412812 permit hdiutil to exit with error code
Mysterious `hdiutil` errors are a longtime problem with the
test suite, and the largest cause of false Travis failure
reports.

What appears to happen is that `hdiutil` returns a valid
plist output, but also exits with an error code.

Recently, user errors have been reported which seem to be
related to the same problem (#4857).

After #4892 and #4887, we have have more assurances that mount errors
will be caught elsewhere, if the XML is incorrect/missing, or if the
mounts are not returned.

So, for this special case, it should be safe to simply
ignore the error code from `hdiutil`.
2014-06-14 20:19:12 -04:00
Roland Walker 4052928deb DSL: allow `version :latest` (symbol not string)
Forward-compatibility. Intentionally not documented.  When
version is a symbol, it may only be `:latest`.

References: #4688
2014-06-14 20:05:30 -04:00
Roland Walker d61f165806 fix typo in comments 2014-06-14 20:03:13 -04:00
Roland Walker 630b1e3f89 add more detail to plist parse error messages 2014-06-14 20:03:13 -04:00
Roland Walker c78c10855c Merge pull request #4887 from rolandwalker/better_dmg_errors
ensure more informative errors from `dmg.rb`
2014-06-14 18:15:46 -04:00
Roland Walker ecd038ec6f Merge pull request #4888 from rolandwalker/caskerror_exception_format
don't undent CaskError exception text
2014-06-14 18:15:36 -04:00
Roland Walker 94864be826 Merge pull request #4892 from rolandwalker/sanity_check_plist_parsing
defensive driving against errors running `hdiutil`
2014-06-14 18:14:11 -04:00
Roland Walker 9593e614b5 defensive driving against errors running `hdiutil`
This may not be strictly necessary.  But it should help track
down the `hdiutil` errors, which are persistent, but occasional,
and hard to reproduce. (We pass a flag to `hdiutil` to make
respond in XML.)
2014-06-14 10:55:04 -04:00
Roland Walker 5e5af23815 don't undent CaskError exception text
The content of `output` is probably not indented, and will be
left-truncated if it is multi-line.  This happens often with
Travis `hdiutil` errors
2014-06-14 09:26:24 -04:00
Roland Walker 01000b0bbf Merge pull request #4868 from radeksimko/x11-caveat
Add X11 support to the `caveats` mini-DSL
2014-06-14 09:07:30 -04:00
Roland Walker b9b41030b7 ensure more informative errors from `dmg.rb`
The logic for better errors was already there; this just makes
sure that another exceptional case is handled, and falls through
to the existing error-check.

References: #4857
2014-06-14 08:50:02 -04:00
Roland Walker 3f4f6580e0 cut v0.36.2 2014-06-14 08:19:00 -04:00
Radek Simko 2fe0f616d3 X11 added to caveats DSL 2014-06-14 11:28:03 +01:00
Roland Walker bd474f3302 remove special properties of `caskroom_only`
HOLD until #4865 is merged.

After #4865, `caskroom_only` can be subclassed from Cask::Artifact::Base
like any other artifact.  It no longer has the special property of
making `uninstall` stanzas work.

This stanza has never been documented.  It is possible that it will
no longer be needed, after #4865 and subsequent cleanup on Casks that
use this form.

References: #4688
2014-06-13 13:26:58 -04:00
Roland Walker 8ab9bae38d WIP forward-compatible DSL synonyms
This makes the following stanzas available in the DSL as
synonyms to existing stanza, with no change to existing
functionality:
- pkg for `install`
- app for `link`
- suite for `link`
- preflight for `before_install`
- postflight for `before_uninstall`
- uninstall_preflight for `before_uninstall`
- uninstall_postflight for `after_uninstall`

References #4688

This works, but is marked WIP because we are not in a hurry,
and because I intend to add tests.
2014-06-12 11:27:42 -04:00
Roland Walker 744ab4aa39 add some detail when rescuing download errors 2014-06-11 16:28:46 -04:00
Roland Walker 4652e8bbcb cut v0.36.1 2014-06-11 12:47:13 -04:00
Roland Walker b29a77382b Merge pull request #4812 from rolandwalker/fail_on_nonexistent_pkg
Installation should fail if pkg file nonexistent
2014-06-11 06:54:59 -04:00
Roland Walker a8a3fe733a Merge pull request #4787 from rolandwalker/already_installed_is_not_error
Downgrade Cask install errors to warnings
2014-06-10 18:21:58 -04:00
Roland Walker caf6c14ff9 Merge pull request #4804 from rolandwalker/uninstall_coerce_ruby_2.0
fix uninstall for ruby 2.0, multiple uninstall stanza, more
2014-06-10 18:21:04 -04:00
Roland Walker acded0c6ef Installation should fail if pkg file nonexistent 2014-06-10 18:02:03 -04:00
Tony d273bb3020 Minor formatting tweaks to CLI help output 2014-06-10 12:33:21 -04:00
Roland Walker 65a4cc6f3a allow multiple `uninstall` stanzas to work
fixes longstanding bug; aligns code with docs
2014-06-10 12:16:49 -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 9fdae4583a improve `:signal` debug message 2014-06-10 09:12:00 -04:00
Roland Walker f534bbd75a `uninstall` `:files` in chunks
micro-optimization; minimize shell invocations
2014-06-10 09:11:46 -04:00
Roland Walker 974877ae7a More robust `:signal` directive in DSL
Coerce more variations into pairs.
2014-06-10 09:08:34 -04:00
Roland Walker b65cbbf0fd Coerce `:files` to Array in `uninstall`
before invoking `each` method.  This is necessitated by Homebrew's
switch to Ruby 2.0.

Also standardize how all `uninstall` directives are coerced to Array,
in a way that is compatible between Ruby 1.8 and 2.0.

Fixes #4784.
2014-06-10 09:06:50 -04:00
Roland Walker 4bf7d5bdc6 cut v0.36.0 2014-06-07 18:02:33 -04:00
Roland Walker d7dead6705 Merge pull request #4732 from rolandwalker/force_utf8_encoding
force UTF-8 encodings
2014-06-07 17:19:31 -04:00
Roland Walker 4d199ada2d force UTF-8 encodings
Fixes #4677.  This change is necessitated by Homebrew's recent
switch to Ruby 2.x.  These changes may be incomplete and/or
may not work well with Ruby 1.8.  Travis should test Ruby 1.8
compatibility.
2014-06-07 17:04:42 -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
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
Roland Walker bd30615a88 `collect_concat` is not available in Ruby 1.8
`collect` is fine here. References #4719.
plus bugfix: join into a string so that `render_with_none`
knows to substitute "<NONE>"
2014-06-06 21:48:37 -04:00
Roland Walker 8da1d588bb Merge pull request #4733 from rolandwalker/helpdoc_cleanup
remove issues_url and nullcommand from help output
2014-06-06 20:58:07 -04:00
Roland Walker 3a48343a03 Merge pull request #4719 from rolandwalker/doctor_refactor
refactor `brew cask doctor`
2014-06-06 20:42:45 -04:00
Roland Walker 324d79f0bb Merge pull request #4673 from rolandwalker/cask_load_exceptions
Improve error checking and messages on Cask load
2014-06-06 20:42:35 -04:00
Roland Walker 13f8a4d282 remove issues_url and nullcommand from help output
necessitated by Homebrew's switch to Ruby 2.x
Fixes #4728
Fixes #4726
2014-06-06 17:10:28 -04:00
Roland Walker abe4428cb6 add $SHELL to doctor 2014-06-06 14:15:48 -04:00
Roland Walker 40215968ef add $CHRUBY_VERSION to doctor 2014-06-06 14:15:34 -04: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 50841d3f86 whitespace 2014-06-06 11:34:45 -04:00