caskroom/homebrew-cask — pull request #8210 by vitorgalvao (2014-12-18 00:36:31+00:00)
Title: Uninstall depends on

This adds a `uninstall_depends_on_default_install_location` caveat, as well as changing three casks to use it. Thought descriptive, it is a verbose name, so ideas to make it shorter without losing clarity are very welcome.

This comes in the context of [`battle-net.rb`](https://github.com/caskroom/homebrew-cask/blob/67758531b7d688e304d68a85dbcd62886f7457ce/Casks/battle-net.rb) and [`vuze.rb`](https://github.com/caskroom/homebrew-cask/blob/67758531b7d688e304d68a85dbcd62886f7457ce/Casks/vuze.rb). Those casks use an installer via `installer :manual` that allows the user to pick an install location. To uninstall these, we need to delete files, but we cannot know where they are if the user picked an installation directory other than the default one. For that we currently use a caveat, but I bet there are many more casks that could benefit from it and do not yet have it, hence creating something specific should be beneficial.

```ruby
caveats do
uninstall_depends_on_default_install_location
end
```

should simply output `If you pick an installation directory other than {default_install_path} when installing this cask, you will need to uninstall it manually`, with `{default_install_path}` defaulting to `/Applications` if no argument is given. Maybe there aren’t cases where `/Applications` isn’t the default, but doesn’t hurt to have the options there.

Naturally, this needs review from the more experience ruby developers amongst you.