What? A Rails plugin for adding much needed REST features, especially for remote API development.
Why? I’m working on a new project and upgrading an old one to Rails 2.0. I like to keep things as simple as possible, so I’m going to skip SOAP and go straight to REST. Just using Rails is a great start, but a few things are missing that would make my life easier. So I’m extracting them from the code base into the restfully_yours plugin. That way, you can use them too.
Where?
./script/plugin install http://labnotes.org/svn/public/ruby/rails_plugins/restfully_yours
Specifically? Support for conditional GET and conditional PUT (if_modified). Support for idempotent create (create_once). Presenters, particularly useful if you need URLs and content in to_xml/to_json. Improvements to Net::HTTP (client side). Whatever I end up needing that’s usable in different contexts.
I’ll dedicate one post to each new feature as it’s ready, explain what it does and how to use it. You’ll want to svn update accordingly.
Contribute to Rails? Good idea. I’m going to use this plugin to put out new extensions, test them out, refine them, without bothering vendor/rails. But if you find any of these important enough to be part of Rails core, be heard or help yourself and get it included. I’d like some of these to show up in future releases.
Which Rails? I’m testing against Rails edge, but it will probably work with Rails 1.2. If not, feel free to contribute patch (with test case) and I’ll add it.
License? Public domain.
Labnotes » if_modified: infinite cache size and optimistic locks
Chipping the web – five and nine — Chip’s Quips