Skip to content
This repository has been archived by the owner on Oct 22, 2021. It is now read-only.

Latest commit

 

History

History
65 lines (51 loc) · 2.15 KB

ruby.md

File metadata and controls

65 lines (51 loc) · 2.15 KB

Ruby

Summary

  1. Use Bundler and organize your Gemfiles.
  2. Use the Ruby Style Guide and validate style.

Managing Dependencies

Use bundler. Check in your Gemfile to source control.

Gemfile Organization

When organizing your Gemfile, do the following:

  1. Provide a version for all gems. Prefer ~> to >=.

  2. Begin with gems for all groups. Provide a comment explaining the purpose of each gem.

  3. If using JRuby, follow with MRI-platform and then JRuby platform-specific gems.

  4. Follow with development only gems

    group :development do
      gem 'rubocop', '~>0.10.0'
    end
  5. Follow with a combined development/test group. Be sure all gems need to be in both groups.

    group :development, :test do
    end
    • This group is usually for dependencies that you would require to run developmental commands as well as the test suite, but which are not needed for production. Things like guard or gems which have generators.
  6. Follow with test group. These are gems that would only be used in a test environment.

    • This group should be able to be excluded and developmental commands can run.

Coveralls and CircleCI

  1. To integrate with Coveralls: -Add the Coveralls gem and the simplecov gem to your gemfile -Bundle install -Add the badge to your readme file (Badges can be found in readme.md files in osulp repos) -Add require 'coveralls' and Coveralls.wear! to spechelper or railshelper -Commit Changes -Add Coveralls token generated by logging in and adding the repo to Coveralls, to CircleCI

  2. To integrate with CircleCI: -First login to CircleCI using github authentication -Go to the Org settings and find the repo you want to add. -Click project settings -Click follow -Create a circle.yml file in the root of your project -machine: ruby: version: -Add the badge to your readme file Style