8000 GitHub - tleish/rubocop-norb: A RuboCop extension focused on enforcing NORB (None of Rails Business) rules. An opinionated approach to separating business logic from Rails framework code.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

A RuboCop extension focused on enforcing NORB (None of Rails Business) rules. An opinionated approach to separating business logic from Rails framework code.

License

Notifications You must be signed in to change notification settings

tleish/rubocop-norb

Repository files navigation

RuboCop Norb

A RuboCop extension focused on enforcing NORB (None of Rails Business). An opinionated approach to separating business logic from Rails framework code.

Installation

Just install the rubocop-norb gem

gem install rubocop-norb

or if you use bundler put this in your Gemfile

gem 'rubocop-norb'

Usage

You need to tell RuboCop to load the Norb extension. There are three ways to do this:

RuboCop configuration file

Put this into your .rubocop.yml.

require: rubocop-norb

Alternatively, use the following array notation when specifying multiple extensions.

require:
  - rubocop-other-extension
  - rubocop-norb

Now you can run rubocop and it will automatically load the RuboCop Norb cops together with the standard cops.

Command line

rubocop --require rubocop-norb

Rake task

RuboCop::RakeTask.new do |task|
  task.requires << 'rubocop-norb'
end

The Cops

All cops are located under lib/rubocop/cop/norb, and contain examples/documentation.

In your .rubocop.yml, you may treat the Norb cops just like any other cop. For example:

Norb/BinaryOperation:
  Include:
    - app/controllers/**/*.rb

Contributing

Checkout the contribution guidelines.

License

rubocop-norb is MIT licensed. See the accompanying file for the full text.

Credit

Credit goes to Bozhidar Batsov and other RuboCop contributors for the great Rubocop framework of this gem.

About

A RuboCop extension focused on enforcing NORB (None of Rails Business) rules. An opinionated approach to separating business logic from Rails framework code.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0