active_record_api-rest 0.1.9 → 1.0.1
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.
- checksums.yaml +4 -4
- data/.rubocop.yml +185 -189
- data/Gemfile.lock +2 -4
- data/active_record_api-rest.gemspec +0 -1
- data/lib/active_record_api-rest.rb +4 -1
- data/lib/active_record_api/rest/access_denied_exception.rb +12 -0
- data/lib/active_record_api/rest/application_policy.rb +33 -0
- data/lib/active_record_api/rest/bad_session_exception.rb +6 -0
- data/lib/active_record_api/rest/controller.rb +15 -0
- data/lib/active_record_api/rest/graceful_errors.rb +3 -3
- data/lib/active_record_api/rest/index_controller.rb +5 -26
- data/lib/active_record_api/rest/spec/rest_controller_shared_example.rb +51 -51
- data/lib/active_record_api/rest/version.rb +1 -1
- metadata +5 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e8066e4649685e45f994e6cf6d2975c57d1167eab487c60c7f79fb82d5c410c2
|
4
|
+
data.tar.gz: 4eb7bd79fcb480b8bb53e75095266170e1e9521bce9b01c8428f6e93c205a61c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e4602cd84f863255c587d4c72d0a1b8e138cbdb16aaf1b9262fa816c9720de9562d5bfb881d8227ff592971c8374e1ef53223098c9b561db135beb5d48abd8ae
|
7
|
+
data.tar.gz: 4d33364248faef9855720999dc49d229fe35b5bd9af68ec5cfef29482e23b0e9dd3364c25fa26d24231cb7dddd328be9b0f7bb3a4b7ea5c6dd0c42126eff659c
|
data/.rubocop.yml
CHANGED
@@ -1,20 +1,20 @@
|
|
1
1
|
AllCops:
|
2
2
|
DisabledByDefault: true
|
3
|
-
TargetRubyVersion: 2.5
|
3
|
+
TargetRubyVersion: 2.5
|
4
4
|
|
5
5
|
#################### Lint ################################
|
6
6
|
|
7
7
|
Lint/AmbiguousOperator:
|
8
8
|
Description: >-
|
9
|
-
|
10
|
-
|
9
|
+
Checks for ambiguous operators in the first argument of a
|
10
|
+
method invocation without parentheses.
|
11
11
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-as-args'
|
12
12
|
Enabled: true
|
13
13
|
|
14
14
|
Lint/AmbiguousRegexpLiteral:
|
15
15
|
Description: >-
|
16
|
-
|
17
|
-
|
16
|
+
Checks for ambiguous regexp literals in the first argument of
|
17
|
+
a method invocation without parenthesis.
|
18
18
|
Enabled: true
|
19
19
|
|
20
20
|
Lint/AssignmentInCondition:
|
@@ -22,7 +22,7 @@ Lint/AssignmentInCondition:
|
|
22
22
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#safe-assignment-in-condition'
|
23
23
|
Enabled: true
|
24
24
|
|
25
|
-
|
25
|
+
Layout/BlockAlignment:
|
26
26
|
Description: 'Align block ends correctly.'
|
27
27
|
Enabled: true
|
28
28
|
|
@@ -30,10 +30,10 @@ Lint/CircularArgumentReference:
|
|
30
30
|
Description: "Don't refer to the keyword argument in the default value."
|
31
31
|
Enabled: true
|
32
32
|
|
33
|
-
|
33
|
+
Layout/ConditionPosition:
|
34
34
|
Description: >-
|
35
|
-
|
36
|
-
|
35
|
+
Checks for condition placed in a confusing position relative to
|
36
|
+
the keyword.
|
37
37
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#same-line-condition'
|
38
38
|
Enabled: true
|
39
39
|
|
@@ -41,7 +41,7 @@ Lint/Debugger:
|
|
41
41
|
Description: 'Check for debugger calls.'
|
42
42
|
Enabled: true
|
43
43
|
|
44
|
-
|
44
|
+
Layout/DefEndAlignment:
|
45
45
|
Description: 'Align ends corresponding to defs correctly.'
|
46
46
|
Enabled: true
|
47
47
|
|
@@ -69,7 +69,7 @@ Lint/EmptyInterpolation:
|
|
69
69
|
Description: 'Checks for empty string interpolation.'
|
70
70
|
Enabled: true
|
71
71
|
|
72
|
-
|
72
|
+
Layout/EndAlignment:
|
73
73
|
Description: 'Align ends correctly.'
|
74
74
|
Enabled: true
|
75
75
|
|
@@ -82,7 +82,7 @@ Lint/EnsureReturn:
|
|
82
82
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-return-ensure'
|
83
83
|
Enabled: true
|
84
84
|
|
85
|
-
|
85
|
+
Security/Eval:
|
86
86
|
Description: 'The use of eval represents a serious security risk.'
|
87
87
|
Enabled: true
|
88
88
|
|
@@ -95,12 +95,6 @@ Lint/HandleExceptions:
|
|
95
95
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#dont-hide-exceptions'
|
96
96
|
Enabled: true
|
97
97
|
|
98
|
-
Lint/InvalidCharacterLiteral:
|
99
|
-
Description: >-
|
100
|
-
Checks for invalid character literals with a non-escaped
|
101
|
-
whitespace character.
|
102
|
-
Enabled: true
|
103
|
-
|
104
98
|
Lint/LiteralInCondition:
|
105
99
|
Description: 'Checks of literals used in conditions.'
|
106
100
|
Enabled: true
|
@@ -111,8 +105,8 @@ Lint/LiteralInInterpolation:
|
|
111
105
|
|
112
106
|
Lint/Loop:
|
113
107
|
Description: >-
|
114
|
-
|
115
|
-
|
108
|
+
Use Kernel#loop with break rather than begin/end/until or
|
109
|
+
begin/end/while for post-loop tests.
|
116
110
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#loop-with-break'
|
117
111
|
Enabled: true
|
118
112
|
|
@@ -127,15 +121,15 @@ Lint/NonLocalExitFromIterator:
|
|
127
121
|
|
128
122
|
Lint/ParenthesesAsGroupedExpression:
|
129
123
|
Description: >-
|
130
|
-
|
131
|
-
|
124
|
+
Checks for method calls with a space before the opening
|
125
|
+
parenthesis.
|
132
126
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-no-spaces'
|
133
127
|
Enabled: true
|
134
128
|
|
135
129
|
Lint/RequireParentheses:
|
136
130
|
Description: >-
|
137
|
-
|
138
|
-
|
131
|
+
Use parentheses in the method call to avoid confusion
|
132
|
+
about precedence.
|
139
133
|
Enabled: true
|
140
134
|
|
141
135
|
Lint/RescueException:
|
@@ -145,8 +139,8 @@ Lint/RescueException:
|
|
145
139
|
|
146
140
|
Lint/ShadowingOuterLocalVariable:
|
147
141
|
Description: >-
|
148
|
-
|
149
|
-
|
142
|
+
Do not use the same name as outer local variable
|
143
|
+
for block arguments or block local variables.
|
150
144
|
Enabled: true
|
151
145
|
|
152
146
|
Lint/StringConversionInInterpolation:
|
@@ -160,9 +154,9 @@ Lint/UnderscorePrefixedVariableName:
|
|
160
154
|
|
161
155
|
Lint/UnneededDisable:
|
162
156
|
Description: >-
|
163
|
-
|
164
|
-
|
165
|
-
|
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.
|
166
160
|
Enabled: true
|
167
161
|
|
168
162
|
Lint/UnusedBlockArgument:
|
@@ -212,8 +206,8 @@ Lint/UnifiedInteger:
|
|
212
206
|
|
213
207
|
Metrics/AbcSize:
|
214
208
|
Description: >-
|
215
|
-
|
216
|
-
|
209
|
+
A calculated magnitude based on number of assignments,
|
210
|
+
branches, and conditions.
|
217
211
|
Reference: 'http://c2.com/cgi/wiki?AbcMetric'
|
218
212
|
Enabled: true
|
219
213
|
Max: 20
|
@@ -231,8 +225,8 @@ Metrics/ClassLength:
|
|
231
225
|
|
232
226
|
Metrics/CyclomaticComplexity:
|
233
227
|
Description: >-
|
234
|
-
|
235
|
-
|
228
|
+
A complexity metric that is strongly correlated to the number
|
229
|
+
of test cases needed to validate a method.
|
236
230
|
Enabled: true
|
237
231
|
|
238
232
|
Metrics/LineLength:
|
@@ -258,31 +252,31 @@ Metrics/ParameterLists:
|
|
258
252
|
|
259
253
|
Metrics/PerceivedComplexity:
|
260
254
|
Description: >-
|
261
|
-
|
262
|
-
|
255
|
+
A complexity metric geared towards measuring complexity for a
|
256
|
+
human reader.
|
263
257
|
Enabled: true
|
264
258
|
|
265
259
|
##################### Performance #############################
|
266
260
|
|
267
261
|
Performance/Count:
|
268
262
|
Description: >-
|
269
|
-
|
270
|
-
|
271
|
-
|
263
|
+
Use `count` instead of `select...size`, `reject...size`,
|
264
|
+
`select...count`, `reject...count`, `select...length`,
|
265
|
+
and `reject...length`.
|
272
266
|
Enabled: true
|
273
267
|
|
274
268
|
Performance/Detect:
|
275
269
|
Description: >-
|
276
|
-
|
277
|
-
|
270
|
+
Use `detect` instead of `select.first`, `find_all.first`,
|
271
|
+
`select.last`, and `find_all.last`.
|
278
272
|
Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerabledetect-vs-enumerableselectfirst-code'
|
279
273
|
Enabled: true
|
280
274
|
|
281
275
|
Performance/FlatMap:
|
282
276
|
Description: >-
|
283
|
-
|
284
|
-
|
285
|
-
|
277
|
+
Use `Enumerable#flat_map`
|
278
|
+
instead of `Enumerable#map...Array#flatten(1)`
|
279
|
+
or `Enumberable#collect..Array#flatten(1)`
|
286
280
|
Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerablemaparrayflatten-vs-enumerableflat_map-code'
|
287
281
|
Enabled: true
|
288
282
|
EnabledForFlattenWithoutParams: true
|
@@ -302,23 +296,23 @@ Performance/RedundantBlockCall:
|
|
302
296
|
|
303
297
|
Performance/Sample:
|
304
298
|
Description: >-
|
305
|
-
|
306
|
-
|
299
|
+
Use `sample` instead of `shuffle.first`,
|
300
|
+
`shuffle.last`, and `shuffle[Fixnum]`.
|
307
301
|
Reference: 'https://github.com/JuanitoFatas/fast-ruby#arrayshufflefirst-vs-arraysample-code'
|
308
302
|
Enabled: true
|
309
303
|
|
310
304
|
Performance/Size:
|
311
305
|
Description: >-
|
312
|
-
|
313
|
-
|
306
|
+
Use `size` instead of `count` for counting
|
307
|
+
the number of elements in `Array` and `Hash`.
|
314
308
|
Reference: 'https://github.com/JuanitoFatas/fast-ruby#arraycount-vs-arraysize-code'
|
315
309
|
Enabled: true
|
316
310
|
|
317
311
|
Performance/StringReplacement:
|
318
312
|
Description: >-
|
319
|
-
|
320
|
-
|
321
|
-
|
313
|
+
Use `tr` instead of `gsub` when you are replacing the same
|
314
|
+
number of characters. Use `delete` instead of `gsub` when
|
315
|
+
you are deleting characters.
|
322
316
|
Reference: 'https://github.com/JuanitoFatas/fast-ruby#stringgsub-vs-stringtr-code'
|
323
317
|
Enabled: true
|
324
318
|
|
@@ -330,8 +324,8 @@ Rails/ActionFilter:
|
|
330
324
|
|
331
325
|
Rails/Date:
|
332
326
|
Description: >-
|
333
|
-
|
334
|
-
|
327
|
+
Checks the correct usage of date aware methods,
|
328
|
+
such as Date.today, Date.current etc.
|
335
329
|
Enabled: true
|
336
330
|
|
337
331
|
Rails/Delegate:
|
@@ -356,8 +350,8 @@ Rails/Output:
|
|
356
350
|
|
357
351
|
Rails/ReadWriteAttribute:
|
358
352
|
Description: >-
|
359
|
-
|
360
|
-
|
353
|
+
Checks for read_attribute(:attr) and
|
354
|
+
write_attribute(:attr, val).
|
361
355
|
Enabled: true
|
362
356
|
|
363
357
|
Rails/ScopeArgs:
|
@@ -381,15 +375,12 @@ Bundler/OrderedGems:
|
|
381
375
|
|
382
376
|
################## Style #################################
|
383
377
|
|
384
|
-
|
385
|
-
Enabled: true
|
386
|
-
|
387
|
-
Style/AccessModifierIndentation:
|
378
|
+
Layout/AccessModifierIndentation:
|
388
379
|
Description: Check indentation of private/protected visibility modifiers.
|
389
380
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#indent-public-private-protected'
|
390
381
|
Enabled: true
|
391
382
|
|
392
|
-
|
383
|
+
Naming/AccessorMethodName:
|
393
384
|
Description: Check the naming of accessor methods for get_/set_.
|
394
385
|
Enabled: true
|
395
386
|
|
@@ -408,23 +399,23 @@ Style/MutableConstant:
|
|
408
399
|
StyleGuide: ''
|
409
400
|
Enabled: true
|
410
401
|
|
411
|
-
|
402
|
+
Layout/AlignArray:
|
412
403
|
Description: >-
|
413
|
-
|
414
|
-
|
404
|
+
Align the elements of an array literal if they span more than
|
405
|
+
one line.
|
415
406
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#align-multiline-arrays'
|
416
407
|
Enabled: true
|
417
408
|
|
418
|
-
|
409
|
+
Layout/AlignHash:
|
419
410
|
Description: >-
|
420
|
-
|
421
|
-
|
411
|
+
Align the elements of a hash literal if they span more than
|
412
|
+
one line.
|
422
413
|
Enabled: true
|
423
414
|
|
424
|
-
|
415
|
+
Layout/AlignParameters:
|
425
416
|
Description: >-
|
426
|
-
|
427
|
-
|
417
|
+
Align the parameters of a method call if they span more
|
418
|
+
than one line.
|
428
419
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-double-indent'
|
429
420
|
Enabled: true
|
430
421
|
|
@@ -443,7 +434,7 @@ Style/AsciiComments:
|
|
443
434
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#english-comments'
|
444
435
|
Enabled: true
|
445
436
|
|
446
|
-
|
437
|
+
Naming/AsciiIdentifiers:
|
447
438
|
Description: 'Use only ascii symbols in identifiers.'
|
448
439
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#english-identifiers'
|
449
440
|
Enabled: true
|
@@ -468,15 +459,15 @@ Style/BlockComments:
|
|
468
459
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-block-comments'
|
469
460
|
Enabled: false
|
470
461
|
|
471
|
-
|
462
|
+
Layout/BlockEndNewline:
|
472
463
|
Description: 'Put end statement of multiline block on its own line.'
|
473
464
|
Enabled: true
|
474
465
|
|
475
466
|
Style/BlockDelimiters:
|
476
467
|
Description: >-
|
477
|
-
|
478
|
-
|
479
|
-
|
468
|
+
Avoid using {...} for multi-line blocks (multiline chaining is
|
469
|
+
always ugly).
|
470
|
+
Prefer {...} over do...end for single-line blocks.
|
480
471
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#single-line-blocks'
|
481
472
|
Enabled: true
|
482
473
|
|
@@ -489,7 +480,7 @@ Style/CaseEquality:
|
|
489
480
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-case-equality'
|
490
481
|
Enabled: true
|
491
482
|
|
492
|
-
|
483
|
+
Layout/CaseIndentation:
|
493
484
|
Description: 'Indentation of when in a case/when/[else/]end.'
|
494
485
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#indent-when-to-case'
|
495
486
|
Enabled: false
|
@@ -499,7 +490,7 @@ Style/CharacterLiteral:
|
|
499
490
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-character-literals'
|
500
491
|
Enabled: true
|
501
492
|
|
502
|
-
|
493
|
+
Naming/ClassAndModuleCamelCase:
|
503
494
|
Description: 'Use CamelCase for classes and modules.'
|
504
495
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#camelcase-classes'
|
505
496
|
Enabled: true
|
@@ -522,7 +513,7 @@ Style/ClassVars:
|
|
522
513
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-class-vars'
|
523
514
|
Enabled: true
|
524
515
|
|
525
|
-
|
516
|
+
Layout/ClosingParenthesisIndentation:
|
526
517
|
Description: 'Checks the indentation of hanging closing parentheses.'
|
527
518
|
Enabled: true
|
528
519
|
|
@@ -541,11 +532,11 @@ Style/CommentAnnotation:
|
|
541
532
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#annotate-keywords'
|
542
533
|
Enabled: true
|
543
534
|
|
544
|
-
|
535
|
+
Layout/CommentIndentation:
|
545
536
|
Description: 'Indentation of comments.'
|
546
537
|
Enabled: true
|
547
538
|
|
548
|
-
|
539
|
+
Naming/ConstantName:
|
549
540
|
Description: 'Constants should use SCREAMING_SNAKE_CASE.'
|
550
541
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#screaming-snake-case'
|
551
542
|
Enabled: true
|
@@ -555,7 +546,7 @@ Style/DefWithParentheses:
|
|
555
546
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#method-parens'
|
556
547
|
Enabled: true
|
557
548
|
|
558
|
-
Style/
|
549
|
+
Style/PreferredHashMethods:
|
559
550
|
Description: 'Checks for use of deprecated Hash methods.'
|
560
551
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#hash-key'
|
561
552
|
Enabled: true
|
@@ -564,7 +555,7 @@ Style/Documentation:
|
|
564
555
|
Description: 'Document classes and non-namespace modules.'
|
565
556
|
Enabled: false
|
566
557
|
|
567
|
-
|
558
|
+
Layout/DotPosition:
|
568
559
|
Description: 'Checks the position of the dot in multi-line method calls.'
|
569
560
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains'
|
570
561
|
Enabled: true
|
@@ -578,7 +569,7 @@ Style/EachWithObject:
|
|
578
569
|
Description: 'Prefer `each_with_object` over `inject` or `reduce`.'
|
579
570
|
Enabled: true
|
580
571
|
|
581
|
-
|
572
|
+
Layout/ElseAlignment:
|
582
573
|
Description: 'Align elses and elsifs correctly.'
|
583
574
|
Enabled: true
|
584
575
|
|
@@ -590,32 +581,32 @@ Style/IfInsideElse:
|
|
590
581
|
Description: 'Convert if nested inside else to elsif.'
|
591
582
|
Enabled: true
|
592
583
|
|
593
|
-
|
584
|
+
Layout/EmptyLineBetweenDefs:
|
594
585
|
Description: 'Use empty lines between defs.'
|
595
586
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#empty-lines-between-methods'
|
596
587
|
Enabled: true
|
597
588
|
|
598
|
-
|
589
|
+
Layout/EmptyLines:
|
599
590
|
Description: "Don't use several empty lines in a row."
|
600
591
|
Enabled: true
|
601
592
|
|
602
|
-
|
593
|
+
Layout/EmptyLinesAroundAccessModifier:
|
603
594
|
Description: "Keep blank lines around access modifiers."
|
604
595
|
Enabled: true
|
605
596
|
|
606
|
-
|
597
|
+
Layout/EmptyLinesAroundBlockBody:
|
607
598
|
Description: "Keeps track of empty lines around block bodies."
|
608
599
|
Enabled: true
|
609
600
|
|
610
|
-
|
601
|
+
Layout/EmptyLinesAroundClassBody:
|
611
602
|
Description: "Keeps track of empty lines around class bodies."
|
612
603
|
Enabled: true
|
613
604
|
|
614
|
-
|
605
|
+
Layout/EmptyLinesAroundModuleBody:
|
615
606
|
Description: "Keeps track of empty lines around module bodies."
|
616
607
|
Enabled: true
|
617
608
|
|
618
|
-
|
609
|
+
Layout/EmptyLinesAroundMethodBody:
|
619
610
|
Description: "Keeps track of empty lines around method bodies."
|
620
611
|
Enabled: true
|
621
612
|
|
@@ -629,7 +620,7 @@ Style/EndBlock:
|
|
629
620
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-END-blocks'
|
630
621
|
Enabled: true
|
631
622
|
|
632
|
-
|
623
|
+
Layout/EndOfLine:
|
633
624
|
Description: 'Use Unix-style line endings.'
|
634
625
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#crlf'
|
635
626
|
Enabled: true
|
@@ -639,22 +630,22 @@ Style/EvenOdd:
|
|
639
630
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#predicate-methods'
|
640
631
|
Enabled: true
|
641
632
|
|
642
|
-
|
633
|
+
Layout/ExtraSpacing:
|
643
634
|
Description: 'Do not use unnecessary spacing.'
|
644
635
|
Enabled: true
|
645
636
|
AllowForAlignment: true
|
646
637
|
|
647
|
-
|
638
|
+
Naming/FileName:
|
648
639
|
Description: 'Use snake_case for source file names.'
|
649
640
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#snake-case-files'
|
650
641
|
Enabled: true
|
651
642
|
|
652
|
-
|
643
|
+
Layout/InitialIndentation:
|
653
644
|
Description: >-
|
654
645
|
Checks the indentation of the first non-blank non-comment line in a file.
|
655
646
|
Enabled: true
|
656
647
|
|
657
|
-
|
648
|
+
Layout/FirstParameterIndentation:
|
658
649
|
Description: 'Checks the indentation of the first parameter in a method call.'
|
659
650
|
Enabled: true
|
660
651
|
|
@@ -686,15 +677,15 @@ Style/GuardClause:
|
|
686
677
|
|
687
678
|
Style/HashSyntax:
|
688
679
|
Description: >-
|
689
|
-
|
690
|
-
|
680
|
+
Prefer Ruby 1.9 hash syntax { a: 1, b: 2 } over 1.8 syntax
|
681
|
+
{ :a => 1, :b => 2 }.
|
691
682
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#hash-literals'
|
692
683
|
Enabled: true
|
693
684
|
|
694
685
|
Style/IfUnlessModifier:
|
695
686
|
Description: >-
|
696
|
-
|
697
|
-
|
687
|
+
Favor modifier if/unless usage when you have a
|
688
|
+
single-line body.
|
698
689
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#if-as-a-modifier'
|
699
690
|
Enabled: false
|
700
691
|
|
@@ -703,22 +694,22 @@ Style/IfWithSemicolon:
|
|
703
694
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-semicolon-ifs'
|
704
695
|
Enabled: true
|
705
696
|
|
706
|
-
|
697
|
+
Layout/IndentationConsistency:
|
707
698
|
Description: 'Keep indentation straight.'
|
708
699
|
Enabled: true
|
709
700
|
|
710
|
-
|
701
|
+
Layout/IndentationWidth:
|
711
702
|
Description: 'Use 2 spaces for indentation.'
|
712
703
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-indentation'
|
713
704
|
Enabled: true
|
714
705
|
|
715
|
-
|
706
|
+
Layout/IndentArray:
|
716
707
|
Description: >-
|
717
|
-
|
718
|
-
|
708
|
+
Checks the indentation of the first element in an array
|
709
|
+
literal.
|
719
710
|
Enabled: true
|
720
711
|
|
721
|
-
|
712
|
+
Layout/IndentHash:
|
722
713
|
Description: 'Checks the indentation of the first key in a hash literal.'
|
723
714
|
Enabled: true
|
724
715
|
|
@@ -737,30 +728,30 @@ Style/LambdaCall:
|
|
737
728
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#proc-call'
|
738
729
|
Enabled: true
|
739
730
|
|
740
|
-
|
731
|
+
Layout/LeadingCommentSpace:
|
741
732
|
Description: 'Comments should start with a space.'
|
742
733
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#hash-space'
|
743
734
|
Enabled: true
|
744
735
|
|
745
736
|
Style/LineEndConcatenation:
|
746
737
|
Description: >-
|
747
|
-
|
748
|
-
|
738
|
+
Use \ instead of + or << to concatenate two string literals at
|
739
|
+
line end.
|
749
740
|
Enabled: true
|
750
741
|
|
751
|
-
Style/
|
742
|
+
Style/MethodCallWithoutArgsParentheses:
|
752
743
|
Description: 'Do not use parentheses for method calls with no arguments.'
|
753
744
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-args-no-parens'
|
754
745
|
Enabled: true
|
755
746
|
|
756
747
|
Style/MethodDefParentheses:
|
757
748
|
Description: >-
|
758
|
-
|
759
|
-
|
749
|
+
Checks if the method definitions have or don't have
|
750
|
+
parentheses.
|
760
751
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#method-parens'
|
761
752
|
Enabled: true
|
762
753
|
|
763
|
-
|
754
|
+
Naming/MethodName:
|
764
755
|
Description: 'Use the configured style when naming methods.'
|
765
756
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#snake-case-symbols-methods-vars'
|
766
757
|
Enabled: true
|
@@ -775,7 +766,7 @@ Style/MultilineBlockChain:
|
|
775
766
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#single-line-blocks'
|
776
767
|
Enabled: true
|
777
768
|
|
778
|
-
|
769
|
+
Layout/MultilineBlockLayout:
|
779
770
|
Description: 'Ensures newlines after multiline block do statements.'
|
780
771
|
Enabled: true
|
781
772
|
|
@@ -784,23 +775,23 @@ Style/MultilineIfThen:
|
|
784
775
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-then'
|
785
776
|
Enabled: true
|
786
777
|
|
787
|
-
|
778
|
+
Layout/MultilineOperationIndentation:
|
788
779
|
Description: >-
|
789
|
-
|
790
|
-
|
780
|
+
Checks indentation of binary operations that span more than
|
781
|
+
one line.
|
791
782
|
Enabled: true
|
792
783
|
|
793
784
|
Style/MultilineTernaryOperator:
|
794
785
|
Description: >-
|
795
|
-
|
796
|
-
|
786
|
+
Avoid multi-line ?: (the ternary operator);
|
787
|
+
use if/unless instead.
|
797
788
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-multiline-ternary'
|
798
789
|
Enabled: true
|
799
790
|
|
800
791
|
Style/NegatedIf:
|
801
792
|
Description: >-
|
802
|
-
|
803
|
-
|
793
|
+
Favor unless over if for negative conditions
|
794
|
+
(or control flow or).
|
804
795
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#unless-for-negatives'
|
805
796
|
Enabled: true
|
806
797
|
|
@@ -836,43 +827,43 @@ Style/Not:
|
|
836
827
|
|
837
828
|
Style/NumericLiterals:
|
838
829
|
Description: >-
|
839
|
-
|
840
|
-
|
830
|
+
Add underscores to large numeric literals to improve their
|
831
|
+
readability.
|
841
832
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscores-in-numerics'
|
842
833
|
Enabled: true
|
843
834
|
|
844
835
|
Style/OneLineConditional:
|
845
836
|
Description: >-
|
846
|
-
|
847
|
-
|
837
|
+
Favor the ternary operator(?:) over
|
838
|
+
if/then/else/end constructs.
|
848
839
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#ternary-operator'
|
849
840
|
Enabled: true
|
850
841
|
|
851
|
-
|
842
|
+
Naming/OpMethod:
|
852
843
|
Description: 'When defining binary operators, name the argument other.'
|
853
844
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#other-arg'
|
854
845
|
Enabled: true
|
855
846
|
|
856
847
|
Style/OptionalArguments:
|
857
848
|
Description: >-
|
858
|
-
|
859
|
-
|
849
|
+
Checks for optional arguments that do not appear at the end
|
850
|
+
of the argument list
|
860
851
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#optional-arguments'
|
861
852
|
Enabled: true
|
862
853
|
|
863
854
|
Style/ParallelAssignment:
|
864
855
|
Description: >-
|
865
|
-
|
866
|
-
|
867
|
-
|
868
|
-
|
856
|
+
Check for simple usages of parallel assignment.
|
857
|
+
It will only warn when the number of variables
|
858
|
+
matches on both sides of the assignment.
|
859
|
+
This also provides performance benefits
|
869
860
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parallel-assignment'
|
870
861
|
Enabled: true
|
871
862
|
|
872
863
|
Style/ParenthesesAroundCondition:
|
873
864
|
Description: >-
|
874
|
-
|
875
|
-
|
865
|
+
Don't use parentheses around the condition of an
|
866
|
+
if/unless/while.
|
876
867
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-parens-if'
|
877
868
|
Enabled: true
|
878
869
|
|
@@ -890,7 +881,7 @@ Style/PerlBackrefs:
|
|
890
881
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-perl-regexp-last-matchers'
|
891
882
|
Enabled: true
|
892
883
|
|
893
|
-
|
884
|
+
Naming/PredicateName:
|
894
885
|
Description: 'Check the names of predicate methods.'
|
895
886
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#bool-methods-qmark'
|
896
887
|
Enabled: true
|
@@ -930,7 +921,7 @@ Style/RegexpLiteral:
|
|
930
921
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-r'
|
931
922
|
Enabled: true
|
932
923
|
|
933
|
-
|
924
|
+
Layout/RescueEnsureAlignment:
|
934
925
|
Description: 'Align rescues and ensures correctly.'
|
935
926
|
Enabled: true
|
936
927
|
|
@@ -941,8 +932,8 @@ Style/RescueModifier:
|
|
941
932
|
|
942
933
|
Style/SelfAssignment:
|
943
934
|
Description: >-
|
944
|
-
|
945
|
-
|
935
|
+
Checks for places where self-assignment shorthand should have
|
936
|
+
been used.
|
946
937
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#self-assignment'
|
947
938
|
Enabled: true
|
948
939
|
|
@@ -966,108 +957,108 @@ Style/SingleLineMethods:
|
|
966
957
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-single-line-methods'
|
967
958
|
Enabled: true
|
968
959
|
|
969
|
-
|
960
|
+
Layout/SpaceBeforeFirstArg:
|
970
961
|
Description: >-
|
971
|
-
|
972
|
-
|
962
|
+
Checks that exactly one space is used between a method name
|
963
|
+
and the first argument for method calls without parentheses.
|
973
964
|
Enabled: true
|
974
965
|
|
975
|
-
|
966
|
+
Layout/SpaceAfterColon:
|
976
967
|
Description: 'Use spaces after colons.'
|
977
968
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators'
|
978
969
|
Enabled: true
|
979
970
|
|
980
|
-
|
971
|
+
Layout/SpaceAfterComma:
|
981
972
|
Description: 'Use spaces after commas.'
|
982
973
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators'
|
983
974
|
Enabled: true
|
984
975
|
|
985
|
-
|
976
|
+
Layout/SpaceAroundKeyword:
|
986
977
|
Description: 'Use spaces around keywords.'
|
987
978
|
Enabled: true
|
988
979
|
|
989
|
-
|
980
|
+
Layout/SpaceAfterMethodName:
|
990
981
|
Description: >-
|
991
|
-
|
992
|
-
|
982
|
+
Do not put a space between a method name and the opening
|
983
|
+
parenthesis in a method definition.
|
993
984
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-no-spaces'
|
994
985
|
Enabled: true
|
995
986
|
|
996
|
-
|
987
|
+
Layout/SpaceAfterNot:
|
997
988
|
Description: Tracks redundant space after the ! operator.
|
998
989
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-space-bang'
|
999
990
|
Enabled: true
|
1000
991
|
|
1001
|
-
|
992
|
+
Layout/SpaceAfterSemicolon:
|
1002
993
|
Description: 'Use spaces after semicolons.'
|
1003
994
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators'
|
1004
995
|
Enabled: true
|
1005
996
|
|
1006
|
-
|
997
|
+
Layout/SpaceBeforeBlockBraces:
|
1007
998
|
Description: >-
|
1008
|
-
|
1009
|
-
|
999
|
+
Checks that the left block brace has or doesn't have space
|
1000
|
+
before it.
|
1010
1001
|
Enabled: true
|
1011
1002
|
|
1012
|
-
|
1003
|
+
Layout/SpaceBeforeComma:
|
1013
1004
|
Description: 'No spaces before commas.'
|
1014
1005
|
Enabled: true
|
1015
1006
|
|
1016
|
-
|
1007
|
+
Layout/SpaceBeforeComment:
|
1017
1008
|
Description: >-
|
1018
|
-
|
1019
|
-
|
1009
|
+
Checks for missing space between code and a comment on the
|
1010
|
+
same line.
|
1020
1011
|
Enabled: true
|
1021
1012
|
|
1022
|
-
|
1013
|
+
Layout/SpaceBeforeSemicolon:
|
1023
1014
|
Description: 'No spaces before semicolons.'
|
1024
1015
|
Enabled: true
|
1025
1016
|
|
1026
|
-
|
1017
|
+
Layout/SpaceInsideBlockBraces:
|
1027
1018
|
Description: >-
|
1028
|
-
|
1029
|
-
|
1030
|
-
|
1019
|
+
Checks that block braces have or don't have surrounding space.
|
1020
|
+
For blocks taking parameters, checks that the left brace has
|
1021
|
+
or doesn't have trailing space.
|
1031
1022
|
Enabled: true
|
1032
1023
|
|
1033
|
-
|
1024
|
+
Layout/SpaceAroundBlockParameters:
|
1034
1025
|
Description: 'Checks the spacing inside and after block parameters pipes.'
|
1035
1026
|
Enabled: true
|
1036
1027
|
|
1037
|
-
|
1028
|
+
Layout/SpaceAroundEqualsInParameterDefault:
|
1038
1029
|
Description: >-
|
1039
|
-
|
1040
|
-
|
1041
|
-
|
1030
|
+
Checks that the equals signs in parameter default assignments
|
1031
|
+
have or don't have surrounding space depending on
|
1032
|
+
configuration.
|
1042
1033
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-around-equals'
|
1043
1034
|
Enabled: true
|
1044
1035
|
|
1045
|
-
|
1036
|
+
Layout/SpaceAroundOperators:
|
1046
1037
|
Description: 'Use a single space around operators.'
|
1047
1038
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators'
|
1048
1039
|
Enabled: true
|
1049
1040
|
|
1050
|
-
|
1041
|
+
Layout/SpaceInsideBrackets:
|
1051
1042
|
Description: 'No spaces after [ or before ].'
|
1052
1043
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-spaces-braces'
|
1053
1044
|
Enabled: true
|
1054
1045
|
|
1055
|
-
|
1046
|
+
Layout/SpaceInsideHashLiteralBraces:
|
1056
1047
|
Description: "Use spaces inside hash literal braces - or don't."
|
1057
1048
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-operators'
|
1058
1049
|
Enabled: true
|
1059
1050
|
|
1060
|
-
|
1051
|
+
Layout/SpaceInsideParens:
|
1061
1052
|
Description: 'No spaces after ( or before ).'
|
1062
1053
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-spaces-braces'
|
1063
1054
|
Enabled: true
|
1064
1055
|
|
1065
|
-
|
1056
|
+
Layout/SpaceInsideRangeLiteral:
|
1066
1057
|
Description: 'No spaces inside range literals.'
|
1067
1058
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-space-inside-range-literals'
|
1068
1059
|
Enabled: true
|
1069
1060
|
|
1070
|
-
|
1061
|
+
Layout/SpaceInsideStringInterpolation:
|
1071
1062
|
Description: 'Checks for padding/surrounding spaces inside string interpolation.'
|
1072
1063
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#string-interpolation'
|
1073
1064
|
Enabled: true
|
@@ -1084,8 +1075,8 @@ Style/StringLiterals:
|
|
1084
1075
|
|
1085
1076
|
Style/StringLiteralsInInterpolation:
|
1086
1077
|
Description: >-
|
1087
|
-
|
1088
|
-
|
1078
|
+
Checks if uses of quotes inside expressions in interpolated
|
1079
|
+
strings match the configured preference.
|
1089
1080
|
Enabled: true
|
1090
1081
|
|
1091
1082
|
Style/StructInheritance:
|
@@ -1101,12 +1092,12 @@ Style/SymbolProc:
|
|
1101
1092
|
Description: 'Use symbols as procs instead of blocks when possible.'
|
1102
1093
|
Enabled: true
|
1103
1094
|
|
1104
|
-
|
1095
|
+
Layout/Tab:
|
1105
1096
|
Description: 'No hard tabs.'
|
1106
1097
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#spaces-indentation'
|
1107
1098
|
Enabled: true
|
1108
1099
|
|
1109
|
-
|
1100
|
+
Layout/TrailingBlankLines:
|
1110
1101
|
Description: 'Checks trailing blank lines and final newline.'
|
1111
1102
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#newline-eof'
|
1112
1103
|
Enabled: true
|
@@ -1116,12 +1107,17 @@ Style/TrailingCommaInArguments:
|
|
1116
1107
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-params-comma'
|
1117
1108
|
Enabled: true
|
1118
1109
|
|
1119
|
-
Style/
|
1120
|
-
Description: 'Checks for trailing comma in literals.'
|
1110
|
+
Style/TrailingCommaInArrayLiteral:
|
1111
|
+
Description: 'Checks for trailing comma in array literals.'
|
1112
|
+
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
|
1113
|
+
Enabled: true
|
1114
|
+
|
1115
|
+
Style/TrailingCommaInHashLiteral:
|
1116
|
+
Description: 'Checks for trailing comma in hash literals.'
|
1121
1117
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
|
1122
1118
|
Enabled: true
|
1123
1119
|
|
1124
|
-
|
1120
|
+
Layout/TrailingWhitespace:
|
1125
1121
|
Description: 'Avoid trailing whitespace.'
|
1126
1122
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-whitespace'
|
1127
1123
|
Enabled: true
|
@@ -1133,8 +1129,8 @@ Style/TrivialAccessors:
|
|
1133
1129
|
|
1134
1130
|
Style/UnlessElse:
|
1135
1131
|
Description: >-
|
1136
|
-
|
1137
|
-
|
1132
|
+
Do not use unless with else. Rewrite these with the positive
|
1133
|
+
case first.
|
1138
1134
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-else-with-unless'
|
1139
1135
|
Enabled: true
|
1140
1136
|
|
@@ -1149,18 +1145,18 @@ Style/UnneededPercentQ:
|
|
1149
1145
|
|
1150
1146
|
Style/TrailingUnderscoreVariable:
|
1151
1147
|
Description: >-
|
1152
|
-
|
1153
|
-
|
1148
|
+
Checks for the usage of unneeded trailing underscores at the
|
1149
|
+
end of parallel variable assignment.
|
1154
1150
|
Enabled: true
|
1155
1151
|
|
1156
1152
|
Style/VariableInterpolation:
|
1157
1153
|
Description: >-
|
1158
|
-
|
1159
|
-
|
1154
|
+
Don't interpolate global, instance and class variables
|
1155
|
+
directly in strings.
|
1160
1156
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#curlies-interpolate'
|
1161
1157
|
Enabled: true
|
1162
1158
|
|
1163
|
-
|
1159
|
+
Naming/VariableName:
|
1164
1160
|
Description: 'Use the configured style when naming variables.'
|
1165
1161
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#snake-case-symbols-methods-vars'
|
1166
1162
|
Enabled: true
|
@@ -1177,8 +1173,8 @@ Style/WhileUntilDo:
|
|
1177
1173
|
|
1178
1174
|
Style/WhileUntilModifier:
|
1179
1175
|
Description: >-
|
1180
|
-
|
1181
|
-
|
1176
|
+
Favor modifier while/until usage when you have a
|
1177
|
+
single-line body.
|
1182
1178
|
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#while-as-a-modifier'
|
1183
1179
|
Enabled: true
|
1184
1180
|
|
@@ -1190,18 +1186,18 @@ Style/WordArray:
|
|
1190
1186
|
Style/UnneededInterpolation:
|
1191
1187
|
Enabled: true
|
1192
1188
|
|
1193
|
-
|
1189
|
+
Layout/MultilineMethodCallIndentation:
|
1194
1190
|
Enabled: true
|
1195
1191
|
|
1196
|
-
|
1192
|
+
Layout/SpaceInLambdaLiteral:
|
1197
1193
|
SupportedStyles: require_space
|
1198
1194
|
Enabled: true
|
1199
1195
|
|
1200
|
-
|
1196
|
+
Layout/SpaceInsidePercentLiteralDelimiters:
|
1201
1197
|
Enabled: true
|
1202
1198
|
|
1203
1199
|
Style/EmptyMethod:
|
1204
1200
|
Enabled: true
|
1205
1201
|
|
1206
|
-
|
1202
|
+
Naming/VariableNumber:
|
1207
1203
|
Enabled: true
|