3 [Instructions from the main repository](https://github.com/Homebrew/homebrew-cask/blob/master/CONTRIBUTING.md) apply. Exceptions are documented on the [README](README.md) and this document.
5 ## Naming Versions Casks
7 All Cask names and tokens should be of the form of:
9 `<token><numbered version>` or `<token>-<pre-release type>`
11 ### Versions Token Examples
13 Cask Token | `<token>-<numbered version>` | Filename
14 --------------------|------------------------------|------------------------
15 `alfred 2` | `alfred2` | `alfred2.rb`
16 `dash` | `dash3` | `dash3.rb`
17 `lingon-x` | `lingon-x5` | `lingon-x5.rb`
18 `transmit` | `transmit4` | `transmit4.rb`
20 Cask Token | `<token>-<pre-release type>` | Filename
21 --------------------|------------------------------|------------------------
22 `docker` | `docker-edge` | `docker-edge.rb`
23 `firefox` | `firefox-beta` | `firefox-beta.rb`
24 `sublime-text` | `sublime-text-dev` | `sublime-text-dev.rb`
25 `vlc` | `vlc-nightly` | `vlc-nightly.rb`
27 # Nightly Builds (Nightlies)
29 For Casks of [nightlies](https://en.wikipedia.org/wiki/Daily_build), `version`, `sha256`, and `url` change frequently, making the Cask constantly outdated. To alleviate having to regularly update them, the use of a [`url do` block](https://github.com/Homebrew/homebrew-cask/blob/master/doc/cask_language_reference/stanzas/url.md#using-a-block-to-defer-code-execution) in conjunction with `version :latest` and `sha256 :no_check` is encouraged, to ensure the latest version is always fetched.
31 See [this pull request for exist-db-nightly](https://github.com/Homebrew/homebrew-cask-versions/pull/3067) for an example of the procedure.
33 Example ([exist-db-nightly.rb](https://github.com/Homebrew/homebrew-cask-versions/blob/16b3bab91ab5b9a69ef7c456441b0e0fced56516/Casks/exist-db-nightly.rb#L6#L14)):
38 base_url = "http://static.adamretter.org.uk/exist-nightly"
39 builds_url = "#{base_url}/table.html"
40 latest_build_filename = URI(builds_url).open do |io|
41 io.read.scan(%r{<tr>.*?<td>(.*?)</td>.*?<a href="([^\"]+)">dmg}m).max[1]
43 "#{base_url}/#{latest_build_filename}"