Ruby way

Here you have.

Try to reduce the length of `#parse` method and you'll have a nice script.