* Similar to `:sudo`, gives the ability to run an external command
within a given context.
* Exposes `:bsexec` in DSL; not yet documented
* Fixes#7132 (mount dmg image fails if user does not have StartupItemContext(8))
Step 2: Snapshot the Cask file used at install-time, using
the previously-merged metadata directory support.
Using a simple filesystem-is-a-database approach, we set up a
`.metadata` directory for each installed Cask in which we can
record any information, starting with a copy of the Cask
definition which was used at install-time.
This should be useful for various cases such as:
- a fallback when the Cask was renamed/removed. We
currently cannot recover any uninstall info in that
scenario
- installation of multiple versions of the same software
There might be a smarter way to discover the source filename
for the Cask through introspection or some deep Ruby voodoo.
All I could come up with was to pass the filename in on the
constructor, which seems perfectly reasonable if voodoo is
not available. The existing code was taking the title as an
argument to the constructor, which is dispensable.
This PR contains no code to actually make use of the metadata,
but only takes care of the relevant book-keeping: creation,
destruction, as well as organization of metadata according to
software version number and timestamp.
Return the current value whenever the stanza method is called
without arguments, including when the stanza has no value. Do
not attempt to construct an instance with no arguments (which
typically throws an exception).
Incidental comment re: depends_on
Refs #7880
* to match phrasing in our documentation
* to distinguish against the Cask `version` (of which there may
be more than one in the future)
* better fit with symbolic release names eg `:yosemite`
* `MacOS.release` itself is intentionally undocumented pending
the next code release
* accepts a Boolean value
* replaces the never-documented `postflight` methods `enable_accessibility_access` /
`disable_accessibility_access` (`remove_accessibility_access`)
* declarative: unlike the `postflight` approach, does not have to be
invoked in two places
* de-document obsolete form `caveats` / `assistive_devices`
* bump Travis seed to avoid false test failures
When invoking a `SystemCommand` with `:must_succeed => false`, the `SystemCommand::Result` class would mistake a `Process.Status` object for a `Fixnum`.
This commit fixes this by instantiating `Result` with the actual status code as a number.
This fixes an issue where both the `--debug` option and the `brew cask _dump` command would fail on Ruby 1.8.7 when the Cask has an `installer` stanza, e. g. `adobe-air`.
Class names are now completely hidden from the user. This
commit works by adding a prefix to all Cask class names, which
is considered to be an ugly transitional hack on the way to
representing individual Casks as instances.
* 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
* 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
* "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.
* 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
* 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
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
Obsoleted by new form `container :nested`.
This PR only removes DSL support; the job is incomplete.
Internally, `container :nested` is still implemented as a
pseudo-artifact named `nested_container`. The intention
is to factor nested containers out of artifacts.
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.
`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.
* `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
* `checklinks` is a very simple implementation useful only for development purposes
* it has no test coverage, only one line of documentation
* users regularly experiment with it and break it, especially
`brew cask checklinks` with no arguments, which tests all Tapped Casks
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
* 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
Change namespace for clarity, as we already have Cask::Installer,
and are about to add Cask::DSL::Installer.
Move to parent because these methods are not DSL-specific.
Needed to reduce danger from typos in "zap" stanzas.
As noted in the comments, this is somewhat simplistic, and
should later be merged with similar logic in lib/cask/pkg.rb.
* 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
- Show a more user-friendly error message when dealing with an option whose (mandatory) argument is missing.
- Likewise, we show a more user-friendly error message when a given option is ambiguous. Examples:
- Given `-f`, the parser successfully expands to `--fontdir`.
- Given `-c`, we fail to expand because the parser can’t tell if the user means `--caskroom` or rather `--colorpickerdir`. This exception now results in a nicer error message.
- Some commands now result in a consistent error message when a required cask name is missing.
This affects all stable commands which require one or more cask names as arguments, i. e. `cat`, `create`, `edit`, `fetch`, `info`, `install`, `uninstall`, and `zap`.
- Up to now, the commands `cat`, `create`, `edit`, and `info` used to treat any unknown option as a cask name. This commit changes that behaviour to make it consistent to the rest of the commands (like `fetch`, `install`, `uninstall`, and `zap`), who have silently discarded any unknown option in the past, and continue to do so.
Add methods for cryptographic authentication of Cask packages with
the GPG software suite.
Homebrew Cask invokes the system-standard `gpg` binary to import
keys to the GPG keychain, download signatures to versioned metadata
folders, and verify packages. Homebrew Cask aborts if any step fails.
GPG verification is not currently invoked during the audit or
installation processes, and is intentionally left undocumented.
Example usage:
gpg = Cask::GpgCheck.new(cask)
gpg.verify(package_archive_path) if gpg.available
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
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.
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.
* `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`
- Cask::Container::Pkg
- Cask::Container::Ttf
- Cask::Container::Otf
which are autodetected based on filetypes as with other
containers. Cask::Container::Naked remains available
for explicit use in a container_type stanza.
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
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.
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#5475Fixes#4010
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