Commit Graph

442 Commits

Author SHA1 Message Date
Roland Walker 037ece852b followups on `depends_on` `:macos`/`:arch`
* always coerce `:macos` value to array; simplify code
 * remove warning comments about unset values
 * doc explicitly that requirements are covered as well as dependencies
 * doc that `depends_on` is not consulted until `install` time
 * in docs and code, say "release" instead of "version" for the :macos release
   * todo: provide our own variable styled "release" to use in Casks, instead of Homebrew's `MacOS.Version`
 * doc that symbols are preferred for `:macos` over strings in Casks (interally, all are converted to idential `Gem::Version` objects)
 * doc: remove `os_version_only` from `cask_language_deltas.md`
 * doc: improve internal links
 * doc: recast OS X release symbol list as table
 * doc: (incidental) regularize orthography of Formula and Cask
2014-12-05 09:55:47 -05:00
Roland Walker f800db0383 Add `name` stanza for proper name
Documentation is in a separate PR so that authors don't start
using this feature before release.
2014-12-04 20:08:55 -05:00
Roland Walker 7f5e5124f6 DSL: `depends_on :arch` functionality/tests/doc
* fill in functionality for the `depends_on :arch` stub
* de-document `caveats` method `arch_only`
2014-12-04 14:29:27 -05:00
Roland Walker c59a5fcb80 DSL: `depends_on :macos` functionality/tests/doc
* Fill in the functionality for the `depends_on :macos` stub
* de-document `caveats` method `os_version_only`
* clean up some related docs re: version strings
* add `depends_on_test.rb`
* clarify some related `depends_on :formula` doc, tests, and code
* formatting in test Casks
2014-12-02 12:04:27 -05:00
Roland Walker 9050f4d301 Merge pull request #7684 from rolandwalker/accessibility_review
Review and revise accessibility methods in postflight mini-DSL
2014-12-02 05:19:39 -05:00
Roland Walker bff136da57 Merge pull request #7685 from rolandwalker/plist_postflight_review
review/revise plist methods in postflight mini-DSL
2014-12-02 05:19:12 -05:00
Roland Walker 6da1dd13bc Merge pull request #7673 from rolandwalker/name_to_token
unify and recast "Cask name" and "title" as "token"
2014-12-01 11:05:12 -05:00
Roland Walker a335d3b06d unify and recast "Cask name" & "title" as "token"
* "Canonical App Name" becomes "Simplified App Name"
* devscript `cask_namer` renamed to `generate_cask_token`
* doc file `CASK_NAMING_REFERENCE.md` renamed to `cask_token_reference.md`
* DSL uses `"#{token}"` for interpolation instead of `"#{title}"`
* documentation text
* backend code (variables, method, class names)
* error message text
* tests
* code comments
* Cask comments
* emphasize `tags :name`
* doc: use "vendor" consistently instead of "developer"
* doc: many man page argument descriptions were incorrect
* incidental clarifications

Many backend variables similar to `cask_name` or `cask` have
been standardized to `cask_token`, `token`, etc, resolving a long-
standing ambiguity in which variables named `cask` might contain
a Cask instance or a string token.

In many places the docs could be shortened from "Cask name" to
simply "token", which is desirable because we use the term "Cask"
in too many contexts.
2014-12-01 11:00:23 -05:00
Roland Walker 777949dd75 revise plist methods in postflight mini-DSL
* accept index argument to `info_plist` in case of multiple `app`
  artifacts, defaulting to first
* return `Pathname` object from `info_plist`
* use `@command.run` instead of `system_command` which is intended
  as an external interface
* quoting
2014-11-29 13:43:06 -05:00
Roland Walker 2ff2db48b6 revise accessibility methods in postflight miniDSL
* rename `remove_accessibility_access` to `disable_accessibility_access`
  to match corresponding method `enable_accessibility_access`
* move `TCC.db` and `.AccessibilityAPIEnabled` paths to `Cask::Locations`
* remove unneeded backslash from `TCC.db` path
* use full paths to `touch` and `sqlite3` utilities
* use `@command.run` instead of `system_command` which is intended as an
  external interface
