Title: DM-Paperclip - Paperclip for DataMapper
Tonight I posted the official release of the DataMapper port of Paperclip that I've been slowly working on for while. Paperclip is a Rails plugin by Thoughtbot which makes it really easy to attach files to your models. I've been interested in doing some Merb and DataMapper projects, and one of them was going to make use of Paperclip, so I dived into making a port of it.
DM-Paperclip works exactly like the existing Paperclip plugin, with the same options, features, validations, and it even uses the same tests! Rather than rewrite Paperclip, I instead just went in and changed what was necessary for compatibility with DataMapper, slowly working on the number of passing tests.
The module is currently targeting DataMapper 0.9, which is still unreleased. The main reason is because 0.9 is quite different than 0.3, and the current source includes a few fixes and features that were added while I was working on the port. It is also intended to be used with Merb, as the paths make use of Merb.root and Merb.env. It should work with any of the 0.9.x Merb releases, though with 0.9.3 recently being released, that is the build I've been using it against.
Last night, I finally got the last couple of tests passing, updated it to be in sync with Paperclip 2.1.2, polished some documentation, and now it is ready for mass consumption! Even managed to get a mention on Thoughtbot's blog.
You can browse the source tree here: http://github.com/krobertson/dm-paperclip
Download the source yourself:
git clone git://github.com/krobertson/dm-paperclip.git
Install it as a gem:
sudo gem install dm-paperclip