I've ported this library to ruby (added link to readme)