.pryrc
include
is used at the top level. Use inside class
or module
. Open
Open
include Rails::ConsoleMethods
- Read upRead up
- Exclude checks
This cop checks that include
, extend
and prepend
statements appear
inside classes and modules, not at the top level, so as to not affect
the behavior of Object
.
Example:
# bad
include M
class C
end
# bad
extend M
class C
end
# bad
prepend M
class C
end
# good
class C
include M
end
# good
class C
extend M
end
# good
class C
prepend M
end
.pryrc should define a class or module called ``. Open
Open
# frozen_string_literal: true
- Read upRead up
- Exclude checks
This cop makes sure that Ruby source files have snake_case names. Ruby scripts (i.e. source files with a shebang in the first line) are ignored.
The cop also ignores .gemspec
files, because Bundler
recommends using dashes to separate namespaces in nested gems
(i.e. bundler-console
becomes Bundler::Console
). As such, the
gemspec is supposed to be named bundler-console.gemspec
.
Example:
# bad
lib/layoutManager.rb
anything/usingCamelCase
# good
lib/layout_manager.rb
anything/using_snake_case.rake