Skip to the content.

Main > Technical Guidelines and Style

Ruby

The Rubo config repo is the authoritative source of Ruby style. This exists to cover cases not easily handled by Rubocop. There are likely other rules that are handled by Rubocop, but they are here for vestigial reasons, e.g. we haven’t removed the extraneous rules from this file after we pivoted to using the config repo/gem.

Table of Contents

Source Code Layout

Syntax

  # bad
  if some_really_long_condition
    && another_really_really_long_condition
    do_something
  end

  # good
  if some_really_long_condition &&
    another_really_really_long_condition
    do_something
  end

Naming

Comments

Classes & Modules

Exceptions

Collections

Strings

Regular Expressions

Percent Literals

Metaprogramming

Misc

Notes

Forked from https://github.com/bbatsov/ruby-style-guide/blob/master/README.md

Rails