suprails and rg: Two Rails Application Generators
Most Rails developers are familiar with the repetitive grunt work between running the rails command and starting in on custom code: adding plugins, setting up git, initializing Capistrano, bringing in your usual custom rakefile, and so on. There are projects that provide a "Rails-plus" starter application with common stuff baked in (like Bort), but if you use one of those you're limited to what the developer thought you should add, unless you start fixing up the source code yourself.
Two new projects, suprails and rg, take a different approach to Rails application generating. They're both template-driven application generators that take a configuration file describing what you want to build and then go build it. Either one can make a new Rails application, bring in plugins, set up a git repository, run generators, and so on. The idea is that you set up your configuration once, and then just generate applications from it.
Suprails uses plain text files with a list of commands for its templates. The syntax for rg templates is more ruby-ish, with a template class containing nested tasks. Both projects are in the early days yet, but either one will already help you get rid of the repetitive work if you create many Rails applications.
November 3rd, 2008 at 4:56 am
Thanks for the mention of suprails! It's still in early development but is definitely functional.
I just wanted to mention that while the suprails configuration file looks like plain text (indeed, that is the intent), it is actually ruby code. That means you get everything that Ruby offers: variables, comments, file i/o (if you really want)... Suprails just provides a vocabulary to perform somewhat complicated things in a concise manner.
Also, I'm working on a homepage for suprails, where rails devs can share their own configuration files and home-brewed facets (ie: plugins) for suprails. I'm still working on the user-submission functionality but the basic site is here: http://suprails.org
November 4th, 2008 at 12:15 am
I love the concept, but wouldn't a shell script, Rake task, or Sake task be simple, easier, and use proven/implemented libraries?
I use a sake task to install all my plugins in new Rails apps, run generators, initialize it as a git repository, etc. It works great, uses Ruby syntax, and doesn't look much different from the configuration files mentioned at suprails and rg.
Or is there an added benefit of these projects that I'm missing?
Also, I'd like to see it pronounced "super ales!"
November 4th, 2008 at 2:46 pm
It's good to hear your input, Geoffrey. I guess the biggest reason to use suprails is the as-yet-underdeveloped website that goes along with it. With suprails, you have a very concise and easy-to-grok configuration file that runs inside ruby. With that in mind, a website that aggregates and possibly ranks a multitude of such config files would be of great use to someone like me... who is fairly new to the rails scene and is completely unfamiliar with many of the available plugins (eg: I can infer what Sake is... but have personally never heard of it). With suprails.org, I can instantly see stats on what the pros are using.