Ruboss Technology Corporation

The Flexible Rich Internet Applications Company

Getting started with the Ruboss framework in 5 minutes

Updated instructions for getting started with the Ruboss Framework are available here. This allows you to work directly with any of our github repositories and such requires Rails2.1 and Git to be installed before you can proceed.

Dima

Framework development moving to GitHub

You can now follow Ruboss Framework development on GitHub and get your hands dirty too if you feel like it.

If you are using Rails 2.1 you can install the Ruboss plugin directly from the GitHub repository. The updated “Hello Ruboss” tutorial is avaiable in the README file.

You can follow development of the main Ruboss branches on GitHub. The most current and official development version (as well as the wiki, etc) will be on Dima’s GitHub account. You can also see Peter’s GitHub account for another development version.

If you want to fork and follow someone’s version of Ruboss Framework, we recommend you follow Dima.

Git and GitHub make it extremely easy to fork, modify and patch other people’s code. Here’s a quick intro to get you started: How to Use GitHub to submit a patch.

(If none of this makes any sense, go to GitHub and see their helpful guides.)

Have fun!

Dima Berastau

[Edited by Peter on 2008-06-15: we are no longer using a separate Ruboss account, since that's not the correct thing to do on GitHub.  Dima's version is the official version of the Ruboss Framework, since Dima is the lead developer.]

The swfobject helper

I’ve added a swfobject helper to the Ruboss plugin that does a few things for you:
1) It adds a cache-breaking time stamp to the .swf’s url so that you and your users don’t have to refresh their caches when your .swf changes.
2) It allows you to pass Ruby hashes for the flashVars, params and attributes parameters.
3) It will automagically create the flashContent div for you if you want

Here’s what a basic call would look like:

<html>
<head>
    <title>some page</title>
    <%= javascript_include_tag '/bin/swfobject' %>
</head>

<body>
<%= swfobject('/bin/YourSwf.swf') %>
<div id='flashContent'></div>
</body>
</html>

If you’re feeling extra lazy and want to have the flashContent div created automatically, then add a :create_div => true parameter to the swfobject call:

<html>
<head>
    <title>some page</title>
    <%= javascript_include_tag '/bin/swfobject' %>
</head>

<body>
<%= swfobject('/bin/YourSwf.swf', :create_div => true) %>
</body>
</html>

Only the first argument, the path to the .swf object, is required. The options and their defaults are:

:width => '100%',
:height => '100%',
:id => 'flashContent',
:version => nil,
:express_install_swf => nil,
:flash_vars => nil,
:params => nil,
:attributes => nil,
:create_div => false

A fully blown call to swfobject might look like this:

<%= swfobject('/bin/YourSwf.swf',
                         :flash_div => 'flashContent',
                         :width => '100%',
                         :height => '100%',
                         :version => '9.0.0',
                         :express_install_swf => '/bin/expressInstall.swf',
                         :flash_vars => 'flashVars',
                         :create_div => true
                        ) %>

Most of the options are pretty self-explanatory, but here’s some info on a couple of them:

:id gives the id of the div that the flash object will be created in. If :create_div is false, you must create the div yourself. If :create_div is true, it will be created for you.

:flash_vars, :options and :attributes can be passed in as either a Hash or a String. As a Hash they are translated to a Javascript Hash. As a String, they are assumed to represent the name of an existing Javascript variable. Here’s an example of passing in a Hash to flash_vars:

<html>
<head>
    <title>some page</title>
    <%= javascript_include_tag '/bin/swfobject' %>
</head>

<body>
<%= swfobject('/bin/YourSwf.swf', :create_div => true,
              :flash_vars => {'user_id' => @user.id, 'user_name' => @user.name}) %>
</body>
</html>

Here’s an example of passing in the name of a Javascript variable:

<html>
<head>
    <title>some page</title>
    <%= javascript_include_tag '/bin/swfobject' %>
</head>

<body>
<script>
  // Get the user information somehow, then add it to flashVars
  var flashVars = {user_id: user.id, user_name: user.name};
</script>
<%= swfobject('/bin/YourSwf.swf', :create_div => true, :flash_vars => 'flashVars') %>
</body>
</html>

Being able to pass in a name can come in handy if you want to pass in variables from the URL.

<html>
<head>
    <title>some page</title>
    <%= javascript_include_tag '/bin/swfobject' %>
</head>

<body>
<script>
	//Grab the flashVars from the URL search string.
	//This is not a perfect implementation: it will break, for example, if
	//you have an anchor tag, and it hasn't been tested with
	//URL encoded strings.

	var searchString = unescape(document.location.search);
	var flashVars = {};
	// strip off the leading '?' and split by '&'
	var nvPairs = searchString.replace(/^\?/, '').split("&");
	for (i = 0; i < nvPairs.length; i++)
	{
	  var nvPair = nvPairs[i].split(”=”);
	  var name = nvPair[0];
	  var value = nvPair[1];
	  flashVars[name] = value
	}
