meta-tags 2.9.0 → 2.10.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: b90c0d13b837e1d5736014dd1907c589db8515da
4
- data.tar.gz: 09064672e14acc5a9cbec0aae1fbc31e5e43d9a2
2
+ SHA256:
3
+ metadata.gz: c62e4368df6664d294c8a771a4fda243ef66408b017689742f5ceb5434963b6e
4
+ data.tar.gz: cfeb9bb181302099866df2d52cf46a9f8b413a0989e66408c987a648564c20a0
5
5
  SHA512:
6
- metadata.gz: e49fbc418b77ab01cc64d5ad7bd63aae28fda4fba04cae0c45cb0dfc131bc80c05497abd1779ddc64fbb11b83e8449c82a136ab49230c90c99e6ea6d505366a6
7
- data.tar.gz: 5520dff10b082e2c5c908a30f61507d096022e4c614e731e2af69b4d2ee536ceae0e14182969d4aaa01e7f007d6123cd97110ea14079fb6dbfa07979c306766a
6
+ metadata.gz: 9aa85cb08c594b6dde4e10e4d304d6336574f9dae2ee8556f129be282ef8bc41fe59ea9c307998eb3e94d3f96f4d5c70d3f779a849ef6a4b7a6199512c269272
7
+ data.tar.gz: 6e256b83bdf38ccad564ff572d970912d2feb29eac3097633691e2903b3873fd6841bbd1dff3f7b7c98dbc7fc781019fe5217ad7ab1e27d42a58b8591b4df7eb
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -1,3 +1,8 @@
1
+ ## 2.10.0 (June 8, 2018) [☰](https://github.com/kpumuk/meta-tags/compare/v2.9.0...v2.10.0)
2
+
3
+ Features:
4
+ - Allow `MetaTagsCollection#update` to receive an object ([169](https://github.com/kpumuk/meta-tags/pull/169))
5
+
1
6
  ## 2.9.0 (March 29, 2018) [☰](https://github.com/kpumuk/meta-tags/compare/v2.8.0...v2.9.0)
2
7
 
3
8
  Features:
data/Gemfile CHANGED
@@ -7,4 +7,5 @@ gem 'actionpack', "~> #{ENV['RAILS_VERSION']}" if ENV['RAILS_VERSION']
7
7
 
8
8
  group :test do
9
9
  gem 'simplecov'
10
+ gem 'rspec_junit_formatter'
10
11
  end
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # MetaTags: a gem to make your Rails application SEO-friendly
2
2
 
3
- [![Travis-CI build status](https://secure.travis-ci.org/kpumuk/meta-tags.svg)](http://travis-ci.org/kpumuk/meta-tags)
3
+ [![CircleCI](https://circleci.com/gh/kpumuk/meta-tags.svg?style=shield)](https://circleci.com/gh/kpumuk/meta-tags)
4
4
  [![Gem Version](https://badge.fury.io/rb/meta-tags.svg)](https://badge.fury.io/rb/meta-tags)
5
5
  [![Code Climate](https://codeclimate.com/github/kpumuk/meta-tags/badges/gpa.svg)](https://codeclimate.com/github/kpumuk/meta-tags)
6
6
  [![Test Coverage](https://codeclimate.com/github/kpumuk/meta-tags/badges/coverage.svg)](https://codeclimate.com/github/kpumuk/meta-tags/coverage)
@@ -119,6 +119,22 @@ Also there is `set_meta_tags` method exists:
119
119
  keywords: 'Site, Login, Members' %>
120
120
  ```
121
121
 
122
+ You can pass an object that implements `#to_meta_tags` method and returns a Hash:
123
+
124
+ ```ruby
125
+ class Document < ApplicationRecord
126
+ def to_meta_tags
127
+ {
128
+ title: title,
129
+ description: summary,
130
+ }
131
+ end
132
+ end
133
+
134
+ @document = Document.first
135
+ set_meta_tags @document
136
+ ```
137
+
122
138
  The `title` method returns title itself, so you can use it to show the title
123
139
  somewhere on the page:
124
140
 
@@ -136,28 +152,30 @@ If you want to set the title and display another text, use this:
136
152
 
137
153
  Use these options to customize the title format:
138
154
 
139
- * `:site` site title;
140
- * `:title` page title;
141
- * `:description` page description;
142
- * `:keywords` page keywords;
143
- * `:charset` page character set;
144
- * `:prefix` text between site name and separator;
145
- * `:separator` text used to separate website name from page title;
146
- * `:suffix` text between separator and page title;
147
- * `:lowercase` when true, the page name will be lowercase;
148
- * `:reverse` when true, the page and site names will be reversed;
149
- * `:noindex` — add noindex meta tag; when true, 'robots' will be used, otherwise the string will be used;
150
- * `:index` — add index meta tag; when true, 'robots' will be used, otherwise the string will be used;
151
- * `:nofollow` add nofollow meta tag; when true, 'robots' will be used, otherwise the string will be used;
152
- * `:follow` add follow meta tag; when true, 'robots' will be used, otherwise the string will be used;
153
- * `:noarchive` add noarchive meta tag; when true, 'robots' will be used, otherwise the string will be used;
154
- * `:canonical` add canonical link tag;
155
- * `:prev` add prev link tag;
156
- * `:next` add next link tag;
157
- * `:image_src` add image_src link tag;
158
- * `:og` add Open Graph tags (Hash);
159
- * `:twitter` add Twitter tags (Hash);
160
- * `:refresh` refresh interval and optionally url to redirect to.
155
+ | Option | Description |
156
+ | -------------- | ----------- |
157
+ | `:site` | site title |
158
+ | `:title` | page title |
159
+ | `:description` | page description |
160
+ | `:keywords` | page keywords |
161
+ | `:charset` | page character set |
162
+ | `:prefix` | text between site name and separator |
163
+ | `:separator` | text used to separate website name from page title |
164
+ | `:suffix` | text between separator and page title |
165
+ | `:lowercase` | when true, the page name will be lowercase |
166
+ | `:reverse` | when true, the page and site names will be reversed |
167
+ | `:noindex` | add noindex meta tag; when true, 'robots' will be used, otherwise the string will be used |
168
+ | `:index` | add index meta tag; when true, 'robots' will be used, otherwise the string will be used |
169
+ | `:nofollow` | add nofollow meta tag; when true, 'robots' will be used, otherwise the string will be used |
170
+ | `:follow` | add follow meta tag; when true, 'robots' will be used, otherwise the string will be used |
171
+ | `:noarchive` | add noarchive meta tag; when true, 'robots' will be used, otherwise the string will be used |
172
+ | `:canonical` | add canonical link tag |
173
+ | `:prev` | add prev link tag |
174
+ | `:next` | add next link tag |
175
+ | `:image_src` | add image_src link tag |
176
+ | `:og` | add Open Graph tags (Hash) |
177
+ | `:twitter` | add Twitter tags (Hash) |
178
+ | `:refresh` | refresh interval and optionally url to redirect to |
161
179
 
162
180
  And here are a few examples to give you ideas.
163
181
 
@@ -31,10 +31,12 @@ module MetaTags
31
31
 
32
32
  # Recursively merges a Hash of meta tag attributes into current list.
33
33
  #
34
- # @param [Hash] meta_tags meta tags Hash to merge into current list.
34
+ # @param [Hash, #to_meta_tags] object Hash of meta tags (or object responding
35
+ # to #to_meta_tags and returning a hash) to merge into the current list.
35
36
  # @return [Hash] result of the merge.
36
37
  #
37
- def update(meta_tags = {})
38
+ def update(object = {})
39
+ meta_tags = object.respond_to?(:to_meta_tags) ? object.to_meta_tags : object
38
40
  @meta_tags.deep_merge! normalize_open_graph(meta_tags)
39
41
  end
40
42
 
@@ -1,4 +1,4 @@
1
1
  module MetaTags
2
2
  # Gem version.
3
- VERSION = '2.9.0'.freeze
3
+ VERSION = '2.10.0'.freeze
4
4
  end
@@ -14,7 +14,7 @@ Gem::Specification.new do |spec|
14
14
  spec.license = "MIT"
15
15
  spec.platform = Gem::Platform::RUBY
16
16
 
17
- spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
17
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(\.|(bin|test|spec|features)/)}) }
18
18
  spec.bindir = "exe"
19
19
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
20
  spec.require_paths = ["lib"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: meta-tags
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.9.0
4
+ version: 2.10.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dmytro Shteflyuk
@@ -30,7 +30,7 @@ cert_chain:
30
30
  QwaoNrsQi488Dsk54YiNQWVouzfjRqEa4uUxSyKmRfQp7MNILESAOCXM+wZIxanu
31
31
  C9c9eUxgNTnHhsR3sK0QCIMwtUI=
32
32
  -----END CERTIFICATE-----
33
- date: 2018-03-29 00:00:00.000000000 Z
33
+ date: 2018-06-08 00:00:00.000000000 Z
34
34
  dependencies:
35
35
  - !ruby/object:Gem::Dependency
36
36
  name: actionpack
@@ -101,13 +101,6 @@ executables: []
101
101
  extensions: []
102
102
  extra_rdoc_files: []
103
103
  files:
104
- - ".codeclimate.yml"
105
- - ".gitignore"
106
- - ".hound.yml"
107
- - ".rspec"
108
- - ".rubocop.yml"
109
- - ".ruby-version"
110
- - ".travis.yml"
111
104
  - CHANGELOG.md
112
105
  - CODE_OF_CONDUCT.md
113
106
  - CONTRIBUTING.md
@@ -115,8 +108,6 @@ files:
115
108
  - MIT-LICENSE
116
109
  - README.md
117
110
  - Rakefile
118
- - bin/console
119
- - bin/setup
120
111
  - certs/kpumuk.pem
121
112
  - lib/generators/meta_tags/install_generator.rb
122
113
  - lib/generators/meta_tags/templates/config/initializers/meta_tags.rb
@@ -152,7 +143,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
152
143
  version: '0'
153
144
  requirements: []
154
145
  rubyforge_project:
155
- rubygems_version: 2.6.13
146
+ rubygems_version: 2.7.6
156
147
  signing_key:
157
148
  specification_version: 4
158
149
  summary: Collection of SEO helpers for Ruby on Rails.
metadata.gz.sig CHANGED
Binary file
@@ -1,20 +0,0 @@
1
- engines:
2
- duplication:
3
- enabled: true
4
- config:
5
- languages:
6
- - ruby
7
-
8
- fixme:
9
- enabled: true
10
-
11
- rubocop:
12
- enabled: true
13
-
14
- ratings:
15
- paths:
16
- - "**.rb"
17
-
18
- exclude_paths:
19
- - spec/**/*
20
- - certs/**/*
data/.gitignore DELETED
@@ -1,10 +0,0 @@
1
- .yardoc
2
- .DS_Store
3
- .bundle
4
- Gemfile.lock
5
- .ruby-gemset
6
- coverage
7
- doc
8
- pkg
9
- *.gem
10
- .idea
data/.hound.yml DELETED
@@ -1,2 +0,0 @@
1
- ruby:
2
- config_file: .rubocop.yml
data/.rspec DELETED
@@ -1,3 +0,0 @@
1
- --color
2
- --warnings
3
- --require spec_helper
@@ -1,1153 +0,0 @@
1
- AllCops:
2
- DisabledByDefault: true
3
- TargetRubyVersion: 2.2
4
-
5
- #################### Lint ################################
6
-
7
- Lint/AmbiguousOperator:
8
- Description: >-
9
- Checks for ambiguous operators in the first argument of a
10
- method invocation without parentheses.
11
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-as-args'
12
- Enabled: true
13
-
14
- Lint/AmbiguousRegexpLiteral:
15
- Description: >-
16
- Checks for ambiguous regexp literals in the first argument of
17
- a method invocation without parenthesis.
18
- Enabled: true
19
-
20
- Lint/AssignmentInCondition:
21
- Description: "Don't use assignment in conditions."
22
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#safe-assignment-in-condition'
23
- Enabled: true
24
-
25
- Lint/BlockAlignment:
26
- Description: 'Align block ends correctly.'
27
- Enabled: true
28
-
29
- Lint/CircularArgumentReference:
30
- Description: "Don't refer to the keyword argument in the default value."
31
- Enabled: true
32
-
33
- Lint/ConditionPosition:
34
- Description: >-
35
- Checks for condition placed in a confusing position relative to
36
- the keyword.
37
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#same-line-condition'
38
- Enabled: true
39
-
40
- Lint/Debugger:
41
- Description: 'Check for debugger calls.'
42
- Enabled: true
43
-
44
- Lint/DefEndAlignment:
45
- Description: 'Align ends corresponding to defs correctly.'
46
- Enabled: true
47
-
48
- Lint/DeprecatedClassMethods:
49
- Description: 'Check for deprecated class method calls.'
50
- Enabled: true
51
-
52
- Lint/DuplicateMethods:
53
- Description: 'Check for duplicate methods calls.'
54
- Enabled: true
55
-
56
- Lint/EachWithObjectArgument:
57
- Description: 'Check for immutable argument given to each_with_object.'
58
- Enabled: true
59
-
60
- Lint/ElseLayout:
61
- Description: 'Check for odd code arrangement in an else block.'
62
- Enabled: true
63
-
64
- Lint/EmptyEnsure:
65
- Description: 'Checks for empty ensure block.'
66
- Enabled: true
67
-
68
- Lint/EmptyInterpolation:
69
- Description: 'Checks for empty string interpolation.'
70
- Enabled: true
71
-
72
- Lint/EndAlignment:
73
- Description: 'Align ends correctly.'
74
- Enabled: true
75
-
76
- Lint/EndInMethod:
77
- Description: 'END blocks should not be placed inside method definitions.'
78
- Enabled: true
79
-
80
- Lint/EnsureReturn:
81
- Description: 'Do not use return in an ensure block.'
82
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-return-ensure'
83
- Enabled: true
84
-
85
- Security/Eval:
86
- Description: 'The use of eval represents a serious security risk.'
87
- Enabled: true
88
-
89
- Lint/FormatParameterMismatch:
90
- Description: 'The number of parameters to format/sprint must match the fields.'
91
- Enabled: true
92
-
93
- Lint/HandleExceptions:
94
- Description: "Don't suppress exception."
95
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#dont-hide-exceptions'
96
- Enabled: true
97
-
98
- Lint/LiteralAsCondition:
99
- Description: 'Checks of literals used in conditions.'
100
- Enabled: true
101
-
102
- Lint/LiteralInInterpolation:
103
- Description: 'Checks for literals used in interpolation.'
104
- Enabled: true
105
-
106
- Lint/Loop:
107
- Description: >-
108
- Use Kernel#loop with break rather than begin/end/until or
109
- begin/end/while for post-loop tests.
110
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#loop-with-break'
111
- Enabled: true
112
-
113
- Lint/NestedMethodDefinition:
114
- Description: 'Do not use nested method definitions.'
115
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-methods'
116
- Enabled: true
117
-
118
- Lint/NonLocalExitFromIterator:
119
- Description: 'Do not use return in iterator to cause non-local exit.'
120
- Enabled: true
121
-
122
- Lint/ParenthesesAsGroupedExpression:
123
- Description: >-
124
- Checks for method calls with a space before the opening
125
- parenthesis.
126
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-no-spaces'
127
- Enabled: true
128
-
129
- Lint/RequireParentheses:
130
- Description: >-
131
- Use parentheses in the method call to avoid confusion
132
- about precedence.
133
- Enabled: true
134
-
135
- Lint/RescueException:
136
- Description: 'Avoid rescuing the Exception class.'
137
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-blind-rescues'
138
- Enabled: true
139
-
140
- Lint/ShadowingOuterLocalVariable:
141
- Description: >-
142
- Do not use the same name as outer local variable
143
- for block arguments or block local variables.
144
- Enabled: true
145
-
146
- Lint/StringConversionInInterpolation:
147
- Description: 'Checks for Object#to_s usage in string interpolation.'
148
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-to-s'
149
- Enabled: true
150
-
151
- Lint/UnderscorePrefixedVariableName:
152
- Description: 'Do not use prefix `_` for a variable that is used.'
153
- Enabled: true
154
-
155
- Lint/UnneededDisable:
156
- Description: >-
157
- Checks for rubocop:disable comments that can be removed.
158
- Note: this cop is not disabled when disabling all cops.
159
- It must be explicitly disabled.
160
- Enabled: true
161
-
162
- Lint/UnusedBlockArgument:
163
- Description: 'Checks for unused block arguments.'
164
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars'
165
- Enabled: true
166
-
167
- Lint/UnusedMethodArgument:
168
- Description: 'Checks for unused method arguments.'
169
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars'
170
- Enabled: true
171
-
172
- Lint/UnreachableCode:
173
- Description: 'Unreachable code.'
174
- Enabled: true
175
-
176
- Lint/UselessAccessModifier:
177
- Description: 'Checks for useless access modifiers.'
178
- Enabled: true
179
-
180
- Lint/UselessAssignment:
181
- Description: 'Checks for useless assignment to a local variable.'
182
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscore-unused-vars'
183
- Enabled: true
184
-
185
- Lint/UselessComparison:
186
- Description: 'Checks for comparison of something with itself.'
187
- Enabled: true
188
-
189
- Lint/UselessElseWithoutRescue:
190
- Description: 'Checks for useless `else` in `begin..end` without `rescue`.'
191
- Enabled: true
192
-
193
- Lint/UselessSetterCall:
194
- Description: 'Checks for useless setter call to a local variable.'
195
- Enabled: true
196
-
197
- Lint/Void:
198
- Description: 'Possible use of operator/literal/variable in void context.'
199
- Enabled: true
200
-
201
- ###################### Metrics ####################################
202
-
203
- Metrics/AbcSize:
204
- Description: >-
205
- A calculated magnitude based on number of assignments,
206
- branches, and conditions.
207
- Reference: 'http://c2.com/cgi/wiki?AbcMetric'
208
- Enabled: true
209
- Max: 25
210
-
211
- Metrics/BlockNesting:
212
- Description: 'Avoid excessive block nesting'
213
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#three-is-the-number-thou-shalt-count'
214
- Enabled: true
215
- Max: 4
216
-
217
- Metrics/ClassLength:
218
- Description: 'Avoid classes longer than 250 lines of code.'
219
- Enabled: true
220
- Max: 250
221
-
222
- Metrics/CyclomaticComplexity:
223
- Description: >-
224
- A complexity metric that is strongly correlated to the number
225
- of test cases needed to validate a method.
226
- Enabled: true
227
-
228
- Metrics/LineLength:
229
- Description: 'Limit lines to 80 characters.'
230
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#80-character-limits'
231
- Enabled: false
232
-
233
- Metrics/MethodLength:
234
- Description: 'Avoid methods longer than 30 lines of code.'
235
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#short-methods'
236
- Enabled: true
237
- Max: 30
238
-
239
- Metrics/ModuleLength:
240
- Description: 'Avoid modules longer than 250 lines of code.'
241
- Enabled: true
242
- Max: 250
243
-
244
- Metrics/ParameterLists:
245
- Description: 'Avoid parameter lists longer than three or four parameters.'
246
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#too-many-params'
247
- Enabled: true
248
-
249
- Metrics/PerceivedComplexity:
250
- Description: >-
251
- A complexity metric geared towards measuring complexity for a
252
- human reader.
253
- Enabled: false
254
-
255
- ##################### Performance #############################
256
-
257
- Performance/Count:
258
- Description: >-
259
- Use `count` instead of `select...size`, `reject...size`,
260
- `select...count`, `reject...count`, `select...length`,
261
- and `reject...length`.
262
- Enabled: true
263
-
264
- Performance/Detect:
265
- Description: >-
266
- Use `detect` instead of `select.first`, `find_all.first`,
267
- `select.last`, and `find_all.last`.
268
- Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerabledetect-vs-enumerableselectfirst-code'
269
- Enabled: true
270
-
271
- Performance/FlatMap:
272
- Description: >-
273
- Use `Enumerable#flat_map`
274
- instead of `Enumerable#map...Array#flatten(1)`
275
- or `Enumberable#collect..Array#flatten(1)`
276
- Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerablemaparrayflatten-vs-enumerableflat_map-code'
277
- Enabled: true
278
- EnabledForFlattenWithoutParams: false
279
- # If enabled, this cop will warn about usages of
280
- # `flatten` being called without any parameters.
281
- # This can be dangerous since `flat_map` will only flatten 1 level, and
282
- # `flatten` without any parameters can flatten multiple levels.
283
-
284
- Performance/ReverseEach:
285
- Description: 'Use `reverse_each` instead of `reverse.each`.'
286
- Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerablereverseeach-vs-enumerablereverse_each-code'
287
- Enabled: true
288
-
289
- Performance/Sample:
290
- Description: >-
291
- Use `sample` instead of `shuffle.first`,
292
- `shuffle.last`, and `shuffle[Fixnum]`.
293
- Reference: 'https://github.com/JuanitoFatas/fast-ruby#arrayshufflefirst-vs-arraysample-code'
294
- Enabled: true
295
-
296
- Performance/Size:
297
- Description: >-
298
- Use `size` instead of `count` for counting
299
- the number of elements in `Array` and `Hash`.
300
- Reference: 'https://github.com/JuanitoFatas/fast-ruby#arraycount-vs-arraysize-code'
301
- Enabled: true
302
-
303
- Performance/StringReplacement:
304
- Description: >-
305
- Use `tr` instead of `gsub` when you are replacing the same
306
- number of characters. Use `delete` instead of `gsub` when
307
- you are deleting characters.
308
- Reference: 'https://github.com/JuanitoFatas/fast-ruby#stringgsub-vs-stringtr-code'
309
- Enabled: true
310
-
311
- ##################### Rails ##################################
312
-
313
- Rails/ActionFilter:
314
- Description: 'Enforces consistent use of action filter methods.'
315
- Enabled: false
316
-
317
- Rails/Date:
318
- Description: >-
319
- Checks the correct usage of date aware methods,
320
- such as Date.today, Date.current etc.
321
- Enabled: false
322
-
323
- Rails/Delegate:
324
- Description: 'Prefer delegate method for delegations.'
325
- Enabled: false
326
-
327
- Rails/FindBy:
328
- Description: 'Prefer find_by over where.first.'
329
- Enabled: false
330
-
331
- Rails/FindEach:
332
- Description: 'Prefer all.find_each over all.find.'
333
- Enabled: true
334
-
335
- Rails/HasAndBelongsToMany:
336
- Description: 'Prefer has_many :through to has_and_belongs_to_many.'
337
- Enabled: false
338
-
339
- Rails/Output:
340
- Description: 'Checks for calls to puts, print, etc.'
341
- Enabled: true
342
-
343
- Rails/ReadWriteAttribute:
344
- Description: >-
345
- Checks for read_attribute(:attr) and
346
- write_attribute(:attr, val).
347
- Enabled: false
348
-
349
- Rails/ScopeArgs:
350
- Description: 'Checks the arguments of ActiveRecord scopes.'
351
- Enabled: false
352
-
353
- Rails/TimeZone:
354
- Description: 'Checks the correct usage of time zone aware methods.'
355
- StyleGuide: 'https://github.com/bbatsov/rails-style-guide#time'
356
- Reference: 'http://danilenko.org/2012/7/6/rails_timezones'
357
- Enabled: false
358
-
359
- Rails/Validation:
360
- Description: 'Use validates :attribute, hash of validations.'
361
- Enabled: false
362
-
363
- ################## Style #################################
364
-
365
- Layout/AccessModifierIndentation:
366
- Description: Check indentation of private/protected visibility modifiers.
367
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#indent-public-private-protected'
368
- Enabled: false
369
-
370
- Naming/AccessorMethodName:
371
- Description: Check the naming of accessor methods for get_/set_.
372
- Enabled: false
373
-
374
- Style/Alias:
375
- Description: 'Use alias_method instead of alias.'
376
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#alias-method'
377
- Enabled: false
378
-
379
- Layout/AlignArray:
380
- Description: >-
381
- Align the elements of an array literal if they span more than
382
- one line.
383
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#align-multiline-arrays'
384
- Enabled: true
385
-
386
- Layout/AlignHash:
387
- Description: >-
388
- Align the elements of a hash literal if they span more than
389
- one line.
390
- Enabled: true
391
-
392
- Layout/AlignParameters:
393
- Description: >-
394
- Align the parameters of a method call if they span more
395
- than one line.
396
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-double-indent'
397
- Enabled: true
398
-
399
- Style/AndOr:
400
- Description: 'Use &&/|| instead of and/or.'
401
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-and-or-or'
402
- Enabled: true
403
-
404
- Style/ArrayJoin:
405
- Description: 'Use Array#join instead of Array#*.'
406
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#array-join'
407
- Enabled: true
408
-
409
- Style/AsciiComments:
410
- Description: 'Use only ascii symbols in comments.'
411
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#english-comments'
412
- Enabled: true
413
-
414
- Naming/AsciiIdentifiers:
415
- Description: 'Use only ascii symbols in identifiers.'
416
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#english-identifiers'
417
- Enabled: true
418
-
419
- Style/Attr:
420
- Description: 'Checks for uses of Module#attr.'
421
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#attr'
422
- Enabled: false
423
-
424
- Style/BeginBlock:
425
- Description: 'Avoid the use of BEGIN blocks.'
426
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-BEGIN-blocks'
427
- Enabled: true
428
-
429
- Style/BarePercentLiterals:
430
- Description: 'Checks if usage of %() or %Q() matches configuration.'
431
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-q-shorthand'
432
- Enabled: false
433
-
434
- Style/BlockComments:
435
- Description: 'Do not use block comments.'
436
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-block-comments'
437
- Enabled: false
438
-
439
- Layout/BlockEndNewline:
440
- Description: 'Put end statement of multiline block on its own line.'
441
- Enabled: true
442
-
443
- Style/BlockDelimiters:
444
- Description: >-
445
- Avoid using {...} for multi-line blocks (multiline chaining is
446
- always ugly).
447
- Prefer {...} over do...end for single-line blocks.
448
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#single-line-blocks'
449
- Enabled: false
450
-
451
- Style/BracesAroundHashParameters:
452
- Description: 'Enforce braces style around hash parameters.'
453
- Enabled: false
454
-
455
- Style/CaseEquality:
456
- Description: 'Avoid explicit use of the case equality operator(===).'
457
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-case-equality'
458
- Enabled: true
459
-
460
- Layout/CaseIndentation:
461
- Description: 'Indentation of when in a case/when/[else/]end.'
462
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#indent-when-to-case'
463
- Enabled: false
464
-
465
- Style/CharacterLiteral:
466
- Description: 'Checks for uses of character literals.'
467
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-character-literals'
468
- Enabled: true
469
-
470
- Naming/ClassAndModuleCamelCase:
471
- Description: 'Use CamelCase for classes and modules.'
472
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#camelcase-classes'
473
- Enabled: true
474
-
475
- Style/ClassAndModuleChildren:
476
- Description: 'Checks style of children classes and modules.'
477
- Enabled: false
478
-
479
- Style/ClassCheck:
480
- Description: 'Enforces consistent use of `Object#is_a?` or `Object#kind_of?`.'
481
- Enabled: true
482
- EnforcedStyle: kind_of?
483
-
484
- Style/ClassMethods:
485
- Description: 'Use self when defining module/class methods.'
486
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#def-self-class-methods'
487
- Enabled: true
488
-
489
- Style/ClassVars:
490
- Description: 'Avoid the use of class variables.'
491
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-class-vars'
492
- Enabled: false
493
-
494
- Layout/ClosingParenthesisIndentation:
495
- Description: 'Checks the indentation of hanging closing parentheses.'
496
- Enabled: true
497
-
498
- Style/ColonMethodCall:
499
- Description: 'Do not use :: for method call.'
500
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#double-colons'
501
- Enabled: true
502
-
503
- Style/CommandLiteral:
504
- Description: 'Use `` or %x around command literals.'
505
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-x'
506
- Enabled: false
507
-
508
- Style/CommentAnnotation:
509
- Description: 'Checks formatting of annotation comments.'
510
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#annotate-keywords'
511
- Enabled: false
512
-
513
- Layout/CommentIndentation:
514
- Description: 'Indentation of comments.'
515
- Enabled: false
516
-
517
- Naming/ConstantName:
518
- Description: 'Constants should use SCREAMING_SNAKE_CASE.'
519
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#screaming-snake-case'
520
- Enabled: true
521
-
522
- Style/DefWithParentheses:
523
- Description: 'Use def with parentheses when there are arguments.'
524
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#method-parens'
525
- Enabled: true
526
-
527
- Style/PreferredHashMethods:
528
- Description: 'Checks for use of deprecated Hash methods.'
529
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#hash-key'
530
- Enabled: true
531
-
532
- Style/Documentation:
533
- Description: 'Document classes and non-namespace modules.'
534
- Enabled: false
535
-
536
- Layout/DotPosition:
537
- Description: 'Checks the position of the dot in multi-line method calls.'
538
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains'
539
- EnforcedStyle: trailing
540
- Enabled: true
541
-
542
- Style/DoubleNegation:
543
- Description: 'Checks for uses of double negation (!!).'
544
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-bang-bang'
545
- Enabled: false
546
-
547
- Style/EachWithObject:
548
- Description: 'Prefer `each_with_object` over `inject` or `reduce`.'
549
- Enabled: false
550
-
551
- Layout/ElseAlignment:
552
- Description: 'Align elses and elsifs correctly.'
553
- Enabled: true
554
-
555
- Style/EmptyElse:
556
- Description: 'Avoid empty else-clauses.'
557
- Enabled: true
558
-
559
- Layout/EmptyLineBetweenDefs:
560
- Description: 'Use empty lines between defs.'
561
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#empty-lines-between-methods'
562
- Enabled: true
563
-
564
- Layout/EmptyLines:
565
- Description: "Don't use several empty lines in a row."
566
- Enabled: true
567
-
568
- Layout/EmptyLinesAroundAccessModifier:
569
- Description: "Keep blank lines around access modifiers."
570
- Enabled: true
571
-
572
- Layout/EmptyLinesAroundBlockBody:
573
- Description: "Keeps track of empty lines around block bodies."
574
- Enabled: true
575
-
576
- Layout/EmptyLinesAroundClassBody:
577
- Description: "Keeps track of empty lines around class bodies."
578
- Enabled: false
579
-
580
- Layout/EmptyLinesAroundModuleBody:
581
- Description: "Keeps track of empty lines around module bodies."
582
- Enabled: false
583
-
584
- Layout/EmptyLinesAroundMethodBody:
585
- Description: "Keeps track of empty lines around method bodies."
586
- Enabled: true
587
-
588
- Style/EmptyLiteral:
589
- Description: 'Prefer literals to Array.new/Hash.new/String.new.'
590
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#literal-array-hash'
591
- Enabled: true
592
-
593
- Style/EndBlock:
594
- Description: 'Avoid the use of END blocks.'
595
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-END-blocks'
596
- Enabled: true
597
-
598
- Layout/EndOfLine:
599
- Description: 'Use Unix-style line endings.'
600
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#crlf'
601
- Enabled: true
602
-
603
- Style/EvenOdd:
604
- Description: 'Favor the use of Fixnum#even? && Fixnum#odd?'
605
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#predicate-methods'
606
- Enabled: true
607
-
608
- Layout/ExtraSpacing:
609
- Description: 'Do not use unnecessary spacing.'
610
- Enabled: true
611
-
612
- Naming/FileName:
613
- Description: 'Use snake_case for source file names.'
614
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#snake-case-files'
615
- Enabled: false
616
-
617
- Layout/InitialIndentation:
618
- Description: >-
619
- Checks the indentation of the first non-blank non-comment line in a file.
620
- Enabled: true
621
-
622
- Layout/FirstParameterIndentation:
623
- Description: 'Checks the indentation of the first parameter in a method call.'
624
- Enabled: false
625
-
626
- Style/FlipFlop:
627
- Description: 'Checks for flip flops'
628
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-flip-flops'
629
- Enabled: true
630
-
631
- Style/For:
632
- Description: 'Checks use of for or each in multiline loops.'
633
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-for-loops'
634
- Enabled: true
635
-
636
- Style/FormatString:
637
- Description: 'Enforce the use of Kernel#sprintf, Kernel#format or String#%.'
638
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#sprintf'
639
- Enabled: true
640
-
641
- Style/GlobalVars:
642
- Description: 'Do not introduce global variables.'
643
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#instance-vars'
644
- Reference: 'http://www.zenspider.com/Languages/Ruby/QuickRef.html'
645
- Enabled: true
646
-
647
- Style/GuardClause:
648
- Description: 'Check for conditionals that can be replaced with guard clauses'
649
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals'
650
- Enabled: true
651
-
652
- Style/HashSyntax:
653
- Description: >-
654
- Prefer Ruby 1.9 hash syntax { a: 1, b: 2 } over 1.8 syntax
655
- { :a => 1, :b => 2 }.
656
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#hash-literals'
657
- Enabled: true
658
-
659
- Style/IfUnlessModifier:
660
- Description: >-
661
- Favor modifier if/unless usage when you have a
662
- single-line body.
663
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#if-as-a-modifier'
664
- Enabled: false
665
-
666
- Style/IfWithSemicolon:
667
- Description: 'Do not use if x; .... Use the ternary operator instead.'
668
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-semicolon-ifs'
669
- Enabled: true
670
-
671
- Layout/IndentationConsistency:
672
- Description: 'Keep indentation straight.'
673
- Enabled: true
674
-
675
- Layout/IndentationWidth:
676
- Description: 'Use 2 spaces for indentation.'
677
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-indentation'
678
- Enabled: true
679
-
680
- Layout/IndentArray:
681
- Description: >-
682
- Checks the indentation of the first element in an array
683
- literal.
684
- Enabled: true
685
-
686
- Layout/IndentHash:
687
- Description: 'Checks the indentation of the first key in a hash literal.'
688
- Enabled: true
689
-
690
- Style/InfiniteLoop:
691
- Description: 'Use Kernel#loop for infinite loops.'
692
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#infinite-loop'
693
- Enabled: true
694
-
695
- Style/Lambda:
696
- Description: 'Use the new lambda literal syntax for single-line blocks.'
697
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#lambda-multi-line'
698
- Enabled: false
699
-
700
- Style/LambdaCall:
701
- Description: 'Use lambda.call(...) instead of lambda.(...).'
702
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#proc-call'
703
- Enabled: true
704
-
705
- Layout/LeadingCommentSpace:
706
- Description: 'Comments should start with a space.'
707
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#hash-space'
708
- Enabled: true
709
-
710
- Style/LineEndConcatenation:
711
- Description: >-
712
- Use \ instead of + or << to concatenate two string literals at
713
- line end.
714
- Enabled: false
715
-
716
- Style/MethodCallWithoutArgsParentheses:
717
- Description: 'Do not use parentheses for method calls with no arguments.'
718
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-args-no-parens'
719
- Enabled: true
720
-
721
- Style/MethodDefParentheses:
722
- Description: >-
723
- Checks if the method definitions have or don't have
724
- parentheses.
725
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#method-parens'
726
- Enabled: true
727
-
728
- Naming/MethodName:
729
- Description: 'Use the configured style when naming methods.'
730
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#snake-case-symbols-methods-vars'
731
- Enabled: true
732
-
733
- Style/ModuleFunction:
734
- Description: 'Checks for usage of `extend self` in modules.'
735
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#module-function'
736
- Enabled: false
737
-
738
- Style/MultilineBlockChain:
739
- Description: 'Avoid multi-line chains of blocks.'
740
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#single-line-blocks'
741
- Enabled: false
742
-
743
- Layout/MultilineBlockLayout:
744
- Description: 'Ensures newlines after multiline block do statements.'
745
- Enabled: true
746
-
747
- Style/MultilineIfThen:
748
- Description: 'Do not use then for multi-line if/unless.'
749
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-then'
750
- Enabled: true
751
-
752
- Layout/MultilineOperationIndentation:
753
- Description: >-
754
- Checks indentation of binary operations that span more than
755
- one line.
756
- Enabled: true
757
-
758
- Style/MultilineTernaryOperator:
759
- Description: >-
760
- Avoid multi-line ?: (the ternary operator);
761
- use if/unless instead.
762
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-multiline-ternary'
763
- Enabled: true
764
-
765
- Style/NegatedIf:
766
- Description: >-
767
- Favor unless over if for negative conditions
768
- (or control flow or).
769
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#unless-for-negatives'
770
- Enabled: true
771
-
772
- Style/NegatedWhile:
773
- Description: 'Favor until over while for negative conditions.'
774
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#until-for-negatives'
775
- Enabled: false
776
-
777
- Style/NestedTernaryOperator:
778
- Description: 'Use one expression per branch in a ternary operator.'
779
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-ternary'
780
- Enabled: true
781
-
782
- Style/Next:
783
- Description: 'Use `next` to skip iteration instead of a condition at the end.'
784
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals'
785
- Enabled: true
786
-
787
- Style/NilComparison:
788
- Description: 'Prefer x.nil? to x == nil.'
789
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#predicate-methods'
790
- Enabled: true
791
-
792
- Style/NonNilCheck:
793
- Description: 'Checks for redundant nil checks.'
794
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-non-nil-checks'
795
- Enabled: false
796
-
797
- Style/Not:
798
- Description: 'Use ! instead of not.'
799
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#bang-not-not'
800
- Enabled: true
801
-
802
- Style/NumericLiterals:
803
- Description: >-
804
- Add underscores to large numeric literals to improve their
805
- readability.
806
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscores-in-numerics'
807
- Enabled: false
808
-
809
- Style/OneLineConditional:
810
- Description: >-
811
- Favor the ternary operator(?:) over
812
- if/then/else/end constructs.
813
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#ternary-operator'
814
- Enabled: true
815
-
816
- Naming/BinaryOperatorParameterName:
817
- Description: 'When defining binary operators, name the argument other.'
818
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#other-arg'
819
- Enabled: false
820
-
821
- Style/OptionalArguments:
822
- Description: >-
823
- Checks for optional arguments that do not appear at the end
824
- of the argument list
825
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#optional-arguments'
826
- Enabled: true
827
-
828
- Style/ParallelAssignment:
829
- Description: >-
830
- Check for simple usages of parallel assignment.
831
- It will only warn when the number of variables
832
- matches on both sides of the assignment.
833
- This also provides performance benefits
834
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parallel-assignment'
835
- Enabled: true
836
-
837
- Style/ParenthesesAroundCondition:
838
- Description: >-
839
- Don't use parentheses around the condition of an
840
- if/unless/while.
841
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-parens-if'
842
- Enabled: true
843
-
844
- Style/PercentLiteralDelimiters:
845
- Description: 'Use `%`-literal delimiters consistently'
846
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-literal-braces'
847
- Enabled: false
848
-
849
- Style/PercentQLiterals:
850
- Description: 'Checks if uses of %Q/%q match the configured preference.'
851
- Enabled: false
852
-
853
- Style/PerlBackrefs:
854
- Description: 'Avoid Perl-style regex back references.'
855
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-perl-regexp-last-matchers'
856
- Enabled: false
857
-
858
- Naming/PredicateName:
859
- Description: 'Check the names of predicate methods.'
860
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#bool-methods-qmark'
861
- Enabled: false
862
-
863
- Style/Proc:
864
- Description: 'Use proc instead of Proc.new.'
865
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#proc'
866
- Enabled: false
867
-
868
- Style/RaiseArgs:
869
- Description: 'Checks the arguments passed to raise/fail.'
870
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#exception-class-messages'
871
- Enabled: true
872
-
873
- Style/RedundantBegin:
874
- Description: "Don't use begin blocks when they are not needed."
875
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#begin-implicit'
876
- Enabled: true
877
-
878
- Style/RedundantException:
879
- Description: "Checks for an obsolete RuntimeException argument in raise/fail."
880
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-explicit-runtimeerror'
881
- Enabled: true
882
-
883
- Style/RedundantReturn:
884
- Description: "Don't use return where it's not required."
885
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-explicit-return'
886
- Enabled: false
887
-
888
- Style/RedundantSelf:
889
- Description: "Don't use self where it's not needed."
890
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-self-unless-required'
891
- Enabled: false
892
-
893
- Style/RegexpLiteral:
894
- Description: 'Use / or %r around regular expressions.'
895
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-r'
896
- Enabled: false
897
-
898
- Layout/RescueEnsureAlignment:
899
- Description: 'Align rescues and ensures correctly.'
900
- Enabled: true
901
-
902
- Style/RescueModifier:
903
- Description: 'Avoid using rescue in its modifier form.'
904
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-rescue-modifiers'
905
- Enabled: true
906
-
907
- Style/SelfAssignment:
908
- Description: >-
909
- Checks for places where self-assignment shorthand should have
910
- been used.
911
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#self-assignment'
912
- Enabled: true
913
-
914
- Style/Semicolon:
915
- Description: "Don't use semicolons to terminate expressions."
916
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-semicolon'
917
- Enabled: true
918
-
919
- Style/SignalException:
920
- Description: 'Checks for proper usage of fail and raise.'
921
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#fail-method'
922
- Enabled: false
923
-
924
- Style/SingleLineBlockParams:
925
- Description: 'Enforces the names of some block params.'
926
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#reduce-blocks'
927
- Enabled: false
928
-
929
- Style/SingleLineMethods:
930
- Description: 'Avoid single-line methods.'
931
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-single-line-methods'
932
- Enabled: true
933
-
934
- Layout/SpaceBeforeFirstArg:
935
- Description: >-
936
- Checks that exactly one space is used between a method name
937
- and the first argument for method calls without parentheses.
938
- Enabled: true
939
-
940
- Layout/SpaceAfterColon:
941
- Description: 'Use spaces after colons.'
942
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators'
943
- Enabled: true
944
-
945
- Layout/SpaceAfterComma:
946
- Description: 'Use spaces after commas.'
947
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators'
948
- Enabled: true
949
-
950
- Layout/SpaceAroundKeyword:
951
- Description: 'Use spaces around keywords.'
952
- Enabled: true
953
-
954
- Layout/SpaceAfterMethodName:
955
- Description: >-
956
- Do not put a space between a method name and the opening
957
- parenthesis in a method definition.
958
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-no-spaces'
959
- Enabled: true
960
-
961
- Layout/SpaceAfterNot:
962
- Description: Tracks redundant space after the ! operator.
963
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-space-bang'
964
- Enabled: true
965
-
966
- Layout/SpaceAfterSemicolon:
967
- Description: 'Use spaces after semicolons.'
968
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators'
969
- Enabled: true
970
-
971
- Layout/SpaceBeforeBlockBraces:
972
- Description: >-
973
- Checks that the left block brace has or doesn't have space
974
- before it.
975
- Enabled: true
976
-
977
- Layout/SpaceBeforeComma:
978
- Description: 'No spaces before commas.'
979
- Enabled: true
980
-
981
- Layout/SpaceBeforeComment:
982
- Description: >-
983
- Checks for missing space between code and a comment on the
984
- same line.
985
- Enabled: false
986
-
987
- Layout/SpaceBeforeSemicolon:
988
- Description: 'No spaces before semicolons.'
989
- Enabled: true
990
-
991
- Layout/SpaceInsideBlockBraces:
992
- Description: >-
993
- Checks that block braces have or don't have surrounding space.
994
- For blocks taking parameters, checks that the left brace has
995
- or doesn't have trailing space.
996
- Enabled: true
997
-
998
- Layout/SpaceAroundBlockParameters:
999
- Description: 'Checks the spacing inside and after block parameters pipes.'
1000
- Enabled: true
1001
-
1002
- Layout/SpaceAroundEqualsInParameterDefault:
1003
- Description: >-
1004
- Checks that the equals signs in parameter default assignments
1005
- have or don't have surrounding space depending on
1006
- configuration.
1007
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-around-equals'
1008
- Enabled: true
1009
-
1010
- Layout/SpaceAroundOperators:
1011
- Description: 'Use a single space around operators.'
1012
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators'
1013
- Enabled: true
1014
-
1015
- Layout/SpaceInsideBrackets:
1016
- Description: 'No spaces after [ or before ].'
1017
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-spaces-braces'
1018
- Enabled: false
1019
-
1020
- Layout/SpaceInsideHashLiteralBraces:
1021
- Description: "Use spaces inside hash literal braces - or don't."
1022
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators'
1023
- Enabled: true
1024
-
1025
- Layout/SpaceInsideParens:
1026
- Description: 'No spaces after ( or before ).'
1027
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-spaces-braces'
1028
- Enabled: true
1029
-
1030
- Layout/SpaceInsideRangeLiteral:
1031
- Description: 'No spaces inside range literals.'
1032
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-space-inside-range-literals'
1033
- Enabled: true
1034
-
1035
- Layout/SpaceInsideStringInterpolation:
1036
- Description: 'Checks for padding/surrounding spaces inside string interpolation.'
1037
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#string-interpolation'
1038
- Enabled: true
1039
-
1040
- Style/SpecialGlobalVars:
1041
- Description: 'Avoid Perl-style global variables.'
1042
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-cryptic-perlisms'
1043
- Enabled: true
1044
-
1045
- Style/StringLiterals:
1046
- Description: 'Checks if uses of quotes match the configured preference.'
1047
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#consistent-string-literals'
1048
- Enabled: false
1049
-
1050
- Style/StringLiteralsInInterpolation:
1051
- Description: >-
1052
- Checks if uses of quotes inside expressions in interpolated
1053
- strings match the configured preference.
1054
- Enabled: false
1055
-
1056
- Style/StructInheritance:
1057
- Description: 'Checks for inheritance from Struct.new.'
1058
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-extend-struct-new'
1059
- Enabled: true
1060
-
1061
- Style/SymbolLiteral:
1062
- Description: 'Use plain symbols instead of string symbols when possible.'
1063
- Enabled: true
1064
-
1065
- Style/SymbolProc:
1066
- Description: 'Use symbols as procs instead of blocks when possible.'
1067
- Enabled: true
1068
-
1069
- Layout/Tab:
1070
- Description: 'No hard tabs.'
1071
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-indentation'
1072
- Enabled: true
1073
-
1074
- Layout/TrailingBlankLines:
1075
- Description: 'Checks trailing blank lines and final newline.'
1076
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#newline-eof'
1077
- Enabled: true
1078
-
1079
- Style/TrailingCommaInArguments:
1080
- Description: 'Checks for trailing comma in parameter lists.'
1081
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-params-comma'
1082
- Enabled: false
1083
-
1084
- Style/TrailingCommaInLiteral:
1085
- Description: 'Checks for trailing comma in literals.'
1086
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
1087
- Enabled: false
1088
-
1089
- Layout/TrailingWhitespace:
1090
- Description: 'Avoid trailing whitespace.'
1091
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-whitespace'
1092
- Enabled: true
1093
-
1094
- Style/TrivialAccessors:
1095
- Description: 'Prefer attr_* methods to trivial readers/writers.'
1096
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#attr_family'
1097
- Enabled: true
1098
-
1099
- Style/UnlessElse:
1100
- Description: >-
1101
- Do not use unless with else. Rewrite these with the positive
1102
- case first.
1103
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-else-with-unless'
1104
- Enabled: true
1105
-
1106
- Style/UnneededCapitalW:
1107
- Description: 'Checks for %W when interpolation is not needed.'
1108
- Enabled: false
1109
-
1110
- Style/UnneededPercentQ:
1111
- Description: 'Checks for %q/%Q when single quotes or double quotes would do.'
1112
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-q'
1113
- Enabled: false
1114
-
1115
- Style/TrailingUnderscoreVariable:
1116
- Description: >-
1117
- Checks for the usage of unneeded trailing underscores at the
1118
- end of parallel variable assignment.
1119
- Enabled: true
1120
-
1121
- Style/VariableInterpolation:
1122
- Description: >-
1123
- Don't interpolate global, instance and class variables
1124
- directly in strings.
1125
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#curlies-interpolate'
1126
- Enabled: true
1127
-
1128
- Naming/VariableName:
1129
- Description: 'Use the configured style when naming variables.'
1130
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#snake-case-symbols-methods-vars'
1131
- Enabled: true
1132
-
1133
- Style/WhenThen:
1134
- Description: 'Use when x then ... for one-line cases.'
1135
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#one-line-cases'
1136
- Enabled: false
1137
-
1138
- Style/WhileUntilDo:
1139
- Description: 'Checks for redundant do after while or until.'
1140
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-multiline-while-do'
1141
- Enabled: false
1142
-
1143
- Style/WhileUntilModifier:
1144
- Description: >-
1145
- Favor modifier while/until usage when you have a
1146
- single-line body.
1147
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#while-as-a-modifier'
1148
- Enabled: false
1149
-
1150
- Style/WordArray:
1151
- Description: 'Use %w or %W for arrays of words.'
1152
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-w'
1153
- Enabled: false