Commit Graph

556 Commits

Author SHA1 Message Date
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 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 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 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