caskroom/homebrew-cask — pull request #8089 by rolandwalker (2014-12-13 18:45:40+00:00)
Title: WIP: Separate the Ruby backend from Homebrew + Require Ruby 2.x

### Separating from Homebrew

This PR isolates our codebase from Homebrew as discussed in #5080, and is intended to protect us from problems such as #7946.

`bin/brew-cask.rb` is replaced by an executable bash shim `bin/brew-cask`, which preserves the interface of the subcommand `brew cask`. However, we would no longer be `require`d into the Homebrew Ruby environment, but simply executed.

A somewhat stripped-down fork of Homebrew is added under `lib/homebrew-fork`. Once our code executes, it loads classes from the internal Homebrew fork so that various existing dependencies continue to work.

The next steps would be to pare back all of the classes under `homebrew-fork` to the minimum, migrate any needed logic into our own codebase, and finally delete the `homebrew-fork` directory entirely.

### Ruby 2.x requirement

The bash shim also requires Ruby 2.0 or higher. Since (I believe) Mountain Lion does not include Ruby 2.0 by default, it would be nicer to wait a little longer, the ideal date being around 6 months after Yosemite release: April 2015. However, `brew install ruby` is sufficient to meet the Ruby 2.0 requirement. We know users can execute that command, and the shim knows when to recommend it. Moving to Ruby 2.0 will benefit the backend devs.

### WIP

This PR passes tests locally, but is marked WIP because
* The homebrew-fork directory could be made much smaller. I have reduced it from ~100KLOC to ~10KLOC by some trivial attacks such as deleting all Formulae
* Our own Formula is modified here, but not yet tested