Skip to content

Commit

Permalink
Merge pull request #6578 from rolandwalker/doc_container_nested
Browse files Browse the repository at this point in the history
docs and tests for new form `container :nested`
  • Loading branch information
rolandwalker committed Oct 9, 2014
2 parents 9853e47 + 41cf7d9 commit d69732b
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 41 deletions.
28 changes: 14 additions & 14 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).

Expand Down
2 changes: 1 addition & 1 deletion doc/CASK_LANGUAGE_REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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))

Expand Down
1 change: 1 addition & 0 deletions doc/cask_language_deltas.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`

Expand Down
2 changes: 1 addition & 1 deletion lib/cask/artifact/nested_container.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 0 additions & 11 deletions test/cask/installer_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -252,17 +252,6 @@
TestHelper.valid_alias?(dest_path).must_equal true
end

it "supports new DSL form container :nested => <inner-container>" 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')

Expand Down
13 changes: 0 additions & 13 deletions test/support/Casks/nested-app-dsl-one.rb

This file was deleted.

2 changes: 1 addition & 1 deletion test/support/Casks/nested-app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit d69732b

Please sign in to comment.