What’s New in Rails Apps Composer

Just to recap, the Rails Apps Composer gem installs a command line tool to assemble a Rails application from a collection of “recipes.” It’s useful for creating and maintaining starter apps. I use it to maintain the RailsApps project example applications.

Rails Apps Composer

Progress Report

Six weeks ago, I announced an ambitious roadmap for Rails Apps Composer version 2.0.

I wanted to fix version 1.0’s shortcomings. It was cumbersome and difficult to maintain. I had a short list of ambitious improvements. I spent two weeks in coding, then a week writing detailed documentation (the Guide to the Rails Apps Composer Gem). After three weeks of concerted effort, I released Rails Apps Composer version 2.0, meeting my goals for improvement.

Now, three weeks after releasing version 2.0, with a rapid succession of releases, we’re at Rails Apps Composer version 2.2. I’ve gotten excellent code contributions from some capable and enthusiastic developers: notably Jim Riordan, tomykaira, Tom Scott, Michaël Witrant, and Vitaly Kushner. For me, it’s a great feeling to clean up a project and bring it closer to my vision. It’s even better when strangers see the value in the project and jump in to add features that exceed my ambitions. Thanks!

Of course, I’m particularly obligated to Michael Bleigh because Rails Apps Composer would not be possible without his creation of the original RailsWizard gem.

What’s New

Here’s a summary of the top features you’ll find in Rails Apps Composer version 2.2.

A “quiz” queries the user for preferences, including:

  • webserver (WEBrick, Thin, Unicorn, Puma)
  • database (SQLite, PostgreSQL, MySQL, MongoDB)
  • template engine (ERB, Haml, Slim)
  • testing (Test::Unit, RSpec, Capybara, Cucumber)
  • fixture replacement (Factory Girl, Machinist)
  • front-end framework (Twitter Bootstrap, Zurb Foundation, Skeleton)
  • email (Gmail, SMTP, SendGrid, Mandrill)
  • authentication (Devise, OmniAuth)
  • authorization (CanCan with Rolify)

The program will also:

  • create a GitHub repo
  • create a project-specific rvm gemset and .rvmrc
  • set a robots.txt file to ban spiders
  • add ‘therubyracer’ JavaScript runtime for Linux users

Gems can be added at a prompt without writing custom recipes.

To skip the quiz, the user can create a defaults file specifying recipes, gems, and preferences.

A user can write local recipes that can be added to the mix without forking the gem.

A new ‘copy_from_repo’ method adds powerful downloading of files to any recipe.

Downloading of files from the example app repos reduces the complexity of recipes.

The ‘copy_from_repo’ method converts ERB files to Haml or Slim at the user’s option.

A ‘rails apps’ recipe generates any of the RailsApps project example applications.

Lastly, a diagnostics module creates a README file that displays a list of recipes, gems, and preferences selected to create an application. The diagnostics make it easier to debug integration issues and identify which combinations of recipes, gems, and preferences work well together.

Rails Apps Composer version 2.2 is very powerful. Take a look at the Guide to the Rails Apps Composer Gem to learn about all its features.

The gem brings us closer to the possibility of automatic assembly of real world Rails applications. We can now build starter apps (and maintain them with the collaboration of an open source community) that are much more powerful than the starter apps we had a few years ago. Even though Rails itself has gotten more complex and powerful.

With the new Rails Apps Composer, I’ve been able to build the Rails Composer tool which can generate any of the five RailsApps project example applications from a single command. Five apps is just a start; I’ve got more high-quality, complex example applications in the works.

The Future

There are a few recipes I’d like to add in the near future. Top of the list is a deploy recipe that would offer the option of immediate deployment to Heroku, CloudFoundry, or EngineYard.

I’m also looking forward to new surprises coming from the developers who use the Rails Apps Composer gem. Thank you to all for making this a successful open source project!

Got a suggestion for a recipe or a feature you’d like to see in Rails Apps Composer? Leave a comment. Are we making it easier to build starter apps?