Commit Graph

104 Commits

Author SHA1 Message Date
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 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 37136710d2 Recast Cask::DSL::Installed as Cask::Staged
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.
2014-10-14 11:34:02 -04:00
Roland Walker 1f18a74056 comment/todo re: directory creation 2014-10-04 08:23:28 -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 0ad22a8990 Add doubledash to mkdir command 2014-09-10 08:17:35 -04:00
Roland Walker 9711ff8672 re-org more files under lib/cask/dsl 2014-08-27 07:50:38 -04:00
Roland Walker 45a1b734d7 move tags.rb to dsl/tags.rb 2014-08-23 12:30:59 -04: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 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 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 2c06def3ba Merge pull request #4873 from rolandwalker/add_license_stanza
DSL: add `license` stanza
2014-06-28 10:32:22 -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 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 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 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 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 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 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 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 4c8e530570 move utility methods inside module namespace
Cask::Utils
2014-06-18 11:21:18 -04:00
Roland Walker 4052928deb DSL: allow `version :latest` (symbol not string)
Forward-compatibility. Intentionally not documented.  When
version is a symbol, it may only be `:latest`.

References: #4688
2014-06-14 20:05:30 -04:00
Roland Walker 598f53ba48 memoize all_tapped_cask_dirs 2014-05-15 16:49:43 -04:00
Roland Walker dd5d767b18 Merge pull request #4244 from rolandwalker/toplevel_dir_permissions
special case permissions when creating `/opt`
2014-05-07 22:36:42 -04:00
Roland Walker 1fe644f84f special case permissions when creating `/opt`
or any other toplevel directory. Closes #4187
2014-05-07 10:56:04 -04:00
Roland Walker 0153c19f7a Defend against unusual Homebrew setups
To aid in Tap transition.  Require Homebrew 0.9.5, rescue
`rename_tags_dir_if_necessary` (`respond_to?` won't work there
because `rename_tags_dir_if_necessary` is a private method.

References: #4192, @Jackiebo in #4096
2014-05-07 09:50:42 -04:00
Roland Walker fb1300366e automatically transition to new Tap name/location
At every command execution
- invoke `rename_taps_dir_if_necessary` to help with Homebrew's Tap migration.
  (Homebrew's migration seems to sometimes fail to fire, see #4096)
- untap `phinze/cask`, and tap `caskroom/cask`, to help with our own move
  to a GitHub organization
After a few months, this can be reverted.
2014-05-03 16:24:00 -04:00
Roland Walker 3ded5898b6 more reliable way to look up username
`ENV` is manipulable.  `getpwuid` is reliable.
2014-02-21 09:30:37 -05:00
Roland Walker 3ad2d6c31c create target directories on-demand
closes #2996.  Moves the logic for creating target directores
from init-time in cask.rb to install-time within the artifact
classes.  Removes the need for special-case mkpath for each
new artifact type.
2014-02-21 09:22:37 -05:00
Roland Walker 379f3e7c88 add missing `HOMEBREW_CACHE_CASKS.mkpath`
If `mkpath` must be done for the parent dir, then it certainly
must also be done for the child dir.
2014-02-05 09:57:35 -05:00
Roland Walker 3cc22374f9 doubledash hygiene for external cmd: sudo, AND
also includes doubledash hygiene for any child commands following each sudo
2014-01-31 12:58:39 -05:00
Roland Walker 2a450c3a07 make version number available within brew-cask
brew cask doctor was showing 1.8.7 as the homebrew-cask software version
2014-01-29 10:00:13 -05:00
Roland Walker ad31b17316 Merge pull request #2647 from jedahan/screensaver
initial screensaver work
2014-01-28 08:21:19 -08:00
Jonathan Dahan ca61dfdd81 Add support for screensaver artifact 2014-01-28 10:17:50 -05:00
Roland Walker 216444849e Add copious debugging with --debug
- add new file "cask/utils.rb" analogous to "utils.rb" in Homebrew
- define odebug and odumpcask, analogs of ohai and friends, but
  which only give output when --debug is in effect
- move the debug setting from an instance variable in Cask::CLI
  to a method Cask.debug, defined in "lib/cask/options.rb", which
  was added in #2276. (Perhaps options.rb should be merged back
  into Cask::CLI).
- sprinkle odebug statements liberally throughout the codebase
- update tests
2014-01-28 10:15:43 -05:00
Roland Walker 768b21eae8 always submit external commands in list form
For safety.
- This is a step toward reworking system_command.rb so that
invocations are done in list form on the back end, avoiding
surprises from quoting and shell metacharacters.
- There is one transitional hack here: the _quote method in
Cask::SystemCommand is modified to avoid double-quoting.  The
_quote method itself will go away in a future revision when
only list-forms are used.
- Casks using system are not touched. It seems natural to
address that when creating the DSL for after_install/before_install.
2014-01-24 20:58:03 -05:00
Roland Walker 7a0f9ef37f always use full path to external utilities
per #2029
2014-01-23 12:20:32 -05:00
Roland Walker 329c48298a caveats first-class in DSL, gets own mini-DSL
Make caveats a first-class member of the Cask DSL.  It no longer has to
be specified with "def caveats", but can be given as "caveats do ... end"
as with after_install blocks.

In addition, create a mini-DSL which can be used within caveats blocks,
providing standard messages when manual installers must be used,
reboot-required, etc.

Add alternate form: caveats can also accept a compile-time string for
simple cases.

This is 99% compatible with old Casks, as it still works by defining
a caveats method.  However, all Casks containing caveats are cleaned
up and adapted according to the new DSL.

Full docs in CONTRIBUTING.md.
2014-01-20 11:54:46 -05:00
Paul Hinze 6786f336e8 Merge pull request #2303 from rolandwalker/qualified_cask_names
handle fully-qualified cask names, fixes #2235
2014-01-10 11:23:43 -08:00
Paul Hinze 2412bfebbb Merge pull request #2360 from jfb/master
chown can only be run as root
2014-01-10 11:02:56 -08:00
Paul Hinze 0967e4dd51 try forcing a require of homebrew's download_strategy
working on fixing #2275
2014-01-10 10:42:18 -06:00
James Felix Black 83d5e7dfe4 chown can only be run as root
The logic here was flawed -- my caskroom.parent was writeable, but chown
was called regardless, causing an error.
2014-01-08 11:22:32 -08:00
Stratos Moros 7136269198 implement `binary` artifact 2014-01-05 22:55:18 +02:00
Roland Walker b88bf787e0 handle fully-qualified cask names, fixes #2235
form "<user>/<repo>/<cask>" may be used on cmdline, matching homebrew
- refactor Cask::Source::Tap into Cask::Source::Tapped, removing
  code, only handling unqualified cask names here now (ie no slash)
- create Cask::Source::TappedQualified, handling "<user>-<repo>/<cask>"
  form as before, and new form "<user>/<repo>/<cask>", for the case that
  the relevant tap already exists
- create Cask::Source::UntappedQualified, handling both command-line
  forms as above, but implicitly creating adding a new tap if it
  does not already exist
- add module Cask::QualifiedCaskName for utility functions on qualified
  Cask names
2014-01-04 07:14:35 -05:00
Paul Hinze f6f507b289 some refactoring around the new download strategy
- move the interface from top-level methods to hash arguments of URL to
   keep the cask DSL as skinny as possible
 - promote the Cask::Headers object up to a Cask::URL object that
   encapsulates all infornation about the URL
 - pull all knowledge about curl arguments into the DownloadStrategy,
   leaving URL to act as a value object to be queried for details
 - test at the DownloadStrategy level; setting up expected curl args
   and example casks
2013-12-15 13:18:47 -06:00
Paul Hinze 24a53c4af7 Merge pull request #1944 from jonahoffline/add_headers_download_strategy
Add DownloadStrategy with custom :headers support
2013-12-14 09:13:58 -06:00
Jonah Ruiz 06be4b0d8e Add DownloadStrategy and Cask::Headers for custom :headers support
accepts a :user_agent argument and/or multiple :cookies
  headers :user_agent => 'Netscape/1.0', :cookies => { :cookey => "r00t" }

Also adds a standalone :fake_user_agent for a default UserAgent (Chrome)
  fake_user_agent
References #1175, #958
2013-12-12 21:29:12 -04:00
phinze 10db2d5d3c support non-ruby-backed casks
- brew cask list now displays casks without backing ruby files
- casks without a source are displayed as "caskname (!)"
- these casks can be uninstalled, with the caveat that it only removes
  their files from the caskroom (doesn't run pkg uninstall or anything,
  since there's no ruby file to define what to do)
2013-12-05 20:10:19 -06:00