Skip to content
This repository

Skeleton for new Rails based projects

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 app
Octocat-spinner-32 config
Octocat-spinner-32 db
Octocat-spinner-32 doc
Octocat-spinner-32 lib
Octocat-spinner-32 public Move assets to app directory May 26, 2011
Octocat-spinner-32 script
Octocat-spinner-32 spec
Octocat-spinner-32 vendor
Octocat-spinner-32 .env.example
Octocat-spinner-32 .gitignore
Octocat-spinner-32 .rspec
Octocat-spinner-32 .rvmrc
Octocat-spinner-32 .simplecov
Octocat-spinner-32 .travis.yml
Octocat-spinner-32 Gemfile
Octocat-spinner-32 Gemfile.lock
Octocat-spinner-32 Guardfile
Octocat-spinner-32 Procfile Use foreman September 22, 2012
Octocat-spinner-32 README.md
Octocat-spinner-32 Rakefile
Octocat-spinner-32 config.ru
README.md

Skeleton for new Rails 3 based application

Dependency Status

This simple application includes ruby/rails technology which we use in the FlatStack for new projects. Application currently based on Rails 3.2 stable branch and Ruby 1.9

Application gems:

Development gems

  • Thin as rails web server
  • Foreman for managing development stack with Procfile
  • Letter Opener for preview mail in the browser instead of sending
  • Mail Safe keep ActionMailer emails from escaping into the wild during development
  • Bullet gem to kill N+1 queries and unused eager loading
  • Rails Best Practices code metric tool
  • Brakeman static analysis security vulnerability scanner

Testing gems

  • Cucumber, Capybara, and Capybara Webkit for integration testing, including JavaScript behavior
  • Factory Girl for easier creation of test data
  • RSpec for awesome, readable isolation testing
  • Shoulda Matchers for frequently needed Rails and RSpec matchers
  • Email Spec Collection of rspec matchers and cucumber steps for testing emails

Initializes

  • 01_config.rb - shortcut for getting application config with app_config
  • mailer.rb - setup default hosts for mailer from configuration
  • time_formats.rb - setup default time formats, so you can use them like object.create_at.to_s(:us_time)
  • requires.rb - automatically requires everything in lib/ & lib/extensions

Scripts

  • script/bootstrap - setup required gems and migrate db if needed
  • script/quality - runs brakeman and rails_best_practices for the app
  • script/ci - should be used in the CI, checkout .travis.yml for example

Quick start

Clone application as new project with original repository named "rails3-base"

git clone git://github.com/fs/rails3-base.git --origin rails3-base [MY-NEW-PROJECT]

Create your new repo on GitHub and push master into it. Make sure master branch is tracking origin repo.

git remote add origin git@github.com:[MY-GITHUB-ACCOUNT]/[MY-NEW-PROJECT].git
git push -u origin master

Run bootstrap script

script/bootstrap

Make sure all test are green

bundle exec rspec spec
bundle exec cucumber features

Run app

foreman start

How to update existing project with new changes from rails3-base repo

You can fetch latest changes from rails3-base repo and merge or cherry-pick commits

git fetch rails3-base
git flow feature start rails3-base-update
git merge rails3-base/master

# fix conflicts
# commit
# test

git flow feature finish rails3-base-update

Note on Patches/Pull Requests

  • Fork the project.
  • Make your feature addition or bug fix.
  • Add tests for it. This is important so I don't break it in a future version unintentionally.
  • Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
  • Send a pull request. Bonus points for topic branches.
Something went wrong with that request. Please try again.