Homebrew installs packages to their own directory and then symlinks their files into /usr/local.
$ cd /usr/local
$ find Cellar
$ ls -l bin
bin/wget -> ../Cellar/wget/1.12/bin/wget
Homebrew won’t install files outside its prefix, and you can place a Homebrew installation wherever you like.
Trivially create your own Homebrew packages.
$ brew create http://foo.com/bar-1.0.tgz
It's all git and ruby underneath, so hack away with the knowledge that you can easily revert your modifications and merge upstream updates.
$ brew edit wget # opens in $EDITOR!
Homebrew formulae are simple Ruby scripts:
require'formula'classWget < Formula
system 'make install'endend
Homebrew complements OS X. Install your gems withgem, and their dependencies with brew.