Over at Homebrew we've accidentally caused an edge-case problem for some
Caskroom users. We recently merged https://github.com/Homebrew/homebrew/commit/915ac06d
which is much stricter on empty installations, failing during install rather than
just shouting about it in the audit.
We'd prefer not to revert the change there because it's quite a positive change
that's much more obvious about installation problems, given installations
shouldn't be empty. There's also the likelihood that if we revert, wait 3 months
to add the check back, someone out there will wait 4 months before upgrade and we'll
run into this again.
However, this causes some issues with Cask because when Mike rewrote the formula
he left `def install` an empty hole, which was fine at the time.
Anyone who hasn't updated between December 9th 2015 and January 9th 2016 will now
run into a fatal error on upgrading the Cask formula, as seen in: https://github.com/Homebrew/homebrew/issues/47929
I was wondering if the Cask would be kind enough to tag one very last bug fix release,
or even retag the existing tag and formula with a similar fix to this.
If you're agreed and prefer to do this yourself you can ignore the PR but wanted
to explain the background.
This provides a few benefits:
- faster `brew cask` execution times as another Ruby process is not
needed. Cask can instead be loaded in-process with Homebrew. This
will also make it easier to use some of Homebrew's core code and
ease moving code from Cask into Homebrew core.
- Users do not need to `brew upgrade` Cask any more: it's done
automatically on any `brew update` or `git pull` of the Cask tap.
Previously if a person was using RVM or Rbenv and set a Ruby < 2.0 as
their global Ruby, cask would use brew to install a newer Ruby even
though a new enough Ruby could be present already.
Sorry, pedantry here that I'm about to fix globally in Homebrew/homebrew: it doesn't really make sense to use `Dependency` in the name here because this is a `Requirement` and a `Dependency` is another, similar internal Homebrew class so this change is a bit less confusing.
Current dependency name will be conficted with the formula name of
homebrew/version/ruby20.rb, in result it will cause following error:
```
$ brew readall
Error: problem in /usr/local/Library/Formula/ruby20.rb
wrong number of arguments (3 for 0..1)
```
Fixes https://github.com/Homebrew/homebrew/issues/38638
* convert existing Cask:: namespace to Hbc::
* move Homebrew-fork code under Hbc::
* move freestanding classes such as Tty and TopologicalHash under Hbc::
* recast HOMEBREW_CASK_ constants as HBC_
* modify our Homebrew Formula for backward compatibility
* devscripts and dev docs
global replace of:
'phinze/homebrew-cask' -> 'caskroom/homebrew-cask'
'phinze/cask' -> 'caskroom/cask'
'phinze/homebrew-testcasks' -> 'caskroom/homebrew-testcasks'
and various other specific places that needed updates
<3 the homebrew-cask community!
we had collision issues with homebrew's 'cask' formula (for the emacs
package manager project).
this keeps the in-project and in-formula visibility of the version
number via the old "namespaced global" strategy that keeps a `Cask`
constant out of view of the formula.
gives project-internal visibility of the version constant for use in
displaying to the user.
the formula now does a targeted require to get the version constant from
the new location.