Rails Templater - Agnostic at last | Adventures In Coding

Rails Templater - Agnostic at last

  • Kevin Faustino
Fotolia_9217084_xs

What Rails Templater used to be

Rails Templater was originally a Ruby on Rails 3 template inspired by Mike Gunderloy’s BigOldRailsTemplate project. It was a very opinionated template, as it only created Rails applications using Mongoid, RSpec, jQuery, Haml, and FactoryGirl. This resulted in a large amount of forks(34 to date) by fans of the project who wanted to generate applications their way.

What is Rails Templater today?

The initial intentions of the template framework were small. I wanted something to generate applications the way I wanted, without all the configuration changes required after the initial generation. For example, if I wanted to use Mongoid with RSpec instead of ActiveRecord, I would have to update the RSpec configuration to take care of dropping MongoDB collections. Rails Templater takes care of all these configuration details in post bundler strategies, which take into account all the recipes chosen by the user.

Rails Templater is no longer just a template, but a gem providing a simple interface for generating applications. Also, the project is now completely agnostic, thus allowing you to select what you want in your application. Some examples of choices are deciding which ORM, JavaScript framework, testing framework, and fixture replacement you want to use.

Usage

You can give Rails Templater a try right now with the following:

$ gem install rails_templater

Once installed, generate a new Ruby on Rails 3 application using templater

$ templater myapp

Rails Templater will ask you questions, such as which testing framework you would like to use. Once all questions are answered, a new Rails application will be generated just the way you like it.

Be sure to watch the screencast below to see an example of generating an app.

Contributing new recipes

If you would like to add more recipes to the project, fork it on GitHub and send me a pull request. The current road map is to add DataMapper support and more fixture replacements, such as Fabrication.


Comments

blog comments powered by Disqus