caskroom/homebrew-cask — pull request #7854 by rolandwalker (2014-12-06 20:46:23+00:00)
Title: DSL: add `accessibility_access` stanza

This stanza replaces the never-documented `postflight` methods `enable_accessibility_access` / `disable_accessibility_access` (`remove_accessibility_access`), and will also replace `caveats` / `assistive_devices` which is still present in the code for the moment.

The issue with the `postflight` approach is that the `postflight` blocks are opaque. We can't do anything very smart with the contents. In this case, that meant that Cask authors would need to build up and tear down accessibility permissions in each Cask:

```ruby
postflight do
enable_accessibility_access
end
uninstall_preflight
disable_accessibility_access
end
```

This PR replaces the procedural logic above with a declaration:
```ruby
accessibility_access true
```

Also:

* adds user feedback when accessibility is being changed
* fix trailing newlines on runtime-extracted bundle IDs
* de-document obsolete form `assistive_devices`
* create `staged_test.rb` for testing staged Casks
* test an actual staged Cask rather than mocking

Needed future work:

* `accessibility_access` should accept a bundle ID value for those cases where it cannot be deduced. Currently only the first `app` stanza is followed. `accessibility_access` can't be granted in Casks without an `app` stanza.
* the user should be able to turn off this feature.

@federicobond I might have introduced the newlines into bundle identifiers in #6329