feedjira 3.1.1 → 3.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. checksums.yaml +4 -4
  2. data/.github/ISSUE_TEMPLATE/feed-parsing.md +15 -0
  3. data/.rubocop.yml +19 -627
  4. data/.rubocop_todo.yml +4 -29
  5. data/.travis.yml +0 -1
  6. data/CHANGELOG.md +5 -0
  7. data/Gemfile +4 -2
  8. data/Rakefile +3 -1
  9. data/feedjira.gemspec +6 -10
  10. data/lib/feedjira.rb +4 -3
  11. data/lib/feedjira/configuration.rb +5 -3
  12. data/lib/feedjira/core_ext.rb +2 -0
  13. data/lib/feedjira/core_ext/date.rb +3 -1
  14. data/lib/feedjira/core_ext/string.rb +2 -0
  15. data/lib/feedjira/core_ext/time.rb +2 -0
  16. data/lib/feedjira/date_time_utilities.rb +8 -8
  17. data/lib/feedjira/date_time_utilities/date_time_epoch_parser.rb +3 -0
  18. data/lib/feedjira/date_time_utilities/date_time_language_parser.rb +4 -2
  19. data/lib/feedjira/date_time_utilities/date_time_pattern_parser.rb +9 -9
  20. data/lib/feedjira/feed.rb +2 -0
  21. data/lib/feedjira/feed_entry_utilities.rb +5 -3
  22. data/lib/feedjira/feed_utilities.rb +5 -2
  23. data/lib/feedjira/parser.rb +2 -0
  24. data/lib/feedjira/parser/atom.rb +3 -1
  25. data/lib/feedjira/parser/atom_entry.rb +2 -0
  26. data/lib/feedjira/parser/atom_feed_burner.rb +4 -2
  27. data/lib/feedjira/parser/atom_feed_burner_entry.rb +2 -2
  28. data/lib/feedjira/parser/atom_google_alerts.rb +3 -1
  29. data/lib/feedjira/parser/atom_google_alerts_entry.rb +6 -5
  30. data/lib/feedjira/parser/atom_youtube.rb +2 -0
  31. data/lib/feedjira/parser/atom_youtube_entry.rb +2 -0
  32. data/lib/feedjira/parser/globally_unique_identifier.rb +2 -0
  33. data/lib/feedjira/parser/google_docs_atom.rb +4 -2
  34. data/lib/feedjira/parser/google_docs_atom_entry.rb +2 -0
  35. data/lib/feedjira/parser/itunes_rss.rb +4 -2
  36. data/lib/feedjira/parser/itunes_rss_category.rb +2 -0
  37. data/lib/feedjira/parser/itunes_rss_item.rb +3 -1
  38. data/lib/feedjira/parser/itunes_rss_owner.rb +2 -0
  39. data/lib/feedjira/parser/json_feed.rb +4 -2
  40. data/lib/feedjira/parser/json_feed_item.rb +7 -1
  41. data/lib/feedjira/parser/podlove_chapter.rb +3 -0
  42. data/lib/feedjira/parser/rss.rb +4 -1
  43. data/lib/feedjira/parser/rss_entry.rb +2 -0
  44. data/lib/feedjira/parser/rss_feed_burner.rb +3 -1
  45. data/lib/feedjira/parser/rss_feed_burner_entry.rb +2 -2
  46. data/lib/feedjira/parser/rss_image.rb +2 -0
  47. data/lib/feedjira/preprocessor.rb +3 -1
  48. data/lib/feedjira/rss_entry_utilities.rb +6 -2
  49. data/lib/feedjira/version.rb +3 -1
  50. data/spec/feedjira/configuration_spec.rb +2 -0
  51. data/spec/feedjira/date_time_utilities_spec.rb +2 -0
  52. data/spec/feedjira/feed_entry_utilities_spec.rb +4 -2
  53. data/spec/feedjira/feed_spec.rb +2 -0
  54. data/spec/feedjira/feed_utilities_spec.rb +5 -3
  55. data/spec/feedjira/parser/atom_entry_spec.rb +6 -4
  56. data/spec/feedjira/parser/atom_feed_burner_entry_spec.rb +7 -5
  57. data/spec/feedjira/parser/atom_feed_burner_spec.rb +4 -2
  58. data/spec/feedjira/parser/atom_google_alerts_entry_spec.rb +6 -4
  59. data/spec/feedjira/parser/atom_google_alerts_spec.rb +2 -0
  60. data/spec/feedjira/parser/atom_spec.rb +9 -7
  61. data/spec/feedjira/parser/atom_youtube_entry_spec.rb +6 -4
  62. data/spec/feedjira/parser/atom_youtube_spec.rb +6 -4
  63. data/spec/feedjira/parser/google_docs_atom_entry_spec.rb +2 -0
  64. data/spec/feedjira/parser/google_docs_atom_spec.rb +2 -0
  65. data/spec/feedjira/parser/itunes_rss_item_spec.rb +3 -1
  66. data/spec/feedjira/parser/itunes_rss_owner_spec.rb +2 -0
  67. data/spec/feedjira/parser/itunes_rss_spec.rb +11 -9
  68. data/spec/feedjira/parser/json_feed_item_spec.rb +5 -3
  69. data/spec/feedjira/parser/json_feed_spec.rb +2 -0
  70. data/spec/feedjira/parser/podlove_chapter_spec.rb +2 -0
  71. data/spec/feedjira/parser/rss_entry_spec.rb +6 -4
  72. data/spec/feedjira/parser/rss_feed_burner_entry_spec.rb +9 -7
  73. data/spec/feedjira/parser/rss_feed_burner_spec.rb +3 -1
  74. data/spec/feedjira/parser/rss_spec.rb +2 -0
  75. data/spec/feedjira/preprocessor_spec.rb +4 -2
  76. data/spec/feedjira_spec.rb +11 -0
  77. data/spec/sample_feeds.rb +4 -1
  78. data/spec/sample_feeds/a10.xml +72 -0
  79. data/spec/spec_helper.rb +3 -1
  80. metadata +13 -25
  81. data/Dangerfile +0 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 61f3d95b5c43923b3b97d3353017af589c0a7bb10c733907235ce50177b77419
