Skip to content

openrain/active_racksource

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Rack backend for ActiveResource for testing RESTful Rack APIs

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages