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
Getting Started
Learning by example
Please have a look at the examples provided, they are simple enough to let you grasp how rubyrest works.
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.
Ruby-on-Rest can also be embedded in ruby code. This is useful for testing purposes:
config = {
“service” => “hello”, “prefix” => “acme”, “serviceport” => 9003 “daemon” => true “entities” => [ “welcomeservice” ]
}
engine = RubyRest::Engine.new( config )
engine.start
# ...
# do some http calls here
# ...
engine.stop
Configuring your service
Ruby-on-Rest will try to load a file name <my_service>.rb which provides the implementation of the service.