shipcloud 0.6.0 → 0.11.0

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 (44) hide show
  1. checksums.yaml +5 -5
  2. data/.codeclimate.yml +1 -0
  3. data/.hound.yml +1 -1
  4. data/.rubocop.yml +713 -2
  5. data/.ruby-version +1 -0
  6. data/.travis.yml +18 -6
  7. data/CHANGELOG.md +70 -0
  8. data/README.md +76 -8
  9. data/bin/rubocop +29 -0
  10. data/install-cc-test-reporter.sh +4 -0
  11. data/lib/shipcloud.rb +28 -14
  12. data/lib/shipcloud/address.rb +2 -1
  13. data/lib/shipcloud/operations/all.rb +12 -2
  14. data/lib/shipcloud/operations/create.rb +10 -2
  15. data/lib/shipcloud/operations/delete.rb +10 -2
  16. data/lib/shipcloud/operations/find.rb +10 -2
  17. data/lib/shipcloud/operations/update.rb +12 -4
  18. data/lib/shipcloud/pickup_request.rb +12 -0
  19. data/lib/shipcloud/request/base.rb +14 -10
  20. data/lib/shipcloud/request/connection.rb +18 -12
  21. data/lib/shipcloud/request/info.rb +7 -5
  22. data/lib/shipcloud/shipcloud_error.rb +70 -0
  23. data/lib/shipcloud/shipment.rb +3 -2
  24. data/lib/shipcloud/tracker.rb +13 -0
  25. data/lib/shipcloud/version.rb +1 -1
  26. data/lib/shipcloud/webhook.rb +2 -1
  27. data/shipcloud.gemspec +9 -8
  28. data/spec/shipcloud/address_spec.rb +114 -43
  29. data/spec/shipcloud/carrier_spec.rb +12 -5
  30. data/spec/shipcloud/pickup_request_spec.rb +136 -0
  31. data/spec/shipcloud/request/base_spec.rb +51 -13
  32. data/spec/shipcloud/request/connection_spec.rb +3 -3
  33. data/spec/shipcloud/request/info_spec.rb +34 -0
  34. data/spec/shipcloud/shipcloud_error_spec.rb +125 -0
  35. data/spec/shipcloud/shipment_quote_spec.rb +14 -1
  36. data/spec/shipcloud/shipment_spec.rb +126 -11
  37. data/spec/shipcloud/tracker_spec.rb +141 -0
  38. data/spec/shipcloud/webhooks_spec.rb +70 -6
  39. data/spec/shipcloud_spec.rb +82 -20
  40. data/spec/spec_helper.rb +2 -2
  41. metadata +55 -43
  42. data/.ruby-style.yml +0 -240
  43. data/lib/shipcloud/request/validator.rb +0 -33
  44. data/spec/shipcloud/request/validator_spec.rb +0 -24
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: be261ed61c16ba184adf29c75d3c40721eefc397
4
- data.tar.gz: 54e6e380adc84a996c581726a8e3c0a47e60a6bf
2
+ SHA256:
3
+ metadata.gz: c02bb6ec8a1171602ea41180a0bb4609240459c2408aab0c81b177f83a50212a
4
+ data.tar.gz: 2d61e2c834ef542ffc4b42129cf387970b4679054de7297cf7b2e46dfee8a5e6
5
5
  SHA512:
6
- metadata.gz: 64d988f7fdf9d858e240f132282da454c0bd814b30accc290d045ca17bcf73fce67c370293d1db75b53facff9d9918ace79fcaa4fd99e592fdad0398cfad3340
7
- data.tar.gz: 19ca529bafdf0764d357e0652fe55019a7a84b0d1a5ce8d5c3d5514b571635af6eac92291b2381d084596dc14fbede14a3caf3119997a8518f9603b45645eb83
6
+ metadata.gz: 59672a57bb6cc357b53ee612ca7c3845eb21f1e9557a42d93682a9e8ffc939da950b167db1b42229ac60cef400deaf49ad5e0fb5332f1c05695dff5d149f0cfb
7
+ data.tar.gz: 1543d7e8832c8228b19e69c2ad9f6840fb14c79fb8d85afb5a73c6785684356927e7f135b1a23ab048adcf835b8ea2a746380162f953a585b49c00d83fd0cb82
@@ -12,6 +12,7 @@ engines:
12
12
  enabled: true