</script>
<%= swfobject(’/bin/YourSwf.swf’, :create_div => true, :flash_vars => ‘flashVars’) %>
</body>
</html>

That’s it. To get this, update your plugin to the latest version.

Scott Patten

Announcing Enterprise Flexible Rails (the ‘Ruboss in Action’ book)

Dima and I have been working hard not only on the Ruboss Framework, but also on a book which demonstrates how to use the framework correctly. This is finally ready for Beta release: http://manning.com/armstrong2/

The first chapter is freely available from http://www.manning-source.com/books/armstrong2/ch01_meap_enterprise.pdf.

Currently only 2 chapters are available, but many more will be added over the months ahead. We released this as early as possible, so that the framework documentation situation (which can currently only be described as “awful”) is improved.

Manning is pricing the PDF at $29.99 and the combo pack at $54.99. Frankly, if you were just buying the two chapters that are in the book, it would be borderline whether it would be worth it for you at this point–especially if you have followed along with the available free documentation. This is doubly-true since the first chapter is free. (If you bill your time hourly, however, it is probably still worth it.)

However, this is obviously not the finished product: this book is going to be the defining book about the Ruboss framework. By the end of the book, we will have included a discussion of BlazeDS and JRuby, Merb, Google App Engine, etc. (It’s not there yet, of course, since we haven’t even built the support for these into the framework yet!)

We want to emphasize two things:

1. The job of the book is to sell the framework, not the other way around. (The Ruboss Framework is the foundation of our company–which is currently 4 developers. It’s not something we’re building to sell books.)

2. We are going to continue to improve the free documentation, on the wiki and the blog. (The limiting factor on the free documentation is time, not any desire to not “compete” with the book.)

If you want to use the Ruboss framework on a project at work, having Enterprise Flexible Rails as a Manning book may help your chances, as it helps to counter the “lack of documentation” criticism. (Also, the Manning name adds some extra legitimacy for an Open Source project at such an early stage.)

The project in Enterprise Flexible Rails is going to be building an agile project management application intended for small teams. (Once again, I’m going to call this project Pomodo. No, it’s not the Pomodo from Flexible Rails: I just like the name!) The reason for this choice is entirely selfish: I want to build an application that my company can use once it’s done. We’ll write about our own dog food, as well as eating it…

As always, all feedback is very much appreciated.

Thanks,
Peter Armstrong and Dima Berastau

Working with yamlscaffold and multiscaffold scripts

You can now force an order on attributes specified in db/model.yml by prefixing a line with - (standard YAML). This will produce flex model, generated view component, migrations, etc based on the exact order you specify. You can mix and match ordered attribute models with unordered attribute models.

Here’s an example:

project:
 - name*: string
 - notes: text
 - completed: boolean
 - user_id: integer
 - has_many: [tasks]

location:
 name*: string
 notes: text
 user_id: integer
 has_many: [tasks] 

task:
 - name*: string
 - notes: text
 - completed: boolean
 - next_action: boolean
 - project_id: integer
 - location_id: integer
 - user_id: integer

This should produce ordered project and task artifacts and unordered location artifacts.

It is also possible to use a plain-text file to specify your models if you don’t like YAML for some reason. It should be located in db/model.txt. The format for it is quite simple, one model per line E.g.:

Project name:string notes:text completed:boolean user_id:integer has_many:tasks

If you are using plain text to store your models you should run ./script/multiscaffold instead of ./script/yamlscaffold

Announcing the Ruboss Framework

Dima and I have been working hard on the Ruboss Framework: a framework that aims to take Flex and Rails development to the next level by making the whole process a lot easier and more integrated.

We’re finally ready to release the first public Beta version. You can find the source code, getting started tutorial and more at the framework Google Code page: http://code.google.com/p/ruboss

The documentation is very thin at the moment, but there’s more coming in the very near future.

Our ambition is to bring a RESTful, Rails-inspired approach to both Adobe Flex and AIR development. Obviously, this includes integrating with RESTful Rails controllers, with both XML over HTTP or AMF. You will also be able to use the local AIR database with virtually no changes to the code base.

Longer term plans may include a plugin for Merb, adaptors for Amazon SimpleDB, Google App Engine, etc — basically, anything that has or can be exposed with a RESTful API that we can talk to from a Ruboss-using Flex application.

We are using the Ruboss Framework on projects of varying complexity and have been very happy with the productivity improvements. But since we are the framework authors, this is to be expected.

All feedback is very much appreciated.

We hope that you’ll find using the Ruboss framework enjoyable.

Peter Armstrong and Dima Berastau
Co-Founders, Ruboss Technology Corporation

,