---
title: Fishing For Trout In Our Suspenders
teaser: The means by which we update our templates.
tags: web,open source,ruby,rails,suspenders
author: Dan Croak
published_on: 2010-12-14
---

> It's been a long time coming but I came<br />
> Been a lotta fun, lotta pain<br />
> A lotta shit changed. I used to hop trains<br />
> now I'm hoppin in planes headed to Maine<br />

Peter Gunz, probably talking about open source software:

<object width="250" height="40"
classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id="gsSong3432176958"
name="gsSong3432176958"><param name="movie"
value="http://grooveshark.com/songWidget.swf" /><param name="wmode"
value="window" /><param name="allowScriptAccess" value="always" /><param
name="flashvars"
value="hostname=grooveshark.com&songID=34321769&style=metal&p=0" /><object
type="application/x-shockwave-flash"
data="http://grooveshark.com/songWidget.swf" width="250" height="40"><param
name="wmode" value="window" /><param name="allowScriptAccess" value="always"
/><param name="flashvars"
value="hostname=grooveshark.com&songID=34321769&style=metal&p=0" /><span><a
href="http://grooveshark.com/search/song?q=Funkmaster%20Flex%20Peter%20Gunz%20%26%20Lord%20Tariq%20%2F%20Freestyle"
title="Peter Gunz &amp; Lord Tariq / Freestyle by Funkmaster Flex on
Grooveshark">Peter Gunz &amp; Lord Tariq / Freestyle by Funkmaster Flex on
Grooveshark</a></span></object></object>

## The backstory

thoughtbot created a "rails-template" Subversion repository in 2007 which we
used instead of the `rails` command. Projects got going faster using
the configuration and dependencies we'd grown to appreciate.

When we switched to git in 2008, we named the repository "Suspenders".

Since then, Rails has seen tons of improvements, we've started using jQuery,
Timecop, Formtastic, RSpec with Shoulda, and lots of other great projects. All
of that stuff would go into Suspenders.

What was cool was you'd run a command to update all the "best practices" in
Suspenders into all of your Rails apps. Something like:

    git pull suspenders master

However, some things sucked about this:

* Enjoy that giant git history stretching back over 3 years in your "fresh"
  Rails app.
* Not actually using the `rails` command so if we screwed up
  updating Rails, you might be missing some of Rails awesomeness.

## New Suspenders

The New Suspenders is a Ruby gem that installs a `suspenders` script which runs
`rails` with [a Rails
template](https://github.com/thoughtbot/suspenders/blob/master/template/suspenders.rb)
to cleanly create a Rails 3 project.

It then uses [Trout](https://github.com/thoughtbot/trout) to let you update
individual files to the latest and greatest Suspenders version.

So the workflow is now:

    gem install suspenders
    suspenders create my_sweet_app

You now have a Rails 3 app with jQuery, Paperclip, Flutie, RSpec with Shoulda
matchers, and all that jazz included and configured correctly. A fresh git repo
with a clean history wraps all that new code in its sweet embrace.

A few months go by and Suspenders gets some great updates that you want to pull
into your app:

    trout update Gemfile

## Made possible by

A big reason this is now possible is [Bundler](http://gembundler.com) and the
Rails 3 release. Suspenders is good example of what they have made possible by
cleanly separating concerns. Thanks to Yehuda, Carl, and the others responsible.

Working with those enablers, Mike Burns made the Suspenders gem and command
line interface and Joe Ferris made Trout.

## Give it a shot

It's taken years to reach the current state of what all our Rails app should
contain and how to cleanly separate concerns of "template" and "updating from
best practice repo". However, we're excited about where we're at now and hope
you will be, too.

Note that there's no official upgrade path for existing Suspenders apps.

Give it a shot!
