Ruby-on-Rest: Simple REST Framework for Ruby
Ruby-on-Rest (rubyrest) provides a simple framework to help you expose your business objects as web resources.
Ruby-on-Rest provides an programming model and a security framework that lets you create new REST services without too much effort.
Resources
To check out the source code:
svn checkout svn://rubyforge.org/var/svn/rubyrest/trunk
Contact
If you have any comments or suggestions please send an email to pedro dot gutierrez at netcourrier dot com and I’ll get back to you.
Installation
sudo gem install rubyrest
Learning by example
Maybe the easiest way to learn how Ruby-on-Rest works is to take a look at the following examples, included in the source distribution:
-
The ‘Hello’ application can be used as a skeletton for new Ruby-on-Rest applications. You can test it by running the specifications:
spec hello_spec.rb and hopefully everything goes green :D
Starting the service
Ruby-on-Rest provides a shell command. Open your console, and type the following:
rubyrest dev <my_service> (for development deployment)
rubyrest live <my_service> (for live deployment)
This will first look at a YAML file called <my_service>_dev.yaml or <my_service>_live.yaml under the current path.
Embedding the Ruby-on-Rest engine
Ruby-on-Rest can be embedded in Ruby code. This is useful for testing purposes:
config = {
( ... config options here, see the hello app to get started ...)
}
engine = RubyRest::Engine.new( config )
engine.start
# ...
# do some http calls here
# ...
engine.stop