This post originated from an RSS feed registered with Ruby Buzz
by Daniel Berger.
Original Post: Pure. Ruby. Zlib.
Feed Title: Testing 1,2,3...
Feed URL: http://djberg96.livejournal.com/data/rss
Feed Description: A blog on Ruby and other stuff.
On December 15th, 2008, I decided that I'd had enough of dealing with Zlib on Windows. There was the zliby project, but it could only inflate (read) not deflate (write). I checked around on CPAN, too, but it was the same situation for the pure Perl implementations, so there was no hope of simply porting some Perl code.
So, I put up a modest $100 bounty for someone to implement a pure Ruby version of the Zlib::GzipWriter class (along with a few conditions) and contribute it back to the zliby project. Roger Pack would later match $50, which was great, but I still had low expectations in terms of anyone stepping up to implement it for such a relatively small sum of money.
Much to my pleasant surprise two people stepped up to the plate - Park Heesob and Charles L. The race was afoot! Charles L. had the lead (his tests passed first), but his implementation failed an acid test, and Park managed to pass the specs in the meantime.
Not only did Park implement the GzipWriter class, he ported the underlying zlib 1.2.3 library to its own module! The upside, beyond not having to deal with C extensions and DLL's, is that library writers can now use Park's RbZlib module to implement their own interface. I know I certainly wouldn't mind a nicer interface - the current one in the stdlib is kinda blech.
The files are here if you can't wait for zliby to be updated.