Firestarter
Firestarter is the Rails application generator used at Subvisual.
Table of Contents
- Installation
- Gemfile
- Other goodies
- Git
- Dependencies
- Issues
- Contributing
- Credits
- License
Installation
First install the Firestarter gem:
gem install gb-firestarter
Then run:
firestarter <project_name>
This will create a new Rails application in ./<project_name>
. By default,
Firestarter will use Rails 4.2.0 to generate new applications. You can override
this by setting the RAILS_VERSION
environment variable when running the
generator:
RAILS_VERSION=4.1.16 firestarter <project_name>
By default this script creates a new git repository. See below if you want to use it against an existing one.
Gemfile
To see the latest and greatest gems, look at Firestarter's template
Gemfile, which will be appended to the default
generated <project_name>/Gemfile
.
It includes application gems like:
- dotenv for loading environment variables from a file;
- jQuery Rails for jQuery;
- Postgres for access to the Postgres database;
- Pry Rails for performing console operations;
- Puma to serve HTTP requests.
And gems only for staging and production like:
- Rack Timeout to abort requests that are taking too long;
- Rails 12 Factor to make running Rails applications easier on Heroku.
And development gems like:
- Better Errors for debugging.
And testing gems like:
- Capybara and Capybara Webkit for integration testing;
- Factory Girl for generating test data (and seeds);
- RSpec for unit testing;
- Timecop for testing time.
Other goodies
Firestarter also includes:
- The
./bin/setup
convention for new developer setup; - Rails' flashes set up and in application layout;
- A few nice time formats set up for localization;
-
Rack::Deflater
to compress responses with Gzip; - Fast-failing factories;
- A low database connection pool limit;
- Safe binstubs;
-
t()
andl()
in specs without prefixing withI18n
.
Firestarter fixes several of Rails' insecure defaults:
- Firestarter uses Puma instead of WEBrick, allowing less verbose Server headers;
- Firestarter is configured to pull your application secret key base from an environment variable, which means you won't need to risk placing it in version control.
Git
This will initialize a new git repository for your Rails application. You can
bypass this with the --skip-git
option:
firestarter <project_name> --skip-git true
Dependencies
Firestarter requires Ruby 2.1.0 or greater. The generated project will be set to use Ruby 2.3.1 by default.
Some gems included in Firestarter have native extensions. You should have GCC installed on your machine before generating an application with Firestarter.
Use the OS X GCC Installer for Snow Leopard (OS X 10.6).
Use Command Line Tools for XCode for Lion (OS X 10.7) or posterior.
We use Capybara Webkit for full-stack Javascript integration testing. It requires Qt. Instructions for installing Qt are here. WARNING: Qt 5.6 dropped the Qt WebKit module, in favor of the new Qt WebEngine module. As such, the installed version of Qt must be <= 5.5.
PostgreSQL needs to be installed and running for the db:create
rake task. For
OS X you can install it through Homebrew or by installing the
Postgres application.
Issues
If you have any problems with this project, please create a Github Issue.
Contributing
Please see CONTRIBUTING for details.
Credits
Firestarter is maintained by Subvisual.
Firestarter is largely inspired by thoughtbot's suspenders, so thank you thoughtbot.
License
Firestarter is Copyright © 2014-2016 GB-Software As A Service, Lda. It is free software and may be redistributed under the terms specified in the LICENSE file.