Rango: A New Modular Ruby Webapp Framework

By grantmichaels

Rango is a Rack-based lightweight Web framework by Jakub Šťastný that has seemingly borrowed a little bit less from past Ruby frameworks and a bit more from Django. Based on the 1.9 version of Ruby, Rango works with rvm, Rip, Usher, Warden, and both the new Gem bundler and the venerable DataMapper by default.

Philosophically, "Rango is attempting to be as agnostic as possible, valuing simple, readable code. It intends to encourage explicit code rather than implicit magic." Modularity is a top priority. In many ways it feels like Ramaze, but with a newer "era of Rack" foundation. There's a good "Why Use Rango" article available if you want to get a feel for the project and why you might consider using it. There's also a PDF presentation that acts as an introduction to the project.

Serving, Routing and Templates

Rango is Passenger friendly, and because Rango is designed for Ruby 1.9, using Mongrel is discouraged (although possible). The router is pluggable and Usher is the default, but you can elect rack-router or rack-mount via the generator. At present, Rango plays nicely with Haml, but with the upcoming 0.2 version it will adopt Tilt, which adds a number of formats, including Mustache, ERB, Erubis, and Liquid.

Rango has generators, but beyond that it employs a sub-project named "Simple-Templater" to assist developers in customizing project-specific code generation. Rango draws additional strength from "Pupu," a framework agnostic CLI (command-line interface) system which aids in managing /public directory content and functionality into modules - modules which can even include packaged javascript functionality.

Code reloading during development is made available by Shotgun, or if you are using Phusion Passenger, you can of course use tmp/always_restart.txt to restart the app at every request. If Racksh is installed, running ./init.rb -i will start it, and it falls back to Irb otherwise.

The Future

Rango has a very aggressive roadmap for December 2009, and also boasts an impressive feature timeline within the wiki. Rango offers a number of innovative departures which seem noteworthy at present. To get updates on the Rango project, follow @RangoProject on Twitter.

[ad] Find duplication, code smells, complex code and more in your Ruby code with Caliper! The metrics are free and setup takes just one click. Get started!