A Flurry of updates

Compelled by Matt Aimonetti’s post on the Google Group, I made some big updates to SWX Ruby today:

  • A new home at github.
  • A RubyGem release. Thus, SWX Ruby is no longer tied to Rails. In fact, SWX Ruby is developing a bit of a crush on Merb.
  • A lighter Rails plugin that integrates with the new gem.
  • RDOC Documentation with instructions for Gem usage and the new Rails plugin setup.

With all this refactoring, there’s a good chance something got broken. Please swing by the Google Group if you track down any issues.


Getting Started With SWX Ruby

I finally got a chance to start working on some SWX Ruby documentation.

What’s there at present should give you a good overview of what it’s like to use SWX Ruby in your very own Rails application.

As I continue to interact with users on the mailing list, I hope to get a clearer idea of the places where better documentation is needed.

Feel free to leave any suggestions here in the comments. And, as always, thanks for using SWX Ruby!


SWX PHP AVM2 Just Over The Horizon

Aral Balkan made an exciting announcement today: There are now three developers working on implementing AVM2 support in SWX PHP. This is great news for SWX Ruby as I will have a reference implementation to start working on AVM2 support in SWX Ruby. I wait with bated breath. 


SWX Ruby Goes Beta

SWX Ruby is growing up! I just tagged a 0.5 release today. This release includes Rails controller integration as well as a couple of bug and security fixes.

Well aware that Rails isn’t the only kid on the block, I’m putting a gem distribution at the top of my list for the next release. Stay tuned…

script/plugin install http://swxruby.rubyforge.org/svn/tags/0.5/swx_on_rails


render :swx => ‘rails controller integration complete!’

I just committed the code to enable Rails controller integration in SWX Ruby. This is big news folks. For those of you wishing to very easily add SWX capabilities to an existing Rails app or those wishing for tighter integration between SWX Ruby and their existing controller setup, your wish has been granted.

Simply call render :swx => ‘my swx data’ from a Rails controller and SWX Ruby will send back a SWX file containing ‘my swx data’.

The SWX Ruby plugin also registers a MIME type for SWX files. This enables you to serve up your SWX data in RESTful style:

# in config/routes.rb
ActionController::Routing::Routes.draw do |map|
  map.connect '/restful.:format', :controller => 'Restful'
  map.connect '/restful', :controller => 'Restful'

# in app/controllers/restful_controller.rb
class RestfulController  
  def index
    respond_to do |format|
      format.html { render :text => 'not a swx request' }
      format.swx  { render :swx => 'a swx request' }

With the preceding code in your app, pull up http://localhost:3000/restful in a browser. You’ll see ‘not a swx request’. Then open Flash, place an empty MovieClip on stage with an instance name of ‘loader’, and place the following ActionScript in frame 1:

loader.debug = true;

loader.loadMovie("http://localhost:3000/restful.swx", "GET");

function onEnterFrame() {

Preview the Flash movie and the Output panel will begin tracing ‘a swx request’.

So when can I play with this?

This is checked in to trunk right now. script/plugin install http://swxruby.rubyforge.org/svn/trunk/

I’m planning on making a beta release of SWX Ruby by the end of the month which will include this new feature.

Note: In my recent testing, the install.rb script doesn’t execute when installing the plugin from trunk. Please let me know if you exeperience this issue and I’ll look into it further. A temporary workaround is to execute the install script manually:

$ script/plugin install http://swxruby.rubyforge.org/svn/trunk/
$ ruby vendor/plugins/trunk/install.rb


This functionality is now available in the 0.5 release.


SWX Ruby Has a Movie

I added a “Hello World” screencast to the SWX Ruby homepage. More documentation is on the way!


New Release: Alpha 0.1.1

I found a big security hole in the Alpha 0.1 release. Now that the SWX Contest is under way, I decided it was about time to fix it, thus 0.1.1.

Take it for a spin and let me know if anything breaks.

script/plugin install http://swxruby.rubyforge.org/svn/tags/0.1.1/swx_on_rails