Commit graph

1074 commits

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