13
13
  rubocop:
14
14
  enabled: true
15
+ channel: rubocop-0-71
15
16
  ratings:
16
17
  paths:
17
18
  - "**.inc"
data/.hound.yml CHANGED
@@ -1,5 +1,5 @@
1
1
  ruby:
2
- config_file: .ruby-style.yml
2
+ config_file: .rubocop.yml
3
3
  scss:
4
4
  enabled: false
5
5
  coffeescript:
@@ -1,2 +1,713 @@
1
- inherit_from:
2
- - .ruby-style.yml
1
+ require: rubocop-performance
2
+
3
+ AllCops:
4
+ TargetRubyVersion: 2.6
5
+ Exclude:
6
+ - vendor/**/*
7
+ - bin/*
8
+
9
+ Naming/AccessorMethodName:
10
+ Description: Check the naming of accessor methods for get_/set_.
11
+ Enabled: false
12
+
13
+ Naming/AsciiIdentifiers:
14
+ Description: 'Use only ascii symbols in identifiers.'
15
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#english-identifiers'
16
+ Enabled: false
17
+
18
+ Naming/FileName:
19
+ Description: 'Use snake_case for source file names.'
20
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#snake-case-files'
21
+ Enabled: false
22
+
23
+ Naming/BinaryOperatorParameterName:
24
+ Description: 'When defining binary operators, name the argument other.'
25
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#other-arg'
26
+ Enabled: false
27
+
28
+ Naming/MemoizedInstanceVariableName:
29
+ Description: Memoized method name should match memo instance variable name.
30
+ Enabled: true
31
+ EnforcedStyleForLeadingUnderscores: required
32
+
33
+ Naming/PredicateName:
34
+ Description: 'Check the names of predicate methods.'
35
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#bool-methods-qmark'
36
+ NamePrefix:
37
+ - is_
38
+ - has_
39
+ - have_
40
+ NamePrefixBlacklist:
41
+ - is_
42
+ Exclude:
43
+ - spec/**/*
44
+
45
+ Naming/RescuedExceptionsVariableName:
46
+ Description: 'Use consistent rescued exceptions variables naming.'
47
+ Enabled: true
48
+ PreferredName: error
49
+
50
+ Style/Alias:
51
+ Description: 'Use alias_method instead of alias.'
52
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#alias-method'
53
+ Enabled: false
54
+
55
+ Style/ArrayJoin:
56
+ Description: 'Use Array#join instead of Array#*.'
57
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#array-join'
58
+ Enabled: false
59
+
60
+ Style/AsciiComments:
61
+ Description: 'Use only ascii symbols in comments.'
62
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#english-comments'
63
+ Enabled: false
64
+
65
+ Style/Attr:
66
+ Description: 'Checks for uses of Module#attr.'
67
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#attr'
68
+ Enabled: false
69
+
70
+ Style/CaseEquality:
71
+ Description: 'Avoid explicit use of the case equality operator(===).'
72
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-case-equality'
73
+ Enabled: false
74
+
75
+ Style/CharacterLiteral:
76
+ Description: 'Checks for uses of character literals.'
77
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-character-literals'
78
+ Enabled: false
79
+
80
+ Style/ClassAndModuleChildren:
81
+ Description: 'Checks style of children classes and modules.'
82
+ Enabled: true
83
+ EnforcedStyle: nested
84
+
85
+ Style/ClassVars:
86
+ Description: 'Avoid the use of class variables.'
87
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-class-vars'
88
+ Enabled: false
89
+
90
+ Style/CollectionMethods:
91
+ Enabled: true
92
+ PreferredMethods:
93
+ find: detect
94
+ reduce: inject
95
+ collect: map
96
+ collect!: map!
97
+ find_all: select
98
+
99
+ Style/ColonMethodCall:
100
+ Description: 'Do not use :: for method call.'
101
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#double-colons'
102
+ Enabled: false
103
+
104
+ Style/CommentAnnotation:
105
+ Description: >-
106
+ Checks formatting of special comments
107
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#annotate-keywords'
108
+ Enabled: false
109
+
110
+ Style/PreferredHashMethods:
111
+ Description: 'Checks use of `has_key?` and `has_value?` Hash methods.'
112
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#hash-key'
113
+ Enabled: false
114
+
115
+ Style/Documentation:
116
+ Description: 'Document classes and non-namespace modules.'
117
+ Enabled: false
118
+
119
+ Style/DoubleNegation:
120
+ Description: 'Checks for uses of double negation (!!).'
121
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-bang-bang'
122
+ Enabled: false
123
+
124
+ Style/EachWithObject:
125
+ Description: 'Prefer `each_with_object` over `inject` or `reduce`.'
126
+ Enabled: false
127
+
128
+ Style/EmptyLiteral:
129
+ Description: 'Prefer literals to Array.new/Hash.new/String.new.'
130
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#literal-array-hash'
131
+ Enabled: false
132
+
133
+ # Checks whether the source file has a utf-8 encoding comment or not
134
+ # AutoCorrectEncodingComment must match the regex
135
+ # /#.*coding\s?[:=]\s?(?:UTF|utf)-8/
136
+ Style/Encoding:
137
+ Enabled: false
138
+
139
+ Style/EvenOdd:
140
+ Description: 'Favor the use of Fixnum#even? && Fixnum#odd?'
141
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#predicate-methods'
142
+ Enabled: false
143
+
144
+ Lint/FlipFlop:
145
+ Description: 'Checks for flip flops'
146
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-flip-flops'
147
+ Enabled: false
148
+
149
+ Style/FormatString:
150
+ Description: 'Enforce the use of Kernel#sprintf, Kernel#format or String#%.'
151
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#sprintf'
152
+ Enabled: false
153
+
154
+ Style/GlobalVars:
155
+ Description: 'Do not introduce global variables.'
156
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#instance-vars'
157
+ Reference: 'http://www.zenspider.com/Languages/Ruby/QuickRef.html'
158
+ Enabled: false
159
+
160
+ Style/GuardClause:
161
+ Description: 'Check for conditionals that can be replaced with guard clauses'
162
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals'
163
+ Enabled: false
164
+
165
+ Style/IfUnlessModifier:
166
+ Description: >-
167
+ Favor modifier if/unless usage when you have a
168
+ single-line body.
169
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#if-as-a-modifier'
170
+ Enabled: false
171
+
172
+ Style/IfWithSemicolon:
173
+ Description: 'Do not use if x; .... Use the ternary operator instead.'
174
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-semicolon-ifs'
175
+ Enabled: false
176
+
177
+ Style/InlineComment:
178
+ Description: 'Avoid inline comments.'
179
+ Enabled: false
180
+
181
+ Style/IpAddresses:
182
+ Description: "Don't include literal IP addresses in code."
183
+ Enabled: true
184
+
185
+ Style/Lambda:
186
+ Description: 'Use the new lambda literal syntax for single-line blocks.'
187
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#lambda-multi-line'
188
+ Enabled: false
189
+
190
+ Style/LambdaCall:
191
+ Description: 'Use lambda.call(...) instead of lambda.(...).'
192
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#proc-call'
193
+ Enabled: false
194
+
195
+ Style/LineEndConcatenation:
196
+ Description: >-
197
+ Use \ instead of + or << to concatenate two string literals at
198
+ line end.
199
+ Enabled: false
200
+
201
+ Style/ModuleFunction:
202
+ Description: 'Checks for usage of `extend self` in modules.'
203
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#module-function'
204
+ Enabled: false
205
+
206
+ Style/MultilineBlockChain:
207
+ Description: 'Avoid multi-line chains of blocks.'
208
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#single-line-blocks'
209
+ Enabled: false
210
+
211
+ Style/NegatedIf:
212
+ Description: >-
213
+ Favor unless over if for negative conditions
214
+ (or control flow or).
215
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#unless-for-negatives'
216
+ Enabled: false
217
+
218
+ Style/NegatedWhile:
219
+ Description: 'Favor until over while for negative conditions.'
220
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#until-for-negatives'
221
+ Enabled: false
222
+
223
+ Style/Next:
224
+ Description: 'Use `next` to skip iteration instead of a condition at the end.'
225
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals'
226
+ Enabled: false
227
+
228
+ Style/NilComparison:
229
+ Description: 'Prefer x.nil? to x == nil.'
230
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#predicate-methods'
231
+ Enabled: false
232
+
233
+ Style/Not:
234
+ Description: 'Use ! instead of not.'
235
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#bang-not-not'
236
+ Enabled: false
237
+
238
+ Style/NumericLiterals:
239
+ Description: >-
240
+ Add underscores to large numeric literals to improve their
241
+ readability.
242
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscores-in-numerics'
243
+ Enabled: false
244
+
245
+ Style/OneLineConditional:
246
+ Description: >-
247
+ Favor the ternary operator(?:) over
248
+ if/then/else/end constructs.
249
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#ternary-operator'
250
+ Enabled: false
251
+
252
+ Style/PercentLiteralDelimiters:
253
+ Description: 'Use `%`-literal delimiters consistently'
254
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-literal-braces'
255
+ Enabled: false
256
+
257
+ Style/PerlBackrefs:
258
+ Description: 'Avoid Perl-style regex back references.'
259
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-perl-regexp-last-matchers'
260
+ Enabled: false
261
+
262
+ Style/Proc:
263
+ Description: 'Use proc instead of Proc.new.'
264
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#proc'
265
+ Enabled: false
266
+
267
+ Style/RaiseArgs:
268
+ Description: 'Checks the arguments passed to raise/fail.'
269
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#exception-class-messages'
270
+ Enabled: false
271
+
272
+ Style/RegexpLiteral:
273
+ Description: 'Use / or %r around regular expressions.'
274
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-r'
275
+ Enabled: false
276
+
277
+ Style/Sample:
278
+ Description: >-
279
+ Use `sample` instead of `shuffle.first`,
280
+ `shuffle.last`, and `shuffle[Fixnum]`.
281
+ Reference: 'https://github.com/JuanitoFatas/fast-ruby#arrayshufflefirst-vs-arraysample-code'
282
+ Enabled: false
283
+
284
+ Style/SelfAssignment:
285
+ Description: >-
286
+ Checks for places where self-assignment shorthand should have
287
+ been used.
288
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#self-assignment'
289
+ Enabled: false
290
+
291
+ Style/SingleLineBlockParams:
292
+ Description: 'Enforces the names of some block params.'
293
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#reduce-blocks'
294
+ Enabled: false
295
+
296
+ Style/SingleLineMethods:
297
+ Description: 'Avoid single-line methods.'
298
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-single-line-methods'
299
+ Enabled: false
300
+
301
+ Style/SignalException:
302
+ Description: 'Checks for proper usage of fail and raise.'
303
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#fail-method'
304
+ Enabled: false
305
+
306
+ Style/SpecialGlobalVars:
307
+ Description: 'Avoid Perl-style global variables.'
308
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-cryptic-perlisms'
309
+ Enabled: false
310
+
311
+ Style/StringLiterals:
312
+ Description: 'Checks if uses of quotes match the configured preference.'
313
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#consistent-string-literals'
314
+ EnforcedStyle: double_quotes
315
+ Enabled: true
316
+
317
+ Style/StringLiteralsInInterpolation:
318
+ Description: >-
319
+ Checks if uses of quotes inside expressions in interpolated strings
320
+ match the configured preference.
321
+ Enabled: true
322
+ EnforcedStyle: single_quotes
323
+ SupportedStyles:
324
+ - single_quotes
325
+ - double_quotes
326
+
327
+ Style/SymbolArray:
328
+ Enabled: false
329
+
330
+ Style/TrailingCommaInArguments:
331
+ Description: 'Checks for trailing comma in argument lists.'
332
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
333
+ EnforcedStyleForMultiline: comma
334
+ SupportedStylesForMultiline:
335
+ - comma
336
+ - consistent_comma
337
+ - no_comma
338
+ Enabled: true
339
+
340
+ Style/TrailingCommaInArrayLiteral:
341
+ Description: 'Checks for trailing comma in array literals.'
342
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
343
+ EnforcedStyleForMultiline: comma
344
+ SupportedStylesForMultiline:
345
+ - comma
346
+ - consistent_comma
347
+ - no_comma
348
+ Enabled: true
349
+
350
+ Style/TrailingCommaInHashLiteral:
351
+ Description: 'Checks for trailing comma in hash literals.'
352
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
353
+ EnforcedStyleForMultiline: comma
354
+ SupportedStylesForMultiline:
355
+ - comma
356
+ - consistent_comma
357
+ - no_comma
358
+ Enabled: true
359
+
360
+ Style/TrivialAccessors:
361
+ Description: 'Prefer attr_* methods to trivial readers/writers.'
362
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#attr_family'
363
+ Enabled: false
364
+
365
+ Style/VariableInterpolation:
366
+ Description: >-
367
+ Don\'t interpolate global, instance and class variables
368
+ directly in strings.
369
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#curlies-interpolate'
370
+ Enabled: false
371
+
372
+ Style/WhenThen:
373
+ Description: 'Use when x then ... for one-line cases.'
374
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#one-line-cases'
375
+ Enabled: false
376
+
377
+ Style/WhileUntilModifier:
378
+ Description: >-
379
+ Favor modifier while/until usage when you have a
380
+ single-line body.
381
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#while-as-a-modifier'
382
+ Enabled: false
383
+
384
+ Style/WordArray:
385
+ Description: 'Use %w or %W for arrays of words.'
386
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-w'
387
+ Enabled: false
388
+
389
+ Style/OptionHash:
390
+ Description: Don\'t use option hashes when you can use keyword arguments.
391
+ SuspiciousParamNames:
392
+ - options
393
+ - opts
394
+ - args
395
+ - params
396
+ - parameters
397
+ Enabled: true
398
+
399
+ # Layout
400
+
401
+ Layout/ConditionPosition:
402
+ Description: >-
403
+ Checks for condition placed in a confusing position relative to
404
+ the keyword.
405
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#same-line-condition'
406
+ Enabled: false
407
+
408
+ Layout/DotPosition:
409
+ Description: 'Checks the position of the dot in multi-line method calls.'
410
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains'
411
+ EnforcedStyle: trailing
412
+
413
+ Layout/EmptyLineAfterMagicComment:
414
+ Description: 'Add an empty line after magic comments to separate them from code.'
415
+ StyleGuide: '#separate-magic-comments-from-code'
416
+ Enabled: false
417
+
418
+ Layout/ExtraSpacing:
419
+ Description: 'Do not use unnecessary spacing.'
420
+ Enabled: true
421
+
422
+ Layout/FirstArrayElementLineBreak:
423
+ Description: >-
424
+ Checks for a line break before the first element in a
425
+ multi-line array.
426
+ Enabled: true
427
+
428
+ Layout/FirstHashElementLineBreak:
429
+ Description: >-
430
+ Checks for a line break before the first element in a
431
+ multi-line hash.
432
+ Enabled: true
433
+
434
+ Layout/FirstMethodArgumentLineBreak:
435
+ Description: >-
436
+ Checks for a line break before the first argument in a
437
+ multi-line method call.
438
+ Enabled: true
439
+
440
+ Layout/InitialIndentation:
441
+ Description: >-
442
+ Checks the indentation of the first non-blank non-comment line in a file.
443
+ Enabled: false
444
+
445
+ Layout/MultilineMethodCallIndentation:
446
+ Description: >-
447
+ Checks indentation of method calls with the dot operator
448
+ that span more than one line.
449
+ Enabled: true
450
+ EnforcedStyle: indented
451
+
452
+ Layout/MultilineOperationIndentation:
453
+ Description: >-
454
+ Checks indentation of binary operations that span more than
455
+ one line.
456
+ Enabled: true
457
+ EnforcedStyle: indented
458
+
459
+ # Lint
460
+
461
+ Lint/AmbiguousOperator:
462
+ Description: >-
463
+ Checks for ambiguous operators in the first argument of a
464
+ method invocation without parentheses.
465
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-as-args'
466
+ Enabled: false
467
+
468
+ Lint/AmbiguousRegexpLiteral:
469
+ Description: >-
470
+ Checks for ambiguous regexp literals in the first argument of
471
+ a method invocation without parenthesis.
472
+ Enabled: false
473
+
474
+ Lint/AssignmentInCondition:
475
+ Description: "Don't use assignment in conditions."
476
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#safe-assignment-in-condition'
477
+ Enabled: false
478
+
479
+ Lint/CircularArgumentReference:
480
+ Description: "Don't refer to the keyword argument in the default value."
481
+ Enabled: true
482
+
483
+ Lint/DeprecatedClassMethods:
484
+ Description: 'Check for deprecated class method calls.'
485
+ Enabled: false
486
+
487
+ Lint/DuplicatedKey:
488
+ Description: 'Check for duplicate keys in hash literals.'
489
+ Enabled: false
490
+
491
+ Lint/EachWithObjectArgument:
492
+ Description: 'Check for immutable argument given to each_with_object.'
493
+ Enabled: false
494
+
495
+ Lint/ElseLayout:
496
+ Description: 'Check for odd code arrangement in an else block.'
497
+ Enabled: false
498
+
499
+ Lint/FormatParameterMismatch:
500
+ Description: 'The number of parameters to format/sprint must match the fields.'
501
+ Enabled: false
502
+
503
+ Lint/HandleExceptions:
504
+ Description: "Don't suppress exception."
505
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#dont-hide-exceptions'
506
+ Enabled: false
507
+
508
+ Lint/LiteralAsCondition:
509
+ Description: 'Checks of literals used in conditions.'
510
+ Enabled: false
511
+
512
+ Lint/LiteralInInterpolation:
513
+ Description: 'Checks for literals used in interpolation.'
514
+ Enabled: false
515
+
516
+ Lint/Loop:
517
+ Description: >-
518
+ Use Kernel#loop with break rather than begin/end/until or
519
+ begin/end/while for post-loop tests.
520
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#loop-with-break'
521
+ Enabled: false
522
+
523
+ Lint/NestedMethodDefinition:
524
+ Description: 'Do not use nested method definitions.'
525
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-methods'
526
+ Enabled: false
527
+
528
+ Lint/NonLocalExitFromIterator:
529
+ Description: 'Do not use return in iterator to cause non-local exit.'
530
+ Enabled: false
531
+
532
+ Lint/ParenthesesAsGroupedExpression:
533
+ Description: >-
534
+ Checks for method calls with a space before the opening
535
+ parenthesis.
536
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-no-spaces'
537
+ Enabled: false
538
+
539
+ Lint/RequireParentheses:
540
+ Description: >-
541
+ Use parentheses in the method call to avoid confusion
542
+ about precedence.
543
+ Enabled: false
544
+
545
+ Lint/UnderscorePrefixedVariableName:
546
+ Description: 'Do not use prefix `_` for a variable that is used.'
547
+ Enabled: false
548
+
549
+ Lint/UnneededCopDisableDirective:
550
+ Description: >-
551
+ Checks for rubocop:disable comments that can be removed.
552
+ Note: this cop is not disabled when disabling all cops.
553
+ It must be explicitly disabled.
554
+ Enabled: false
555
+
556
+ Lint/Void:
557
+ Description: 'Possible use of operator/literal/variable in void context.'
558
+ Enabled: false
559
+
560
+ # Metrics
561
+
562
+ Metrics/AbcSize:
563
+ Description: >-
564
+ A calculated magnitude based on number of assignments,
565
+ branches, and conditions.
566
+ Enabled: false
567
+
568
+ Metrics/BlockLength:
569
+ Description: 'Avoid long blocks with many lines.'
570
+ Enabled: true
571
+ Exclude:
572
+ - "gems/**/*_spec.rb"
573
+ - "spec/**/*"
574
+ - "config/routes.rb"
575
+
576
+ Metrics/BlockNesting:
577
+ Description: 'Avoid excessive block nesting'
578
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#three-is-the-number-thou-shalt-count'
579
+ Enabled: false
580
+
581
+ Metrics/ClassLength:
582
+ Description: 'Avoid classes longer than 100 lines of code.'
583
+ Enabled: false
584
+
585
+ Metrics/CyclomaticComplexity:
586
+ Description: >-
587
+ A complexity metric that is strongly correlated to the number
588
+ of test cases needed to validate a method.
589
+ Enabled: false
590
+
591
+ Metrics/LineLength:
592
+ Description: 'Limit lines to 100 characters.'
593
+ Max: 100
594
+
595
+ Metrics/MethodLength:
596
+ Description: 'Avoid methods longer than 10 lines of code.'
597
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#short-methods'
598
+ Enabled: false
599
+
600
+ Metrics/ModuleLength:
601
+ Description: 'Avoid modules longer than 100 lines of code.'
602
+ Enabled: false
603
+
604
+ Metrics/ParameterLists:
605
+ Description: 'Avoid parameter lists longer than three or four parameters.'
606
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#too-many-params'
607
+ Enabled: false
608
+
609
+ # Performance
610
+
611
+ Performance/CaseWhenSplat:
612
+ Description: >-
613
+ Place `when` conditions that use splat at the end
614
+ of the list of `when` branches.
615
+ Enabled: false
616
+
617
+ Performance/Count:
618
+ Description: >-
619
+ Use `count` instead of `select...size`, `reject...size`,
620
+ `select...count`, `reject...count`, `select...length`,
621
+ and `reject...length`.
622
+ Enabled: false
623
+
624
+ Performance/Detect:
625
+ Description: >-
626
+ Use `detect` instead of `select.first`, `find_all.first`,
627
+ `select.last`, and `find_all.last`.
628
+ Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerabledetect-vs-enumerableselectfirst-code'
629
+ Enabled: false
630
+
631
+ Performance/FlatMap:
632
+ Description: >-
633
+ Use `Enumerable#flat_map`
634
+ instead of `Enumerable#map...Array#flatten(1)`
635
+ or `Enumberable#collect..Array#flatten(1)`
636
+ Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerablemaparrayflatten-vs-enumerableflat_map-code'
637
+ Enabled: false
638
+
639
+ Performance/ReverseEach:
640
+ Description: 'Use `reverse_each` instead of `reverse.each`.'
641
+ Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerablereverseeach-vs-enumerablereverse_each-code'
642
+ Enabled: false
643
+
644
+ Performance/Size:
645
+ Description: >-
646
+ Use `size` instead of `count` for counting
647
+ the number of elements in `Array` and `Hash`.
648
+ Reference: 'https://github.com/JuanitoFatas/fast-ruby#arraycount-vs-arraysize-code'
649
+ Enabled: false
650
+
651
+ Performance/StringReplacement:
652
+ Description: >-
653
+ Use `tr` instead of `gsub` when you are replacing the same
654
+ number of characters. Use `delete` instead of `gsub` when
655
+ you are deleting characters.
656
+ Reference: 'https://github.com/JuanitoFatas/fast-ruby#stringgsub-vs-stringtr-code'
657
+ Enabled: false
658
+
659
+ Performance/UnfreezeString:
660
+ Description: 'Use unary plus to get an unfrozen string literal.'
661
+ Enabled: false
662
+
663
+ # Rails
664
+
665
+ Rails/ActionFilter:
666
+ Description: 'Enforces consistent use of action filter methods.'
667
+ Enabled: false
668
+
669
+ Rails/Date:
670
+ Description: >-
671
+ Checks the correct usage of date aware methods,
672
+ such as Date.today, Date.current etc.
673
+ Enabled: false
674
+
675
+ Rails/Delegate:
676
+ Description: 'Prefer delegate method for delegations.'
677
+ Enabled: false
678
+
679
+ Rails/FindBy:
680
+ Description: 'Prefer find_by over where.first.'
681
+ Enabled: false
682
+
683
+ Rails/FindEach:
684
+ Description: 'Prefer all.find_each over all.find.'
685
+ Enabled: false
686
+
687
+ Rails/HasAndBelongsToMany:
688
+ Description: 'Prefer has_many :through to has_and_belongs_to_many.'
689
+ Enabled: false
690
+
691
+ Rails/Output:
692
+ Description: 'Checks for calls to puts, print, etc.'
693
+ Enabled: false
694
+
695
+ Rails/ReadWriteAttribute:
696
+ Description: >-
697
+ Checks for read_attribute(:attr) and
698
+ write_attribute(:attr, val).
699
+ Enabled: false
700
+
701
+ Rails/ScopeArgs:
702
+ Description: 'Checks the arguments of ActiveRecord scopes.'
703
+ Enabled: false
704
+
705
+ Rails/TimeZone:
706
+ Description: 'Checks the correct usage of time zone aware methods.'
707
+ StyleGuide: 'https://github.com/bbatsov/rails-style-guide#time'
708
+ Reference: 'http://danilenko.org/2012/7/6/rails_timezones'
709
+ Enabled: false
710
+
711
+ Rails/Validation:
712
+ Description: 'Use validates :attribute, hash of validations.'
713
+ Enabled: false