Suspenders

Posted by Dan Croak

Oct 21

Introducing Suspenders, the thoughtbot Rails template.

Install

To create a new project, checkout the github repository and run:


./script/create_project projectname

This will create a project in ../projectname. You should then follow the instructions on Github to upload that project there. This script creates an entirely new git repository, and is not meant to be used against an existing repo.

Changes to the template can be easily pulled it into your project via:


rake git:pull:suspenders

This is funny, because you’re pulling your suspenders.

About

Suspenders was created for use at thoughtbot as a baseline application setup, with reasonable default plugins that the majority (if not all) of our applications used, as well as best-practice configuration options.

Thanks to various Boston.rb people and rails rumble people for attempting to use suspenders this past weekend and giving it it’s first non-thoughtbot-internal usage.

Suspenders currently includes Rails 2.1.1

vendor/gems

vendor/plugins

config/initializers

Rake Tasks

Rake tasks are contained in the limerick_rake gem.

Testing

The basic test setup uses Test::Unit, Shoulda, factory_girl, and mocha, and includes some standard “shoulda macros” that we’ve used on various projects.

Factory Girl is a fixture replacement library, following the factory pattern. Place your factories in test/factories.rb. The fixture directory has been removed, as fixtures are not used.

Shoulda is a pragmatic testing framework for TDD and BDD built on top of Test::Unit. A number of additional testing macros are provided in test/shoulda_macros:

Deployment

Deployment is done using capistrano, and deploys to a mongrel cluster, running under Apache.

Rake tasks are provided for managing git branches which the different environments pull from for deploy.

To push the git master to git staging branch run:

rake git:push:staging
To push the git staging branch to production branch run:

rake git:push:production
Setup your deployment environment by running:

cap ENVIRONMENT deploy:setup

You’ll be prompted for the environment’s database password

Deploy to the desired environment by running:

cap ENVIRONMENT deploy
The default environment for deploy is staging, to deploy to staging, just run:

cap deploy

Mascot

The official Suspenders mascot is Suspenders Boy


Comments on this post

carlisia

Oct 21

carlisia said,

Thank you guys for providing this. It was very useful for my railsrumble project. I wish it will accept ’-’ in the project name the future. :)

Nathan

Oct 21

Nathan said,

Good stuff, replaces my script that just installs all your plugins anyway :)

Jim Neath

Oct 22

Jim Neath said,

Good work chaps.


Sorry, comments are closed for this article.

© 2000 - 2009 by thoughtbot, inc.
written by a bushel of tiny robots