Just food for thoughts, I forked DHH's implementation and modified it to support a bigger structure (so you can keep stuff in different files/class). I haven't tested the file so it may contains bugs, I apologize if it does.
The file name contains dash(-) replace them with slash(/) as github doesn't like path.
The file name contains dash(-) replace them with slash(/) as github doesn't like path.
https://gist.github.com/pothibo/9673715
I hope you like it ;)
Edit: It had a shit loads of typos, I believe I have fixed most of them.