SWX Ruby Alpha: SWX RPC for Ruby on Rails
This is so cool: Jed Hurt has released Alpha 0.1 of SWX Ruby, the Ruby implementation of SWX RPC for Ruby on Rails.
Jed and I have been corresponding on email about SWX Ruby for a little while now and it's amazing to see how quickly it has materialized. Jed, you rock!
Getting started with SWX Ruby
Here is the Hello World example from SWXRuby.org.
The service class:
class HelloWorld
def just_say_the_words
'Hello World!'
end
end
The ActionScript (using the native method of SWX RPC):
//There is a movie clip on stage with instance name 'loader'
loader.serviceClass = "HelloWorld";
loader.method = "justSayTheWords";
loader.debug = true;
loader.loadMovie("http://localhost:3000/swx", "GET");
function onEnterFrame()
{
trace(loader.result);
}
In other words, it's just like SWX PHP but you write your service classes in Ruby. That rawks! (Yeah, with an "a" even!) :)
To install SWX Ruby Alpha 0.1, you simply type the following command from your Rails project folder:
script/plugin install http://swxruby.rubyforge.org/svn/tags/0.1/swx_on_rails
If you want a quick way to get up and running with Ruby on Rails on OS X, check out the excellent self-contained one-click installer Locomotive.
(Also see my related posts on Locomotive and Ruby that may come in handy: Creating applications with RoR on OS X, Using Locomotive as your default Ruby, The location of the Rails source under Locomotive, and Clearing the gem source_cache in Ruby.)
A note on ports in general
I have been busy with getting SWX PHP to version 1.0 and haven't had a chance to concentrate on orchestrating the ports but this is something that will change now that version 1.0 is out. I'm trying desperately to get the Internet Drafts for SWX and SWX RPC together and write a guidance document for ports/implementations of SWX RPC.
The key points to note about ports/implementations is that they should be compatible with:
- SWX ActionScript Library
- SWX Tools (SWX Service Explorer and SWX Data Analyzer)
- The dominant/popular open source Flash Remoting implementation for the platform (e.g., OpenAMF, WebOrb for RoR, etc.)
- Adhere to SWX's core philosophy of system-wide simplicity and mirror the simplicity of the one-click install of SWX PHP and the SWX PHP Start Page.
The idea is that SWX RPC implementations work the same way regardless of the platform that they are implemented on.
Thank you, Jed!
Jed, you can't believe how much I appreciate your work on SWX Ruby and I can't wait to see SWX Ruby evolve in the coming days and weeks.
Comments
by SWX Ruby: SWX RPC for Ruby on Rails at SWX: SWF Data Format on 2007-09-17 16:34:26
by Meekish on 2007-09-17 17:21:17
by Folkert on 2007-09-17 21:32:49
by Mozilla on 2007-09-18 08:58:12
by Just Flashing - Today’s Top Blog Posts on Flash - Powered by SocialRank on 2007-10-01 09:07:42
by Magpie on 2007-10-25 05:10:12
by Aral on 2007-10-29 20:16:51