Middleman hacking

Recently I've been trying to dust off my developer skills and start hacking on projects again.

My first project was fixing a long-standing irritation with Middleman, the static site generator I use for my website and blog. Some of my pages were re-generating every time, despite the fact that I hadn't changed them.

After some digging, I narrowed this down to a utf-8 issue, and tracked it down to comparing a utf-8 encoded string to a raw binary string. In Ruby 1.9 these won't match (unless all the utf-8 characters are single-byte).

The fix was simple enough, but adding tests took a while - I haven't used Cucumber before. Additionally, I had to add a new kind of test to their framework - they weren't doing any "did the file update" tests.

In the end, I submitted a patch and it was accepted the same evening. Thank you to the Middleman developers for being so welcoming to patches!

posted: Mar 17 2013
tags: middleman