Skip to content

sergii/rails-base

 
 

Repository files navigation

Skeleton for new Rails 4 based application

Code Climate

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

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
  • Bullet gem to kill N+1 queries and unused eager loading
  • Rails Best Practices code metric tool
  • Brakeman static analysis security vulnerability scanner
  • Pry Rails is an alternative to the standard IRB shell for Ruby
  • Bundler Audit Patch-level verification for Gems

Testing gems

  • Turnip, 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

  • bin/bootstrap - setup required gems and migrate db if needed
  • bin/quality - runs rubocop, brakeman, rails_best_practices and bundle-audit for the app
  • bin/ci - should be used in the CI or locally
  • bin/server - to run server locally

Quick start

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

git clone git:https://github.com/fs/rails-base.git --origin rails-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 [email protected]:[MY-GITHUB-ACCOUNT]/[MY-NEW-PROJECT].git
git push -u origin master

Run bootstrap script

bin/bootstrap

Make sure all test are green

bin/ci

Run app

bin/server

Do not forget to update this file!

mv doc/README_TEMPLATE.md README.md
# update README.md
git commit -am "Update README.md"

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

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

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

# fix conflicts
# commit
# test

git flow feature finish rails-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.

Note on ie8 support

Rails Base fixes ie8 problems with:

  • lack of support for rem units in CSS
  • lack of media query support
  • lack of Html5 and Css3 support

In order to get rid of ie8 support please remove the following:

  • vendor/assets/javascripts/ie8 folder

  • views/layouts/application lines commented with /[if lt IE 9]

      = javascript_include_tag "ie8/nwmatcher-1.2.5-min.js", "ie8/selectivizr-1.0.3b.js", "ie8/respond.min.js"
      = javascript_include_tag "ie8/rem"
    

Note on how to override Zurb Foundation css properties

Do your overrides in the app/assets/stylesheets/foundation_and_overrides.scss

Credits

Rails Base is maintained by Timur Vafin. It was written by Flatstack with the help of our contributors.

Flatstack

About

Skeleton for new Rails based projects

Resources

Stars

Watchers

Forks

Packages

No packages published