Suspenders
This is Philosophie's fork of Suspenders, a Rails application template originally created by thoughtbot. This repo has strayed significantly from thoughtbot's and is not intended to go back upstream.
Installation
First install the gem:
gem install philosophies-suspenders
Then run:
philosophies-suspenders projectname
This will create a Rails app in projectname using the latest version of Rails.
Gemfile
To see the latest and greatest gems, look at Suspenders' Gemfile, which will be appended to the default generated projectname/Gemfile. After the first bundle install, Suspenders will apply pessimistic version-locking on the Gemfile to only allow patch-level updates.
It includes application gems like:
- Airbrake for exception notification,
set your API key in the environment with
AIRBRAKE_API_KEY - Autoprefixer Rails for CSS vendor prefixes
- Sidekiq for background processing
- Flutie for
page_titleandbody_classview helpers - High Voltage for static pages
- Rails Assets for managing frontend dependencies,
including by default:
- jquery
- jquery-ujs
- New Relic RPM for monitoring performance
- Postgres for access to the Postgres database
- Rack Canonical Host to ensure all requests are served from the same domain
- Rack Timeout to abort requests that are taking too long
- Simple Form for form markup and style
- Title for storing titles in translations
- Unicorn to serve HTTP requests
And development gems like:
- Dotenv for loading environment variables
- Pry Rails for interactively exploring objects
- Pry ByeBug for interactively debugging behavior
- Bundler Audit for scanning the Gemfile for insecure dependencies based on published CVEs
- Spring for fast Rails actions via pre-loading
- Better Errors for better debugging via in-browser IRB consoles.
- RuboCop with Philosophie's default configuration to enforce Ruby Community Styleguide.
And testing gems like:
- Capybara and Capybara Webkit for integration testing
- Factory Girl for test data
- RSpec for unit testing
- RSpec Mocks for stubbing and spying
- Shoulda Matchers for common RSpec matchers
- Timecop for testing time
Other goodies
Suspenders also comes with:
- Stairs for new developer setup
- Rails' flashes set up and in application layout
- A few nice time formats set up for localization
Rack::Deflaterto compress responses with Gzip- A low database connection pool limit
- Safe binstubs
- t() and l() in specs without prefixing with I18n
- An automatically-created
SECRET_KEY_BASEenvironment variable in all environments - The analytics adapter Segment (and therefore config for Google Analytics, Intercom, Facebook Ads, Twitter Ads, etc.)
Heroku
By default, suspenders will:
- Creates a staging and production Heroku app
- Sets them as
stagingandproductionGit remotes - Configures staging with
RACK_ENVandRAILS_ENVenvironment variables set tostaging - Adds the Rails 12factor gem
- Adds free Mandrill add-on and configure SMTP settings to use it
- Adds free Airbrake add-on
- Adds free Papertrail add-on
You can optionally specify alternate Heroku flags:
suspenders app \
--heroku-flags "--region eu --addons newrelic,pgbackups,ssl"
See all possible Heroku flags:
heroku help create
You can bypass all Heroku functionality with the --skip-heroku option:
suspenders app --skip-heroku true
Git
By default, suspenders will:
- Initialize a new git repository
- Create
stagingandproductionbranches for deployment - Make an initial commit
You can optionally provide a remote URL via the --origin option and suspenders
will push all branches to that remote.
suspenders app --origin [email protected]:philosopie/app.git
You can bypass all git functionality with the --skip-git option:
suspenders app --skip-git true
GitHub
You can optionally create a GitHub repository for the suspended Rails app. It requires that you have Hub on your system:
curl http://hub.github.com/standalone -sLo ~/bin/hub && chmod +x ~/bin/hub
suspenders app --github organization/project
This has the same effect as running:
hub create organization/project
Spring
Suspenders uses spring by default.
It makes Rails applications load faster, but it might introduce confusing issues
around stale code not being refreshed.
If you think your application is running old code, run spring stop.
And if you'd rather not use spring, add DISABLE_SPRING=1 to your login file.
Dependencies
Suspenders requires the latest version of Ruby.
Some gems included in Suspenders have native extensions. You should have GCC installed on your machine before generating an app with Suspenders.
Use OS X GCC Installer for Snow Leopard (OS X 10.6).
Use Command Line Tools for XCode for Lion (OS X 10.7) or Mountain Lion (OS X 10.8).
We use Capybara Webkit for full-stack JavaScript integration testing. It requires QT. Instructions for installing QT are here.
PostgreSQL needs to be installed and running for the db:create rake task.
License
Suspenders is Copyright © 2008-2015 thoughtbot. It is free software, and may be redistributed under the terms specified in the LICENSE file.