caskroom/homebrew-cask — pull request #5043 by rolandwalker (2014-06-23 19:20:41+00:00)
Title: WIP DSL: add `:glob` key to expand fileglobs

This is a very rough/quick implementation, and is intended mostly for discussion,
as this is the DSL proposal in #4688 which has no associated PR.

Problems here include:
1. This was implemented alongside `:target` in `artifact/symlinked.rb`, which also
contains installation logic for artifacts. A smarter implementation would improve
separation of concerns by moving the logic for interpreting both `:glob` and `:target`
keys into `dsl.rb` (or some class called from `dsl.rb`)
2. Only artifact sources such as `link` can be expanded. Similar functionality would
also be useful (for example) in `uninstall :files`.
3. This interface seems clunky. It might be cleaner to have an `expand` method in
the DSL for wrapping filenames:

```ruby
link expand('*/VLC.app')
```

The `expand` method would actually call a constructor, because the action of expansion
must be deferred until install-time. However, I think Expander.new('*') is needlessly
verbose for Cask authors, and not necessarily more self-documenting.
- The `expand` interface might also help address problem 2 above.

References: https://github.com/caskroom/homebrew-versions/pull/293#issuecomment-46166969