4
- data.tar.gz: d391298c7484876c396b3a308a473f8944ad979b9cb5f585a469ee1700ee3954
3
+ metadata.gz: 0146f6f9717aa2550c7c3ee8ad10bdc2d1670b5a877979ec3b4b92acc8556a01
4
+ data.tar.gz: 336327b583cbda573b23b35c6c7e43633fb832ff8054be34126340ad8c8bff3a
5
5
  SHA512:
6
- metadata.gz: d409e15aa33a19e52bbc8adecd4ca05afe153d5a8f53956eda760f532fb9ea3ce0ac2ecf6a06fb6a039ffb877364f2f5df078bc68d88c7f42d322df84bc0a5ec
7
- data.tar.gz: 19d45fdbd89b4347e84b017da3df211a94d53bb22bbe2b490a8f0a74f13fdb273286d2a2c07101eabe07884230c6f111e5640171fe633cf5ba8aca5095e48d7d
6
+ metadata.gz: db78dc79cc38419c6f81a0336f4794d8f744b2cab24786c3c9ac9b92f2b72f2c5db190a982fcfb16de6ccec1b358309c76e3c165ec16141b8816736774339662
7
+ data.tar.gz: b9a4466a3371c7d1fb837cdc8ffcced9af1a830810b47113cd2a790c8c1145c0aae1a9faad91b642bec50a12469917ead27a48fc798e257e2017d736ef0e5101
@@ -0,0 +1,15 @@
1
+ ---
2
+ name: Feed Parsing
3
+ about: Your feed is parsing incorrectly, or you have a feed type that is not supported
4
+ title: ''
5
+ labels: ''
6
+ assignees: ''
7
+
8
+ ---
9
+
10
+ ### Steps to reproduce
11
+ <!-- (Guidelines for creating a bug report are [available
12
+ here](https://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#creating-a-bug-report)) -->
13
+
14
+ ### Example feed URL
15
+ <!-- Tell us what should happen -->
@@ -1,647 +1,39 @@
1
1
  inherit_from: .rubocop_todo.yml
2
2
 
3
3
  AllCops:
4
- TargetRubyVersion: 2.2
5
- Exclude:
6
- - db/schema.rb
7
- - vendor/**/*
8
-
9
- Naming/AccessorMethodName:
10
- Description: Check the naming of accessor methods for get_/set_.
11
- Enabled: false
12
-
13
- Style/Alias:
14
- Description: 'Use alias_method instead of alias.'
15
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#alias-method'
16
- Enabled: false
17
-
18
- Style/ArrayJoin:
19
- Description: 'Use Array#join instead of Array#*.'
20
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#array-join'
21
- Enabled: false
22
-
23
- Style/AsciiComments:
24
- Description: 'Use only ascii symbols in comments.'
25
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#english-comments'
26
- Enabled: false
27
-
28
- Naming/AsciiIdentifiers:
29
- Description: 'Use only ascii symbols in identifiers.'
30
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#english-identifiers'
31
- Enabled: false
32
-
33
- Style/Attr:
34
- Description: 'Checks for uses of Module#attr.'
35
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#attr'
36
- Enabled: false
37
-
38
- Metrics/BlockNesting:
39
- Description: 'Avoid excessive block nesting'
40
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#three-is-the-number-thou-shalt-count'
41
- Enabled: false
42
-
43
- Style/CaseEquality:
44
- Description: 'Avoid explicit use of the case equality operator(===).'
45
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-case-equality'
46
- Enabled: false
47
-
48
- Style/CharacterLiteral:
49
- Description: 'Checks for uses of character literals.'
50
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-character-literals'
51
- Enabled: false
52
-
53
- Style/ClassAndModuleChildren:
54
- Description: 'Checks style of children classes and modules.'
55
- Enabled: true
56
- EnforcedStyle: nested
57
-
58
- Metrics/ClassLength:
59
- Description: 'Avoid classes longer than 100 lines of code.'
60
- Enabled: false
61
-
62
- Metrics/ModuleLength:
63
- Description: 'Avoid modules longer than 100 lines of code.'
64
- Enabled: false
65
-
66
- Style/ClassVars:
67
- Description: 'Avoid the use of class variables.'
68
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-class-vars'
69
- Enabled: false
70
-
71
- Style/CollectionMethods:
72
- Enabled: true
73
- PreferredMethods:
74
- find: detect
75
- inject: reduce
76
- collect: map
77
- find_all: select
4
+ TargetRubyVersion: 2.5
5
+ NewCops: enable
78
6
 
79
- Style/ColonMethodCall:
80
- Description: 'Do not use :: for method call.'
81
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#double-colons'
82
- Enabled: false
83
7
 
84
- Style/CommentAnnotation:
85
- Description: >-
86
- Checks formatting of special comments
87
- (TODO, FIXME, OPTIMIZE, HACK, REVIEW).
88
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#annotate-keywords'
89
- Enabled: false
8
+ Gemspec/RequiredRubyVersion:
9
+ Exclude:
10
+ - 'feedjira.gemspec'
90
11
 
12
+ # Offense count: 3
13
+ # Configuration parameters: IgnoredMethods.
91
14
  Metrics/AbcSize:
92
- Description: >-
93
- A calculated magnitude based on number of assignments,
94
- branches, and conditions.
95
- Enabled: false
15
+ Max: 24
96
16
 
17
+ # Offense count: 33
18
+ # Configuration parameters: CountComments, CountAsOne, ExcludedMethods.
19
+ # ExcludedMethods: refine
97
20
  Metrics/BlockLength:
98
- CountComments: true # count full line comments?
99
- Max: 25
100
- ExcludedMethods: []
101
- Exclude:
102
- - "spec/**/*"
103
-
104
- Metrics/CyclomaticComplexity:
105
- Description: >-
106
- A complexity metric that is strongly correlated to the number
107
- of test cases needed to validate a method.
108
- Enabled: false
109
-
110
- Rails/Delegate:
111
- Description: 'Prefer delegate method for delegations.'
112
- Enabled: false
113
-
114
- Style/PreferredHashMethods:
115
- Description: 'Checks use of `has_key?` and `has_value?` Hash methods.'
116
- StyleGuide: '#hash-key'
117
- Enabled: false
118
-
119
- Style/Documentation:
120
- Description: 'Document classes and non-namespace modules.'
121
- Enabled: false
122
-
123
- Style/DoubleNegation:
124
- Description: 'Checks for uses of double negation (!!).'
125
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-bang-bang'
126
- Enabled: false
127
-
128
- Style/EachWithObject:
129
- Description: 'Prefer `each_with_object` over `inject` or `reduce`.'
130
- Enabled: false
131
-
132
- Style/EmptyLiteral:
133
- Description: 'Prefer literals to Array.new/Hash.new/String.new.'
134
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#literal-array-hash'
135
- Enabled: false
136
-
137
- # Checks whether the source file has a utf-8 encoding comment or not
138
- # AutoCorrectEncodingComment must match the regex
139
- # /#.*coding\s?[:=]\s?(?:UTF|utf)-8/
140
- Style/Encoding:
141
- Enabled: false
142
-
143
- Style/EvenOdd:
144
- Description: 'Favor the use of Fixnum#even? && Fixnum#odd?'
145
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#predicate-methods'
146
- Enabled: false
147
-
148
- Naming/FileName:
149
- Description: 'Use snake_case for source file names.'
150
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#snake-case-files'
151
- Enabled: false
152
-
153
- Style/FrozenStringLiteralComment:
154
- Description: >-
155
- Add the frozen_string_literal comment to the top of files
156
- to help transition from Ruby 2.3.0 to Ruby 3.0.
157
- Enabled: false
158
-
159
- Style/FlipFlop:
160
- Description: 'Checks for flip flops'
161
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-flip-flops'
162
- Enabled: false
163
-
164
- Style/FormatString:
165
- Description: 'Enforce the use of Kernel#sprintf, Kernel#format or String#%.'
166
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#sprintf'
167
- Enabled: false
168
-
169
- Style/GlobalVars:
170
- Description: 'Do not introduce global variables.'
171
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#instance-vars'
172
- Reference: 'http://www.zenspider.com/Languages/Ruby/QuickRef.html'
173
- Enabled: false
174
-
175
- Style/GuardClause:
176
- Description: 'Check for conditionals that can be replaced with guard clauses'
177
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals'
178
- Enabled: false
179
-
180
- Style/IfUnlessModifier:
181
- Description: >-
182
- Favor modifier if/unless usage when you have a
183
- single-line body.
184
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#if-as-a-modifier'
185
- Enabled: false
186
-
187
- Style/IfWithSemicolon:
188
- Description: 'Do not use if x; .... Use the ternary operator instead.'
189
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-semicolon-ifs'
190
- Enabled: false
191
-
192
- Style/InlineComment:
193
- Description: 'Avoid inline comments.'
194
- Enabled: false
195
-
196
- Style/Lambda:
197
- Description: 'Use the new lambda literal syntax for single-line blocks.'
198
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#lambda-multi-line'
199
- Enabled: false
200
-
201
- Style/LambdaCall:
202
- Description: 'Use lambda.call(...) instead of lambda.(...).'
203
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#proc-call'
204
- Enabled: false
205
-
206
- Style/LineEndConcatenation:
207
- Description: >-
208
- Use \ instead of + or << to concatenate two string literals at
209
- line end.
210
- Enabled: false
211
-
212
- Style/SymbolArray:
213
- Enabled: true
214
- EnforcedStyle: brackets
215
-
216
- Style/DateTime:
217
- Enabled: false
218
-
219
- Metrics/LineLength:
220
- Description: 'Limit lines to 120 characters.'
221
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#80-character-limits'
222
- Max: 120
21
+ Max: 235
223
22
 
23
+ # Offense count: 7
24
+ # Configuration parameters: CountComments, CountAsOne, ExcludedMethods.
224
25
  Metrics/MethodLength:
225
- Description: 'Avoid methods longer than 10 lines of code.'
226
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#short-methods'
227
- Enabled: false
228
-
229
- Style/ModuleFunction:
230
- Description: 'Checks for usage of `extend self` in modules.'
231
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#module-function'
232
- Enabled: false
233
-
234
- Style/MultilineBlockChain:
235
- Description: 'Avoid multi-line chains of blocks.'
236
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#single-line-blocks'
237
- Enabled: false
238
-
239
- Style/NegatedIf:
240
- Description: >-
241
- Favor unless over if for negative conditions
242
- (or control flow or).
243
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#unless-for-negatives'
244
- Enabled: false
245
-
246
- Style/NegatedWhile:
247
- Description: 'Favor until over while for negative conditions.'
248
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#until-for-negatives'
249
- Enabled: false
250
-
251
- Style/Next:
252
- Description: 'Use `next` to skip iteration instead of a condition at the end.'
253
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals'
254
- Enabled: false
255
-
256
- Style/NilComparison:
257
- Description: 'Prefer x.nil? to x == nil.'
258
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#predicate-methods'
259
- Enabled: false
260
-
261
- Style/Not:
262
- Description: 'Use ! instead of not.'
263
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#bang-not-not'
264
- Enabled: false
265
-
266
- Style/NumericLiterals:
267
- Description: >-
268
- Add underscores to large numeric literals to improve their
269
- readability.
270
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscores-in-numerics'
271
- Enabled: false
272
-
273
- Style/OneLineConditional:
274
- Description: >-
275
- Favor the ternary operator(?:) over
276
- if/then/else/end constructs.
277
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#ternary-operator'
278
- Enabled: false
279
-
280
- Naming/BinaryOperatorParameterName:
281
- Description: 'When defining binary operators, name the argument other.'
282
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#other-arg'
283
- Enabled: false
284
-
285
- Metrics/ParameterLists:
286
- Description: 'Avoid parameter lists longer than three or four parameters.'
287
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#too-many-params'
288
- Enabled: false
289
-
290
- Style/PercentLiteralDelimiters:
291
- Description: 'Use `%`-literal delimiters consistently'
292
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-literal-braces'
293
- Enabled: false
294
-
295
- Style/PerlBackrefs:
296
- Description: 'Avoid Perl-style regex back references.'
297
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-perl-regexp-last-matchers'
298
- Enabled: false
26
+ Max: 25
299
27
 
300
- Naming/PredicateName:
301
- Description: 'Check the names of predicate methods.'
302
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#bool-methods-qmark'
303
- NamePrefixBlacklist:
304
- - is_
28
+ Layout/LineLength:
305
29
  Exclude:
306
- - spec/**/*
30
+ - 'spec/**/*.rb'
307
31
 
308
- Style/Proc:
309
- Description: 'Use proc instead of Proc.new.'
310
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#proc'
311
- Enabled: false
312
-
313
- Style/RaiseArgs:
314
- Description: 'Checks the arguments passed to raise/fail.'
315
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#exception-class-messages'
316
- Enabled: false
317
-
318
- Style/RegexpLiteral:
319
- Description: 'Use / or %r around regular expressions.'
320
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-r'
321
- Enabled: false
322
-
323
- Style/SelfAssignment:
324
- Description: >-
325
- Checks for places where self-assignment shorthand should have
326
- been used.
327
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#self-assignment'
328
- Enabled: false
329
-
330
- Style/SingleLineBlockParams:
331
- Description: 'Enforces the names of some block params.'
332
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#reduce-blocks'
333
- Enabled: false
334
-
335
- Style/SingleLineMethods:
336
- Description: 'Avoid single-line methods.'
337
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-single-line-methods'
338
- Enabled: false
339
-
340
- Style/SignalException:
341
- Description: 'Checks for proper usage of fail and raise.'
342
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#fail-method'
32
+ Style/AsciiComments:
343
33
  Enabled: false
344
34
 
345
- Style/SpecialGlobalVars:
346
- Description: 'Avoid Perl-style global variables.'
347
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-cryptic-perlisms'
35
+ Style/IfUnlessModifier:
348
36
  Enabled: false
349
37
 
350
38
  Style/StringLiterals:
351
- Description: 'Checks if uses of quotes match the configured preference.'
352
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#consistent-string-literals'
353
39
  EnforcedStyle: double_quotes
354
- Enabled: true
355
-
356
- Style/TrailingCommaInArguments:
357
- Description: 'Checks for trailing comma in argument lists.'
358
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
359
- EnforcedStyleForMultiline: comma
360
- SupportedStylesForMultiline:
361
- - comma
362
- - consistent_comma
363
- - no_comma
364
- Enabled: true
365
-
366
- Style/TrailingCommaInArrayLiteral:
367
- Description: 'Checks for trailing comma in array and hash literals.'
368
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
369
- EnforcedStyleForMultiline: comma
370
- SupportedStylesForMultiline:
371
- - comma
372
- - consistent_comma
373
- - no_comma
374
- Enabled: true
375
-
376
- Style/TrivialAccessors:
377
- Description: 'Prefer attr_* methods to trivial readers/writers.'
378
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#attr_family'
379
- Enabled: false
380
-
381
- Style/VariableInterpolation:
382
- Description: >-
383
- Don't interpolate global, instance and class variables
384
- directly in strings.
385
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#curlies-interpolate'
386
- Enabled: false
387
-
388
- Style/WhenThen:
389
- Description: 'Use when x then ... for one-line cases.'
390
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#one-line-cases'
391
- Enabled: false
392
-
393
- Style/WhileUntilModifier:
394
- Description: >-
395
- Favor modifier while/until usage when you have a
396
- single-line body.
397
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#while-as-a-modifier'
398
- Enabled: false
399
-
400
- Style/WordArray:
401
- Description: 'Use %w or %W for arrays of words.'
402
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-w'
403
- Enabled: false
404
-
405
- # Layout
406
-
407
- Layout/AlignParameters:
408
- Description: 'Here we check if the parameters on a multi-line method call or definition are aligned.'
409
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-double-indent'
410
- Enabled: false
411
-
412
- Layout/DotPosition:
413
- Description: 'Checks the position of the dot in multi-line method calls.'
414
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains'
415
- EnforcedStyle: trailing
416
-
417
- Layout/ExtraSpacing:
418
- Description: 'Do not use unnecessary spacing.'
419
- Enabled: true
420
-
421
- Layout/MultilineOperationIndentation:
422
- Description: >-
423
- Checks indentation of binary operations that span more than
424
- one line.
425
- Enabled: true
426
- EnforcedStyle: indented
427
-
428
- Layout/MultilineMethodCallIndentation:
429
- Description: >-
430
- Checks indentation of method calls with the dot operator
431
- that span more than one line.
432
- Enabled: true
433
- EnforcedStyle: indented
434
-
435
- Layout/InitialIndentation:
436
- Description: >-
437
- Checks the indentation of the first non-blank non-comment line in a file.
438
- Enabled: false
439
-
440
- # Lint
441
-
442
- Lint/AmbiguousOperator:
443
- Description: >-
444
- Checks for ambiguous operators in the first argument of a
445
- method invocation without parentheses.
446
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-as-args'
447
- Enabled: false
448
-
449
- Lint/AmbiguousRegexpLiteral:
450
- Description: >-
451
- Checks for ambiguous regexp literals in the first argument of
452
- a method invocation without parenthesis.
453
- Enabled: false
454
-
455
- Lint/AssignmentInCondition:
456
- Description: "Don't use assignment in conditions."
457
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#safe-assignment-in-condition'
458
- Enabled: false
459
-
460
- Lint/CircularArgumentReference:
461
- Description: "Don't refer to the keyword argument in the default value."
462
- Enabled: false
463
-
464
- Lint/ConditionPosition:
465
- Description: >-
466
- Checks for condition placed in a confusing position relative to
467
- the keyword.
468
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#same-line-condition'
469
- Enabled: false
470
-
471
- Lint/DeprecatedClassMethods:
472
- Description: 'Check for deprecated class method calls.'
473
- Enabled: false
474
-
475
- Lint/DuplicatedKey:
476
- Description: 'Check for duplicate keys in hash literals.'
477
- Enabled: false
478
-
479
- Lint/EachWithObjectArgument:
480
- Description: 'Check for immutable argument given to each_with_object.'
481
- Enabled: false
482
-
483
- Lint/ElseLayout:
484
- Description: 'Check for odd code arrangement in an else block.'
485
- Enabled: false
486
-
487
- Lint/FormatParameterMismatch:
488
- Description: 'The number of parameters to format/sprint must match the fields.'
489
- Enabled: false
490
-
491
- Lint/HandleExceptions:
492
- Description: "Don't suppress exception."
493
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#dont-hide-exceptions'
494
- Enabled: false
495
-
496
- Lint/LiteralInInterpolation:
497
- Description: 'Checks for literals used in interpolation.'
498
- Enabled: false
499
-
500
- Lint/Loop:
501
- Description: >-
502
- Use Kernel#loop with break rather than begin/end/until or
503
- begin/end/while for post-loop tests.
504
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#loop-with-break'
505
- Enabled: false
506
-
507
- Lint/NestedMethodDefinition:
508
- Description: 'Do not use nested method definitions.'
509
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-methods'
510
- Enabled: false
511
-
512
- Lint/NonLocalExitFromIterator:
513
- Description: 'Do not use return in iterator to cause non-local exit.'
514
- Enabled: false
515
-
516
- Lint/ParenthesesAsGroupedExpression:
517
- Description: >-
518
- Checks for method calls with a space before the opening
519
- parenthesis.
520
- StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-no-spaces'
521
- Enabled: false
522
-
523
- Lint/RequireParentheses:
524
- Description: >-
525
- Use parentheses in the method call to avoid confusion
526
- about precedence.
527
- Enabled: false
528
-
529
- Lint/UnderscorePrefixedVariableName:
530
- Description: 'Do not use prefix `_` for a variable that is used.'
531
- Enabled: false
532
-
533
- Lint/UnneededCopDisableDirective:
534
- Description: >-
535
- Checks for rubocop:disable comments that can be removed.
536
- Note: this cop is not disabled when disabling all cops.
537
- It must be explicitly disabled.
538
- Enabled: false
539
-
540
- Lint/Void:
541
- Description: 'Possible use of operator/literal/variable in void context.'
542
- Enabled: false
543
-
544
- # Performance
545
-
546
- Performance/CaseWhenSplat:
547
- Description: >-
548
- Place `when` conditions that use splat at the end
549
- of the list of `when` branches.
550
- Enabled: false
551
-
552
- Performance/Count:
553
- Description: >-
554
- Use `count` instead of `select...size`, `reject...size`,
555
- `select...count`, `reject...count`, `select...length`,
556
- and `reject...length`.
557
- Enabled: false
558
-
559
- Performance/Detect:
560
- Description: >-
561
- Use `detect` instead of `select.first`, `find_all.first`,
562
- `select.last`, and `find_all.last`.
563
- Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerabledetect-vs-enumerableselectfirst-code'
564
- Enabled: false
565
-
566
- Performance/FlatMap:
567
- Description: >-
568
- Use `Enumerable#flat_map`
569
- instead of `Enumerable#map...Array#flatten(1)`
570
- or `Enumberable#collect..Array#flatten(1)`
571
- Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerablemaparrayflatten-vs-enumerableflat_map-code'
572
- Enabled: false
573
-
574
- Performance/ReverseEach:
575
- Description: 'Use `reverse_each` instead of `reverse.each`.'
576
- Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerablereverseeach-vs-enumerablereverse_each-code'
577
- Enabled: false
578
-
579
- Performance/Sample:
580
- Description: >-
581
- Use `sample` instead of `shuffle.first`,
582
- `shuffle.last`, and `shuffle[Fixnum]`.
583
- Reference: 'https://github.com/JuanitoFatas/fast-ruby#arrayshufflefirst-vs-arraysample-code'
584
- Enabled: false
585
-
586
- Performance/Size:
587
- Description: >-
588
- Use `size` instead of `count` for counting
589
- the number of elements in `Array` and `Hash`.
590
- Reference: 'https://github.com/JuanitoFatas/fast-ruby#arraycount-vs-arraysize-code'
591
- Enabled: false
592
-
593
- Performance/StringReplacement:
594
- Description: >-
595
- Use `tr` instead of `gsub` when you are replacing the same
596
- number of characters. Use `delete` instead of `gsub` when
597
- you are deleting characters.
598
- Reference: 'https://github.com/JuanitoFatas/fast-ruby#stringgsub-vs-stringtr-code'
599
- Enabled: false
600
-
601
- # Rails
602
-
603
- Rails/ActionFilter:
604
- Description: 'Enforces consistent use of action filter methods.'
605
- Enabled: false
606
-
607
- Rails/Date:
608
- Description: >-
609
- Checks the correct usage of date aware methods,
610
- such as Date.today, Date.current etc.
611
- Enabled: false
612
-
613
- Rails/FindBy:
614
- Description: 'Prefer find_by over where.first.'
615
- Enabled: false
616
-
617
- Rails/FindEach:
618
- Description: 'Prefer all.find_each over all.find.'
619
- Enabled: false
620
-
621
- Rails/HasAndBelongsToMany:
622
- Description: 'Prefer has_many :through to has_and_belongs_to_many.'
623
- Enabled: false
624
-
625
- Rails/Output:
626
- Description: 'Checks for calls to puts, print, etc.'
627
- Enabled: false
628
-
629
- Rails/ReadWriteAttribute:
630
- Description: >-
631
- Checks for read_attribute(:attr) and
632
- write_attribute(:attr, val).
633
- Enabled: false
634
-
635
- Rails/ScopeArgs:
636
- Description: 'Checks the arguments of ActiveRecord scopes.'
637
- Enabled: false
638
-
639
- Rails/TimeZone:
640
- Description: 'Checks the correct usage of time zone aware methods.'
641
- StyleGuide: 'https://github.com/bbatsov/rails-style-guide#time'
642
- Reference: 'http://danilenko.org/2012/7/6/rails_timezones'
643
- Enabled: false
644
-
645
- Rails/Validation:
646
- Description: 'Use validates :attribute, hash of validations.'
647
- Enabled: false