mkdir rails-nursery && cd rails-nursery
rbenv install 1.9.3-p125
rbenv local 1.9.3-p125
gem install bundler --pre
bundle init
echo 'gem "rails", "3.2.1" # or whatever' >> Gemfile
bundle --path=vendor --binstubs
/path/to/rails-nursery/bin/rails new <app name> -T -skip-bundle -m http://github.com/julian7/mws-templates/raw/master/template.rb
cd <app name>
rbenv local 1.9.3-p125
rwm-template comes in a gem as well, for more rails generators:
- mws:layout: generates a standard layout we build on.
- mws:vlad: generates necessary files for deployment.
- mws:auth: generates basic authentication / authorization template with proper specs.
- mws:scaffold: our standard crud scaffold (to be exported).
Our deployment scheme uses vlad and vlad-git. However, we use rake tasks and rails generators for post-deployment. This rake task (deploy:after_update) does standard stuff like copying configuration files from samples, generates god configurations, clears stylesheet and javascript caches, notifies Hoptoad and New Relic about the deployment. It also restarts required services using god.
We use the standard vlad (== capistrano) format, with some extra:
/path/to/app/dir <--- app dir
.../.rvmrc <--- we set rvm here, and we don't have to worry about rvmrc trust
.../current <--- points to the current release
.../releases <--- contains timestamped directories for the last 5 release
.../scm <--- used by vlad-git
.../shared <--- shared files for ...
.../bundle <--- ... bundler
.../log <--- ... logs
.../pids <--- ... process ID's
.../system <--- ... symlinked to public/system
.../config <--- ... contains files to be symlinked to config dir
- Version control: git
- Ruby engine: RVM, Ruby 1.9.2
- Template engine: Slim, Sass
- Form generator: Formtastic
- Javascript: jQuery, Unobtrusive Javascript for jquery, jquery-rails
- Application server: Unicorn / Passenger
- Watchdog: God
- Deployment: Vlad
- Unit test: RSpec and Shoulda
- Behavior test: Cucumber
- Web browser emulation: Webrat / Capybara
- Fixtures: Factory Girl
- Authentication: Devise
- Authorization: CanCan
For more settings, visit html5boilerplate.com.