* reverse conditional so enable/disable logic is consistent
* `sudo` is needed when creating `.AccessibilityAPIEnabled`
* instead of silent fail, warn that access cannot be safely disabled on
  Mountain Lion and earlier (it could, but might affect other apps)
* quoting/whitespace
2014-11-29 13:21:21 -05:00
Roland Walker 19ee3986c0 Refactor backend classes to match pre/postflight
From legacy forms "after_install", etc.
* abstract out `method_missing_message` to Cask::Utils
* provide `method_missing` coverage in pre/postflight blocks (fixes #7445)
* fix old-style rendering of Cask name as a classname in
  `method_missing` messages
2014-11-26 12:19:17 -05:00
Roland Walker 2448325062 consistency nit 2014-11-24 10:44:08 -05:00
Roland Walker a5528c320f test header line name against filename 2014-11-24 10:43:58 -05:00
Roland Walker 4b3cec76b1 test for valid header line format 2014-11-24 10:43:37 -05:00
ndr 62c1ce5dfc Merge pull request #7530 from rolandwalker/enforce_min_dsl_version
enforce a valid minimum DSL version in headers
2014-11-23 11:14:58 +00:00
Roland Walker e2a0214de6 enforce a valid minimum DSL version in headers 2014-11-22 20:08:25 -05:00
Fabio Niephaus 62cbb3d7a6 get 'syncfolder' from Preferences. resolves #7216 2014-11-22 23:10:04 +01:00
Roland Walker 80dd4caf8a Merge pull request #7450 from rolandwalker/remove_old_header_support
DSL Remove support for old-style header lines
2014-11-20 06:51:10 -05:00
Roland Walker 5de05c72b2 avoid gitx in partial-match search tests
Some gitx Casks are being renamed.  Refs: #7436
2014-11-19 11:31:28 -05:00
Roland Walker e3df6a9923 fix old-style header line in test suite 2014-11-19 10:56:36 -05:00
Roland Walker c15fdadb8f Merge pull request #7429 from rolandwalker/remove_container_type
DSL: remove support for `container_type`
2014-11-18 19:48:12 -05:00
Roland Walker 1f24c7e8f2 Merge pull request #7430 from rolandwalker/new_header_test_casks
remove old-style header line from test Casks
2014-11-18 19:48:05 -05:00
Roland Walker 000e251638 add missing test coverage for `suite` artifact
refs: #7382
2014-11-18 10:01:06 -05:00
Roland Walker 2692b5cd8d remove old-style header line from test Casks
This takes the form of a horrible hack: DSL version numbers may
end with "test", *eg* ":v1test". Such Casks are mapped to class
`TestCask` instead of class `Cask`.

The intention is that all of this logic will be removed when
Casks are migrated away from separate classes.

Tests driven by RSpec are still todo.
2014-11-18 09:09:01 -05:00
Roland Walker e31264de00 DSL: remove support for `container_type`
obsoleted by new form `container :type`
2014-11-18 08:12:05 -05:00
ndr a21dbc85aa Merge pull request #7365 from rolandwalker/add_stage_only
DSL: add stanza `stage_only` (new spelling of `caskroom_only`)
2014-11-18 12:27:54 +00:00
Roland Walker 88b2e92015 DSL: add stanza `stage_only` (new `caskroom_only`)
`caskroom_only` was never documented.  Its original purpose was
obsoleted in #4865, and its use has been recently been reduced to
two Casks.

This PR
* continues the rationalization of naming by changing `caskroom_only`
  to `stage_only`. "stage" is the verb for "make a copy under the
  caskroom directory"
* documents `stage_only`
* adds tests for `stage_only`
* validates the argument to `stage_only`
* gives sensible output in `brew cask info` for `stage_only` Casks
* enforces that `stage_only` cannot coexist with any activatable
  artifacts

`caskroom_only` is still supported for backward compatibility,
but should be removed before 0.50.0.
2014-11-18 07:13:15 -05:00
Roland Walker d2132ac520 DSL: remove support for `depends_on_formula`
obsoleted by `depends_on :formula`
2014-11-17 11:16:08 -05:00
Roland Walker 00747614f7 use new header form in `create` template 2014-11-13 11:45:06 -05:00
Federico Bond da0412bd71 Remove unsupported -x option in launchctl command 2014-11-12 11:28:45 -05:00
Roland Walker 09ecd1eb79 DSL: remove support `install` stanza
now replaced by `pkg`
2014-11-11 11:23:51 -05:00
Federico Bond 75ee4ef812 Add key option to suppress_move_to_applications 2014-11-02 00:26:49 -03:00
Roland Walker b837d6c552 remove support for `link` artifact
* `app`, `suite`, and `artifact no longer implemented as
  synonyms for `link`
* backward-compatible code/comments removed
* creates class `Cask::Artifact::Suite`
* updates `brew cask info` to show specific artifact type
* fixes stray "Generic artifact" messages
2014-10-29 10:53:49 -04:00
Roland Walker 4d46f26447 recast tests to refer to "app" instead of "link"
and "activate" instead of "link" as a verb, in messages,
test names, comments, variable names.

No functional change.
2014-10-29 10:49:58 -04:00
Roland Walker 5a1d637cc5 say "URL" instead of "link" in tests 2014-10-28 12:12:10 -04:00
Roland Walker 839ccb98d4 recast _checklinks verb as _checkurl
remove stray doc item missed in #6966
2014-10-28 12:12:10 -04:00
Roland Walker 66f2b722bb Merge pull request #6823 from ffleming/downgrade-error
Downgrade CaskAlreadyInstalledError to a warning
2014-10-24 11:40:23 -04:00
Roland Walker cd63241558 use "staged" instead of "installed" for Caskroom
refs: #6783
2014-10-21 07:13:04 -04:00
Forrest Fleming f3611f4383 Downgrade CaskAlreadyInstalledError to a warning
Automatic installs - like thoughtbot's laptop script - fail when we
use Homebrew's onoe method.  Using opoo (to warn) will let the
scripts complete successfully when they try to install packages that
have already been installed.

Test for downgrading AlreadyInstalledError to warning
2014-10-19 15:35:09 -07:00
Roland Walker 967aa22793 recast method `destination_path` as `staged_path`
* part of DSL 1.0 review
* `destination_path` was always a bit vague (it refers to
  Cask-specific, version-specific location under
  `/opt/homebrew-cask/Caskroom`)
* here renamed `staged_path` to match upcoming command verb
  `brew cask stage`
* rename also intended to reduce confusion when we implement
  copying as a configurable alternative to symlinking
* transitional `destination_path` methods to remain while
  Casks are converted (this was documented as a part of the
  DSL, and used by 39 Casks in main repo)
* unrelated variables containing "stage" recast for clarity
2014-10-18 12:23:36 -04:00
Roland Walker 42770516f7 dsl: add `installer :manual`
a toplevel artifact, intended to replace `manual_installer`,
which is currently implemented within the `caveats` mini-DSL
2014-10-14 11:34:44 -04:00
Roland Walker 68fdb25129 recast install_script to installer :script
* document installer :script.  install_script was never documented
2014-10-14 11:34:32 -04:00
Roland Walker f3a3404648 use path_environment_variable for caveats test
instead of manual_installer
2014-10-14 11:34:25 -04:00
Roland Walker 41cf7d96f0 docs and tests for new form `container :nested` 2014-10-09 11:34:37 -04:00
Roland Walker 707db75505 standardize Cask (capitalized) when used as noun
* was already done, but inconsistently
* this style follows homebrew Formula
* covers user-facing messages, test titles, comments
* some related minor orthography is included, such
  as the consistent spelling of our project name as
  "homebrew-cask"
* grammar nits
2014-10-08 10:39:51 -04:00
ndr 69c2aa91e8 Merge pull request #6360 from ndr-qef/dsl/validate-gpg-key
DSL: validate value of GPG key ID
2014-10-06 23:10:30 +01:00
Roland Walker 4f671ad177 Merge pull request #6491 from claui/issue-5997
User-friendly error messages for invalid options/arguments; fixes #5997
2014-10-06 11:15:59 -04:00
Claudia 8076322c02 Bring the repo test back in sync with `.gitignore`.
This keeps the tests from failing, e. g. when developers use `rbenv` to run the 1.8-based tests.
2014-10-05 21:24:57 +02:00
Claudia baddaf5fd2 Rewrite tests to make them work with Ruby 1.8 2014-10-05 20:15:12 +02:00
Claudia ec2fdc3f51 Add tests for #5997 2014-10-05 19:52:41 +02:00
ndr 6ca2d9e1ee Test for invalid GPG key IDs 2014-10-05 12:57:34 +02:00
ndr 04697a75fe Update GPG tests to use valid key IDs 2014-10-05 12:54:37 +02:00
Roland Walker e3d009989f reformat test Casks to match layout conventions
in case a contributor uses a test Cask as a template
2014-10-03 17:57:05 -04:00
Roland Walker aedab54e06 Merge pull request #6461 from rolandwalker/test_naming
fix skipped test file + doc
2014-10-03 16:56:41 -04:00
Roland Walker e3f10f82b8 doc and tests for `container :type`
includes some minor tweaks/re-ordering in docs
2014-10-03 10:40:54 -04:00
Roland Walker 0b030cdc0c fix skipped test file + doc 2014-10-03 09:51:43 -04:00
Roland Walker a98af14abe Merge pull request #6433 from jconley/kextunload
fix params for kextunload
2014-10-02 11:03:38 -04:00
Johnathan Conley 203dae5e60 fix params for kextunload 2014-10-01 12:39:38 -05:00
Roland Walker f1604e4efb docs and create template for new license stanza
some :closed licenses in the code are left undocumented for
now, and should not be used.
2014-10-01 11:18:13 -04:00
Roland Walker 1abf0b99a9 Merge pull request #6329 from rolandwalker/system_command_refactor
refactor Cask::SystemCommand
2014-09-27 09:59:59 -04:00
Roland Walker 0e7be245be Return Cask::SystemCommand::Result object
from Cask::SystemCommand.run

* stderr and stdout are now separated, though both are available
* :print_stderr is made the default, closer to previous behavior
* exit status can be read from the result object
* plist parsing is more naturally handled in the result object.
  The :plist argument to the run method was removed.
* whitespace
2014-09-27 08:59:08 -04:00
Roland Walker 6d622ed281 make `install_script` stanza more robust
* correctly (and leniently) parse values
* add test
2014-09-25 11:04:38 -04:00
Roland Walker 49e6e6eb10 refactor :stderr => :silence
replace with :print_stderr => false

The double test on options[:print_stderr] in system_command.rb
is intentional, and temporary.
2014-09-25 09:23:27 -04:00
Roland Walker 568365194d Merge pull request #6227 from rolandwalker/doc_uninstall_delete
doc/tests switchover to `uninstall :delete`
2014-09-18 06:25:59 -04:00
Roland Walker 0b4ad8714b doc/tests switchover to `uninstall :delete`
from `uninstall :files`
2014-09-17 10:41:10 -04:00
Roland Walker f7018e0106 DSL: add `artifact` stanza
Keeping the `link` stanza in the DSL is a mistake: it will be
confusing when combined with the ability to install by copying.

This PR retires `link` completely, and adds a generic artifact
stanza called `artifact`.  (`link` is removed from the docs, but
will still work for compatibility during transition.)

This only affects one current Cask (dwarf-fortress.rb), and that
Cask may be changed to use `suite` in the future.
2014-09-17 09:09:53 -04:00
Roland Walker fe0a053dad Merge pull request #6208 from rolandwalker/uninstall_force
add `--force` option for `brew cask uninstall`
2014-09-16 19:33:17 -04:00
Federico Bond 598a17d0c7 Merge pull request #6206 from rolandwalker/add_version_arg
support `brew cask --version` per `USAGE.md`
2014-09-16 14:58:21 -03:00
Roland Walker d156cbfcb2 add `--force` option for `brew cask uninstall`
also update some related docs for verbs `install` and `uninstall`
2014-09-16 10:59:44 -04:00
Roland Walker ca8417bf0e support `brew cask --version` per `USAGE.md`
closes #6178
2014-09-16 10:04:47 -04:00
Roland Walker 1ddec7128d add uninstall :rmdir
per discussion at https://github.com/caskroom/homebrew-cask/pull/6174#discussion-diff-17516171
refs: #6174

This PR is large because of some test-suite refactoring.
2014-09-16 09:48:32 -04:00
Roland Walker feca527e78 Merge pull request #6193 from rolandwalker/double_dot_is_relative
protect against inner ".." in uninstall paths
2014-09-16 07:08:35 -04:00
Roland Walker 3ea3d0e0e6 protect against inner ".." in uninstall paths 2014-09-15 11:30:41 -04:00
Roland Walker 5ae6e2f773 doc new `app` stanza and update tests to use it
Replacing `link` for almost all cases.

The `link` stanza can still appear in error messages, because
under the hood, `app` is still implemented as a pure synonym
for the `link` artifact.  That will change automatically when
we factor into separate artifacts.
2014-09-13 13:03:46 -04:00
Roland Walker ce64b38723 Merge pull request #6155 from rolandwalker/add_zap_stanza
functionality and docs for zap stanza and verb
2014-09-13 12:55:57 -04:00
Roland Walker 0f664ca78a Fix `brew cask alfred` for Yosemite/Alfred 2.4
Closes #5820
References: #6059
2014-09-13 12:34:12 -04:00
Roland Walker 00921dd513 functionality and docs for zap stanza
* `zap` was previously supported as a noop for forward-compatibility
* Also adds restrictions against relative paths in `uninstall :files`
* Also documents safety conventions for `uninstall :files`
2014-09-13 10:21:17 -04:00
Roland Walker dfcbd7154e docs, error msgs, tests for depends_on :formula
replacing depends_on_formula in DSL
2014-09-11 20:33:39 -04:00
Roland Walker 4595804e28 Merge pull request #6137 from rolandwalker/dsl_pkg_test_suite
DSL convert last of test suite to `pkg` stanza
2014-09-11 20:22:25 -04:00
Roland Walker 0574662679 metadata directory support
- incidentally adds defensive driving against null version
  in method `destination_path`
2014-09-11 11:17:52 -04:00
Roland Walker 4e705cea43 DSL convert last of test suite to `pkg` stanza
instead of `install`
2014-09-11 09:44:45 -04:00
Roland Walker 65cda1257e new DSL form container :nested => <inner> 2014-09-11 09:26:40 -04:00
Roland Walker d6f8aafeda Merge pull request #6115 from rolandwalker/postflight_in_test_suite
update test suite for postflit/preflight DSL forms
2014-09-10 17:34:17 -04:00
Roland Walker 3b7ce85381 bug: fix container :type => <type>
Copypasta error in #6068 means that container :type
never worked, because it looked for nonexistent container.formula
2014-09-10 09:52:26 -04:00
Roland Walker 2f303a651a update test suite for postflit/preflight DSL forms 2014-09-10 08:15:59 -04:00
Roland Walker 07158e455b Revise gpg stanza order and parameters
References: #5971
2014-09-01 10:04:17 -04:00
Federico Bond 1b1a7fde17 Merge pull request #5806 from federicobond/conditional-caveats
Avoid printing Caveats title when output is empty
2014-08-19 10:04:43 -03:00
Federico Bond ab4c5b13e5 Avoid printing Caveats title when output is empty
Closes #4878
2014-08-16 23:09:24 -03:00
Federico Bond ff0a5c10e3 Remove Cask::Decorator 2014-08-15 13:00:52 -03:00
Federico Bond 3cb833c89e Add DSL for after_install and similar blocks 2014-08-11 21:41:06 -03:00
Roland Walker f2b7d8e59f Merge pull request #5636 from federicobond/suggestion-tests
Re-enable suggestion tests
2014-08-04 14:18:21 -04:00
Federico Bond 39bddf20de Re-enable suggestion tests 2014-08-04 09:30:58 -03:00
Roland Walker 99d001afa4 add support for xar containers
references: #5442
2014-08-02 14:51:51 -04:00
Roland Walker a0785a0cfa create a somewhat better fake `pkg` for tests 2014-08-02 11:04:03 -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 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 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 35e7997c35 support pure gzip containers (not tar.gz)
References: #5455
2014-07-26 15:58:49 -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 3932c4d467 Merge pull request #4951 from rolandwalker/add_installer_stanza
DSL: add `install_script` stanza
2014-07-02 18:29:56 -04:00