opscode-cookbooks/homebrew — pull request #6 by bleything (2012-08-02 16:09:40+00:00)
Title: Fix parsing of brew info; install HEAD-only packages

As mentioned in #2, `brew info`'s output changed format a while ago. Since then the provider's `candidate_version` method has been broken and consequently all packages fail to install.

This changes `candidate_version` to pull the `brew info` output into Ruby and parse it there. It will return a string that matches the "best" version available by trying the stable version, the devel version, and finally HEAD.

It also fixes installation of head-only formulae by automatically adding `--HEAD` to the `brew install` command if it's a head-only formula.