SWX Ruby Alpha: SWX RPC for Ruby on Rails

Swx Ruby Alpha

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:

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