Commit graph

547 commits

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