Turned this into a ruby gem.