SinatraResource

SinatraResource can help you build Web services in the Resource Oriented Architecture style. It is built on top of Sinatra and MongoMapper.

Installation

Check to see if you are running a recent version of RubyGems:

gem --version
# should be 1.3.7 of better, if not:
sudo gem update --system

I recommend a user-level installation:

gem install sinatra_resource

(A general note: beware of sudo gem install <project_name> -- it gives elevated privileges. Do you trust <project name>? Better to be safe and not use the sudo -- this gives you a local install in your ~/.gem directory.)

Usage

For a basic example of what this looks like when integrated into a real-world Sinatra app, see the /examples/datacatalog directory.

History

This code was extracted from the National Data Catalog (source code), a project of the Sunlight Labs.