Homebrew is just a Ruby project in git so all the packages (or formulas) are just rb files inside the project:
https://github.com/mxcl/homebrew/tree/master/Library/Formula
They usually only provide the most recent stable version of each project but you can find other formulas on the web and just run:
brew install [url]