Hidden Gems: Suspenders
Have you seen our suspenders? It is a Rails app generator that includes a set of Ruby gems and common code that we use on every project.
gem install suspenders
This will install gems with C code, which means you need your OS set up for
that. On Debian you need
build-essential; on OS X you can use
the laptop script.
Suspenders will also install
capybara-webkit by default. Read
for setting up your OS for it, or use the
--webkit false option with the
Create a Rails app
This makes a
demo app. See the
difference between it and a bare
The gems are a mix of production libraries like
newrelic, development libraries like
foreman, and testing libraries like
timecop. The full list often changes, so
for the exact list.
We selected these gems because we use them on most apps, they have tests, and they are maintained. Some of them are ours but most are from others in the community.
Suspenders includes a
Postgres, and more:
- An email address validator so you can do
validates :login, email: true
- A list of HTTP and SMTP exceptions that we have gathered through trial and error.
Even better Suspenders
Create Heroku staging and production apps with the
suspenders demo --heroku true
Create a Github project with the
suspenders demo --github organization/project
Use a different authentication library or no auth at all with the
suspenders demo --clearance false
Opt out of the capybara-webkit dependencies with the
suspenders demo --webkit false
Or, combine options:
suspenders demo --heroku true --github organization/project --webkit false
That was easy
Suspenders should make your life easier. Reduce the tedious decisions, add the one-liners you wish you had, and set up the infrastructure common to every codebase.
Use suspenders for your next Rails app!