Skip to content
Rack backend for ActiveResource for testing RESTful Rack APIs
Ruby
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
lib
.gitignore
CHANGELOG
LICENSE
NOTICE
README.rdoc
Rakefile
VERSION.yml
active_racksource.gemspec

README.rdoc

ActiveRacksource

Active*Rack*source is a Rack backend for ActiveResource.

Ok … What does that mean?

Here's an example, let's define a simple ActiveResource library

ActiveResource::Base.site = 'http://lots-of-dogs.com/'

class Dog < ActiveResource::Base
end

If you run the following command, it runs over HTTP and actually requests lots-of-dogs.com/dogs.xml

>> Dog.find( :all ).length
=> 1462

But, if you give ActiveResource a Rack application to use as a backend …

require 'active_racksource'

ActiveResource::Base.app = @my_rack_application

And run the command again …

>> Dog.find( :all ).length
=> 5

Then it runs against the Rack application, not over any TCP or anything! This is great for creating & testing ActiveResource APIs for your web applications.

Documentation

Read the RDoc

History

See the CHANGELOG

Cool, how should I get started?

Watch the screencast

Something went wrong with that request. Please try again.