Sprouts: a Rails developer’s best friend for Flex

Sprouts logoIt has been quite a few months since I had my first encounter with developing Adobe Flash / Flex applications. Today I got back at it to do some tweaking on my VideoTrees prototype and I noticed again how much I love using Sprouts for it. I just have to share this with you.

In the beginning, Flash was mainly a vector animation and multimedia tool, that allowed for some interactivity by means of the scripting language ActionScript. Over time, developers began to use Flash for numerous applications it was never designed for, such as games and even complete websites. Since then, the technology has come a long way. Adobe acquired the company responsible for Flash and started the move towards a usable SDK with Flex.

Nowadays, developing Flash applications no longer requires you to work with cumbersome applications like Flash MX. ActionScript 3.0 is a full-blown object oriented language and thanks to MXML, it is no longer required to use a WYSIWYG editor for putting things together. Now all that’s left, are tools that allow you to work just the way you want to… Meet Sprouts!

Sprout applies some of the principles of developing Rails applications to Flash/Flex/Air. The small Ruby Gem contains the “sprout” command for setting up new projects, which behaves very similar to the “rails” command. The command

sprout -n [type] projectname

creates a new project skeleton, with everything in place for easy coding and testing. Also, it creates a rakefile for building the actual .swf from the source and running the tests.

Similar to the way Rails works, a sprout also creates a “generate” script inside the project’s “script” directory. With this script, class and interface templates can be generated from the command line like this:

script/generate my.package.MyClass

It even has rudimentary support for naming conventions, which it applies to the supplied name to determine whether it needs to be a class or an interface.

As a final bonus, Sprout will also take care of managing all the different libraries and frameworks required to build a Flash or Flex application. On the first rake, it will download all that’s needed and cache it for later use in other projects.

This definitely takes a lot of the hassle out of working with Flash and it is also very close to how I like to work. I get to open a well-organised project tree in TextMate and work with it the way I want, all the way to raking the project at the end. Best of all, the project has given birth to a vast number of available “sprouts” (templates), as can be found on their RubyForge page. Did I mention it is open source?

One Response to “Sprouts: a Rails developer’s best friend for Flex”

  1. Pingback: Luke Bayes