On our projects we tend to use the same gems and configurations, this template is created to help us set up new projects faster.
- Have Ruby installed. Preferabily
2.1.3
, but works with2.0.0
also. - Have Rails installed. This template was created for and tested with version
4.1.6
.
Assuming that you have Ruby and Rails installed, you'll need to checkout the repo:
git clone git@github.com:cookieshq/cookieshq-rails-template.git
And then run the rails app generator passing the template:
rails new app_name -m cookieshq-rails-template/template.rb
It will ask you if you want to install certain gems and install them for you, along with other ones. In the end, it will ask you if you want your database to be created and migrated.
- Fix the first failing test that is created if you choose to create your database. It's basically about adding a root on your
routes.rb
. - Init your git repo. Until we figure out how to perform actions after the binstub call is performed, we don't want to init a repo and do a first commit, then leave you with a dirty status repo. Hopefully we'll be able to fix it when Rails 4.2 is out. See this for details.
Does not include dependencies of the gems listed!
- pg to use PostgreSQL with Active Record
- devise - optional
- simple_form
- haml-rails
- bootstrap-sass
- airbrake - optional
- active_admin - optional (available if you choose to install Devise)
- paperclip - optional
- roadie 2.4.3
On the production group:
- rails_12factor - optional
On the development group:
- capistrano (if you won't use Heroku)
- capistrano-rvm (if you won't use Heroku)
- capistrano-bundler (if you won't use Heroku)
- mailcatcher - not required
- html2haml - not required (needed to convert the devise views)
- guard-livereload
- brakeman
On the test and development groups:
- factory_girl_rails
- faker
- rspec
- rspec-rails
- guard-rspec - optional
- dotenv-rails - optional
On the test group:
- capybara
- capybara-email
- capybara-webkit
- database_cleaner
- launchy
- email_spec
- timecop
- shoulda-matchers
- formulaic
- webmock
- vcr - optional
- Sets your current ruby at the top of your
Gemfile
. - Warns you if you are using an outdated version of Ruby.
- Generates a
.gitignore
file with some common files and folders that we add. - Puts in a default skeleton for JS code organization, as per told in this post
- Puts in an email template and style as per told in this post
- Creates a stylesheet skeleton that is SMAC compliant.
- Edits
application.css(.scss)
andapplication.js
to usebootstrap
. - Puts in an
layouts/application.html.erb
equivalent written in HAML with some nice additions (viewport, etc) - Puts in the
database.yml
file adapted to PostgreSQL. - Creates your
development
andtest
databases (optional) - Edits
application.rb
to add rspec and action mailer config. - Edits
development.rb
to add action mailer config. - Does a basic configuration of RSpec.
- Creates a test and runs it (it will fail) to get your TDD/BDD on ;)
- If you won't use Heroku, capifies the project and uncomments the bundler, rvm, assets and migrations lines in
Capfile
. - If you choose to, it will create a tmuxinator configuration file on the root of the project, add it to the gitignore and link it on the
~/tmuxinator/
folder. Keep in mind that it wont install the tmuxinator gem, nor tmux, for you.
- Create a version that can be run from the raw link on github (i.e.: embedding all files on the template).
- Separate long strings into auxiliary methods, for the sake of code readability.