Skip to content
This repository has been archived by the owner on May 2, 2024. It is now read-only.

Commit

Permalink
Update CONTRIBUTING.md
Browse files Browse the repository at this point in the history
  • Loading branch information
miccal authored Jan 26, 2017
1 parent ecb1191 commit bfc6c46
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
# How to Contribute

All of the [instructions for contributing from the main repository](https://github.com/caskroom/homebrew-cask/blob/master/CONTRIBUTING.md) apply, and won't be repeated here. You simply need to change references to `caskroom/homebrew-cask` (that repository) to `caskroom/homebrew-versions` (this repository).

# Nightly Builds (Nightlies)

For Casks that use nightlies, which are generally builds that are done once a day, the `version`, `sha256` and `url` will change frequently and hence the Cask will be constantly outdated. To alleviate having to regularly update a Cask for a nightly build, the use of a [`url do` block](https://github.com/caskroom/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` can help ensure that the latest version is always used.

See [this pull request for exist-db-nightly](https://github.com/caskroom/homebrew-versions/pull/3067) for an example of the procedure.

Example ([exist-db-nightly.rb](https://github.com/caskroom/homebrew-versions/blob/16b3bab91ab5b9a69ef7c456441b0e0fced56516/Casks/exist-db-nightly.rb#L6#L14)):
```ruby
url do
require 'open-uri'
base_url = 'http://static.adamretter.org.uk/exist-nightly'
builds_url = "#{base_url}/table.html"
latest_build_filename = open(builds_url) do |io|
io.read.scan(%r{<tr>.*?<td>(.*?)</td>.*?<a href="([^\"]+)">dmg}m).max[1]
end
"#{base_url}/#{latest_build_filename}"
end
```

0 comments on commit bfc6c46

Please sign in to comment.