From 41cf7d96f0ff06c55e0639f8ce382e2651f9f5d1 Mon Sep 17 00:00:00 2001 From: Roland Walker Date: Thu, 9 Oct 2014 11:34:29 -0400 Subject: [PATCH] docs and tests for new form `container :nested` --- CONTRIBUTING.md | 28 ++++++++++++------------ doc/CASK_LANGUAGE_REFERENCE.md | 2 +- doc/cask_language_deltas.md | 1 + lib/cask/artifact/nested_container.rb | 2 +- test/cask/installer_test.rb | 11 ---------- test/support/Casks/nested-app-dsl-one.rb | 13 ----------- test/support/Casks/nested-app.rb | 2 +- 7 files changed, 18 insertions(+), 41 deletions(-) delete mode 100644 test/support/Casks/nested-app-dsl-one.rb diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 78679bf11ac0..8d74a217fd60 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -150,20 +150,20 @@ Other commonly-used stanzas are: Additional stanzas you might need for special use-cases: -| name | value | -| ------------------ | ----------- | -| `prefpane` | relative path to a preference pane that should be linked into the `~/Library/PreferencePanes` folder on installation -| `colorpicker` | relative path to a ColorPicker plugin that should be linked into the `~/Library/ColorPickers` folder on installation -| `qlplugin` | relative path to a QuickLook plugin that should be linked into the `~/Library/QuickLook` folder on installation -| `font` | relative path to a font that should be linked into the `~/Library/Fonts` folder on installation -| `widget` | relative path to a widget that should be linked into the `~/Library/Widgets` folder on installation (ALPHA: DOES NOT WORK YET) -| `service` | relative path to a service that should be linked into the `~/Library/Services` folder on installation -| `binary` | relative path to a binary that should be linked into the `/usr/local/bin` folder on installation -| `input_method` | relative path to a input method that should be linked into the `~/Library/Input Methods` folder on installation -| `screen_saver` | relative path to a Screen Saver that should be linked into the `~/Library/Screen Savers` folder on installation -| `suite` | relative path to a containing directory that should be linked into the `~/Applications` folder on installation -| `nested_container` | relative path to an inner container that must be extracted before moving on with the installation; this allows us to support dmg inside tar, zip inside dmg, etc. -| `caveats` | a string or Ruby block providing the user with Cask-specific information at install time (see also [Caveats Stanza Details](doc/CASK_LANGUAGE_REFERENCE.md#caveats-stanza-details)) +| name | value | +| ---------------------- | ----------- | +| `prefpane` | relative path to a preference pane that should be linked into the `~/Library/PreferencePanes` folder on installation +| `colorpicker` | relative path to a ColorPicker plugin that should be linked into the `~/Library/ColorPickers` folder on installation +| `qlplugin` | relative path to a QuickLook plugin that should be linked into the `~/Library/QuickLook` folder on installation +| `font` | relative path to a font that should be linked into the `~/Library/Fonts` folder on installation +| `widget` | relative path to a widget that should be linked into the `~/Library/Widgets` folder on installation (ALPHA: DOES NOT WORK YET) +| `service` | relative path to a service that should be linked into the `~/Library/Services` folder on installation +| `binary` | relative path to a binary that should be linked into the `/usr/local/bin` folder on installation +| `input_method` | relative path to a input method that should be linked into the `~/Library/Input Methods` folder on installation +| `screen_saver` | relative path to a Screen Saver that should be linked into the `~/Library/Screen Savers` folder on installation +| `suite` | relative path to a containing directory that should be linked into the `~/Applications` folder on installation +| `container :nested =>` | relative path to an inner container that must be extracted before moving on with the installation; this allows us to support dmg inside tar, zip inside dmg, etc. +| `caveats` | a string or Ruby block providing the user with Cask-specific information at install time (see also [Caveats Stanza Details](doc/CASK_LANGUAGE_REFERENCE.md#caveats-stanza-details)) Even more special-use stanzas are listed at [Optional Stanzas](doc/CASK_LANGUAGE_REFERENCE.md#optional-stanzas) and [Legacy Stanzas](doc/CASK_LANGUAGE_REFERENCE.md#legacy-stanzas). diff --git a/doc/CASK_LANGUAGE_REFERENCE.md b/doc/CASK_LANGUAGE_REFERENCE.md index d66fabc58727..ce3bb36bd8ec 100644 --- a/doc/CASK_LANGUAGE_REFERENCE.md +++ b/doc/CASK_LANGUAGE_REFERENCE.md @@ -102,13 +102,13 @@ Each Cask must declare one or more *artifacts* (i.e. something to install) | ---------------------- |------------------------------ | ----------- | | `uninstall` | yes | procedures to uninstall a Cask. Optional unless the `pkg` stanza is used. (see also [Uninstall Stanza Details](#uninstall-stanza-details)) | `zap` | yes | additional procedures for a more complete uninstall, including user files and shared resources. (see also [Zap Stanza Details](#zap-stanza-details)) -| `nested_container` | yes | relative path to an inner container that must be extracted before moving on with the installation; this allows us to support dmg inside tar, zip inside dmg, etc. | `depends_on` | yes | a list of dependencies required by this Cask (see also [Depends_on Stanza Details](#depends_on-stanza-details)) | `caveats` | yes | a string or Ruby block providing the user with Cask-specific information at install time (see also [Caveats Stanza Details](#caveats-stanza-details)) | `preflight` | yes | a Ruby block containing preflight install operations (needed only in very rare cases) | `postflight` | yes | a Ruby block containing postflight install operations | `uninstall_preflight` | yes | a Ruby block containing preflight uninstall operations (needed only in very rare cases) | `uninstall_postflight` | yes | a Ruby block containing postflight uninstall operations +| `container :nested =>` | no | relative path to an inner container that must be extracted before moving on with the installation; this allows us to support dmg inside tar, zip inside dmg, etc. | `container :type =>` | no | a symbol to override container-type autodetect. may be one of: `:air`, `:bz2`, `:cab`, `:dmg`, `:generic_unar`, `:gzip`, `:otf`, `:pkg`, `:rar`, `:seven_zip`, `:sit`, `:tar`, `:ttf`, `:xar`, `:zip`, `:naked`. (example [parse.rb](../Casks/parse.rb)) | `tags` | no | a list of key-value pairs for Cask annotation. Not free-form. (see also [Tags Stanza Details](#tags-stanza-details)) diff --git a/doc/cask_language_deltas.md b/doc/cask_language_deltas.md index d1baed3d781c..2391dfb02d1a 100644 --- a/doc/cask_language_deltas.md +++ b/doc/cask_language_deltas.md @@ -63,6 +63,7 @@ This notice will be removed for the final form.** | `depends_on_formula` | `depends_on :formula` | `install` | `pkg` | `link` | `app` (or sometimes `suite` or `artifact`) +| `nested_container` | `container :nested =>` | `uninstall :files` | `uninstall :delete` | `version 'latest'` | `version :latest` diff --git a/lib/cask/artifact/nested_container.rb b/lib/cask/artifact/nested_container.rb index 338776e55261..2bb9d24311da 100644 --- a/lib/cask/artifact/nested_container.rb +++ b/lib/cask/artifact/nested_container.rb @@ -11,7 +11,7 @@ def extract(container_relative_path) source = @cask.destination_path.join(container_relative_path) container = Cask::Container.for_path(source, @command) unless container - raise CaskError.new "Aw dang, could not identify nested_container at '#{source}'" + raise CaskError.new "Aw dang, could not identify nested container at '#{source}'" end ohai "Extracting nested container #{source.basename}" container.new(@cask, source, @command).extract diff --git a/test/cask/installer_test.rb b/test/cask/installer_test.rb index 37150b370a48..29212d25d063 100644 --- a/test/cask/installer_test.rb +++ b/test/cask/installer_test.rb @@ -252,17 +252,6 @@ TestHelper.valid_alias?(dest_path).must_equal true end - it "supports new DSL form container :nested => " do - nested_app_dsl_one = Cask.load('nested-app-dsl-one') - - shutup do - Cask::Installer.new(nested_app_dsl_one).install - end - - dest_path = Cask.appdir/'MyNestedApp.app' - TestHelper.valid_alias?(dest_path).must_equal true - end - it "generates and finds a timestamped metadata directory for an installed Cask" do caffeine = Cask.load('local-caffeine') diff --git a/test/support/Casks/nested-app-dsl-one.rb b/test/support/Casks/nested-app-dsl-one.rb deleted file mode 100644 index 56a4b380a1e4..000000000000 --- a/test/support/Casks/nested-app-dsl-one.rb +++ /dev/null @@ -1,13 +0,0 @@ -class NestedAppDslOne < TestCask - # todo: This Cask can be removed after DSL 1.0 transition, - # b/c the main Cask nested-app.rb will be - # adopting this syntax. - version '1.2.3' - sha256 '1866dfa833b123bb8fe7fa7185ebf24d28d300d0643d75798bc23730af734216' - - url TestHelper.local_binary_url('NestedApp.dmg.zip') - homepage 'http://example.com/nested-app' - - container :nested => 'NestedApp.dmg' - app 'MyNestedApp.app' -end diff --git a/test/support/Casks/nested-app.rb b/test/support/Casks/nested-app.rb index 583290516b4e..7b88ab69855c 100644 --- a/test/support/Casks/nested-app.rb +++ b/test/support/Casks/nested-app.rb @@ -5,6 +5,6 @@ class NestedApp < TestCask url TestHelper.local_binary_url('NestedApp.dmg.zip') homepage 'http://example.com/nested-app' - nested_container 'NestedApp.dmg' + container :nested => 'NestedApp.dmg' app 'MyNestedApp.app' end