February 17th 2009

Giraffesoft releasing Gems and Plugins this week

The folks at Giraffesoft have decided to release some of the common code they've been using in their projects into plugins and gems on their brand-new company blog. In their own words:

At giraffesoft, we're big believers in extracting functionality sooner rather than later. This practice has resulted in a ton of code that we use in all of our projects — nice and DRY. Only problem is, we never get around to releasing this stuff. Starting a blog seemed like a good excuse to spend some time polishing up some code and, you know, writing READMEs. So, starting today, we'll be releasing an open source project every day this week. They'll probably be mostly rails plugins. But, you never know. Something else might float in.

Actually, something else did float in right on the first day: Classy Resources for Sinatra, a gem allowing you to create restful web services that can be consumed by ActiveResource without manually defining all of the controller actions, but rather with a (very Railsish) configuration-style method:

define_resource :posts, :member => [:get, :put, :delete], :collection => [:get, :post], :formats => [:xml, :json, :yaml]

The thing is pretty customizable and even if it's not exactly what you need, it still might be interesting to investigate the source code to see how to refactor common code into modules in Sinatra.

If you don't know Sinatra yet, you really should go and check it out at Github and have a look at the Sinatra book.

Written by Christoph Olszowka
blog comments powered by Disqus