orcid 0.0.4 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (82) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +10 -0
  3. data/.hound.yml +793 -0
  4. data/.travis.yml +14 -0
  5. data/Gemfile +14 -0
  6. data/README.md +107 -6
  7. data/Rakefile +17 -9
  8. data/app/assets/images/orcid/.keep +0 -0
  9. data/app/controllers/orcid/application_controller.rb +13 -4
  10. data/app/controllers/orcid/profile_connections_controller.rb +34 -6
  11. data/app/controllers/orcid/profile_requests_controller.rb +18 -15
  12. data/app/models/orcid/profile.rb +15 -5
  13. data/app/models/orcid/profile_connection.rb +20 -20
  14. data/app/models/orcid/profile_request.rb +39 -20
  15. data/app/models/orcid/work.rb +45 -55
  16. data/app/models/orcid/work/xml_parser.rb +45 -0
  17. data/app/models/orcid/work/xml_renderer.rb +29 -0
  18. data/app/services/orcid/remote/profile_creation_service.rb +40 -32
  19. data/app/services/orcid/remote/profile_query_service.rb +82 -0
  20. data/app/services/orcid/remote/profile_query_service/query_parameter_builder.rb +43 -0
  21. data/app/services/orcid/remote/profile_query_service/search_response.rb +31 -0
  22. data/app/services/orcid/remote/service.rb +16 -13
  23. data/app/services/orcid/remote/work_service.rb +58 -43
  24. data/app/templates/orcid/work.template.v1.1.xml.erb +32 -1
  25. data/app/views/orcid/profile_connections/_orcid_connector.html.erb +14 -0
  26. data/app/views/orcid/profile_connections/new.html.erb +4 -4
  27. data/bin/rails +8 -0
  28. data/config/{application.yml → application.yml.example} +3 -13
  29. data/config/locales/orcid.en.yml +5 -1
  30. data/config/routes.rb +4 -2
  31. data/lib/generators/orcid/install/install_generator.rb +46 -7
  32. data/lib/orcid.rb +23 -11
  33. data/lib/orcid/configuration.rb +32 -13
  34. data/lib/orcid/configuration/provider.rb +27 -13
  35. data/lib/orcid/engine.rb +20 -4
  36. data/lib/orcid/exceptions.rb +33 -4
  37. data/lib/orcid/named_callbacks.rb +3 -1
  38. data/lib/orcid/spec_support.rb +19 -9
  39. data/lib/orcid/version.rb +1 -1
  40. data/lib/tasks/orcid_tasks.rake +3 -3
  41. data/orcid.gemspec +51 -0
  42. data/rubocop.txt +1164 -0
  43. data/script/fast_specs +22 -0
  44. data/spec/controllers/orcid/profile_connections_controller_spec.rb +101 -0
  45. data/spec/controllers/orcid/profile_requests_controller_spec.rb +116 -0
  46. data/spec/factories/orcid_profile_requests.rb +11 -0
  47. data/spec/factories/users.rb +9 -0
  48. data/spec/fast_helper.rb +12 -0
  49. data/spec/features/batch_profile_spec.rb +31 -0
  50. data/spec/features/non_ui_based_interactions_spec.rb +117 -0
  51. data/spec/features/profile_connection_feature_spec.rb +19 -0
  52. data/spec/features/public_api_query_spec.rb +36 -0
  53. data/spec/fixtures/orcid_works.xml +55 -0
  54. data/spec/lib/orcid/configuration/provider_spec.rb +40 -0
  55. data/spec/lib/orcid/configuration_spec.rb +38 -0
  56. data/spec/lib/orcid/named_callbacks_spec.rb +28 -0
  57. data/spec/lib/orcid_spec.rb +97 -0
  58. data/spec/models/orcid/profile_connection_spec.rb +81 -0
  59. data/spec/models/orcid/profile_request_spec.rb +131 -0
  60. data/spec/models/orcid/profile_spec.rb +76 -0
  61. data/spec/models/orcid/work/xml_parser_spec.rb +40 -0
  62. data/spec/models/orcid/work/xml_renderer_spec.rb +18 -0
  63. data/spec/models/orcid/work_spec.rb +53 -0
  64. data/spec/services/orcid/remote/profile_creation_service_spec.rb +40 -0
  65. data/spec/services/orcid/remote/profile_query_service/query_parameter_builder_spec.rb +44 -0
  66. data/spec/services/orcid/remote/profile_query_service/search_response_spec.rb +14 -0
  67. data/spec/services/orcid/remote/profile_query_service_spec.rb +118 -0
  68. data/spec/services/orcid/remote/service_spec.rb +26 -0
  69. data/spec/services/orcid/remote/work_service_spec.rb +44 -0
  70. data/spec/spec_helper.rb +99 -0
  71. data/spec/support/non_orcid_models.rb +11 -0
  72. data/spec/support/stub_callback.rb +25 -0
  73. data/spec/test_app_templates/Gemfile.extra +3 -0
  74. data/spec/test_app_templates/lib/generators/test_app_generator.rb +36 -0
  75. data/spec/views/orcid/profile_connections/new.html.erb_spec.rb +25 -0
  76. data/spec/views/orcid/profile_requests/new.html.erb_spec.rb +23 -0
  77. metadata +119 -29
  78. data/app/runners/orcid/profile_lookup_runner.rb +0 -33
  79. data/app/runners/orcid/runner.rb +0 -15
  80. data/app/services/orcid/remote/profile_lookup_service.rb +0 -56
  81. data/app/services/orcid/remote/profile_lookup_service/search_response.rb +0 -23
  82. data/lib/orcid/query_parameter_builder.rb +0 -38
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 76d282e5fe1e457a4e664b9744c7798a699868b0
4
- data.tar.gz: 8e9d224124856d459ba29a413116667553d16307
3
+ metadata.gz: 3e40e9249310d879d3d682f31e4ff96c8ddebd5c
4
+ data.tar.gz: c576d7845d3739142beecfdc6f828255129a9efb
5
5
  SHA512:
6
- metadata.gz: 1fbcf299a9e8d0701c2d42438f61d56094f35eda93bce08ba0b6829184616aeba9bf2eb9c149ae66a252433d77b5f5cfc7f41647c33e17071de1fb6ed12b123b
7
- data.tar.gz: 1bedcf2b30666c9e9131b52070641954dc334d5e26ee1eae3fb7f583735567efc63f32d31d0fbdc8660b13383c71ba173e5fc2e2aefec920089ab2267956a8cc
6
+ metadata.gz: cde6825fe3b611118f56bfc83195794bba75763d57f5d97c2c7f254c0e792db97cd1d6384a1b3c79a61e77a0718df64bde9ddb2e72ddde4d56b1bd2eaa0881c6
7
+ data.tar.gz: 585614520c7665086f36831ac18dd219693d02ae066bdf5b93e8f397780999503e90c4493eaaa20078ec762959ae8ce7bbebd2613f0c56e25b859d9a360c1a95
data/.gitignore ADDED
@@ -0,0 +1,10 @@
1
+ .bundle/
2
+ log/*.log
3
+ pkg/
4
+ spec/internal
5
+ Gemfile.lock
6
+ tmp/
7
+ config/application.yml
8
+ tags
9
+ .tags*
10
+ coverage/*
data/.hound.yml ADDED
@@ -0,0 +1,793 @@
1
+ ################################################################################
2
+ ## Releasing the hounds in your local environment.
3
+ ##
4
+ ## Setup:
5
+ ## $ gem install rubocop
6
+ ##
7
+ ## Run:
8
+ ## $ rubocop ./path/to/file ./or/path/to/directory -c ./.hound.yml
9
+ ##
10
+ ################################################################################
11
+
12
+ ################################################################################
13
+ ##
14
+ ## Custom options for Orcid
15
+ ## These options were plucked from below and modified accordingly.
16
+ ##
17
+ ################################################################################
18
+ MethodLength:
19
+ Max: 10
20
+ Description: 'Avoid methods longer than 10 lines of code.'
21
+ CountComments: false
22
+ Enabled: true
23
+
24
+ LineLength:
25
+ Description: 'Limit lines to 140 characters.'
26
+ Max: 140
27
+ Enabled: true
28
+
29
+ ClassLength:
30
+ Max: 100
31
+ Description: 'Avoid classes longer than 100 lines of code.'
32
+ CountComments: false
33
+ Enabled: true
34
+
35
+ ################################################################################
36
+ ##
37
+ ## Below this banner, the configuration options were copied from the following
38
+ ## URL:
39
+ ## https://raw.githubusercontent.com/bbatsov/rubocop/master/config/enabled.yml
40
+ ##
41
+ ################################################################################
42
+
43
+ # These are all the cops that are enabled in the default configuration.
44
+
45
+ AccessModifierIndentation:
46
+ Description: Check indentation of private/protected visibility modifiers.
47
+ Enabled: true
48
+
49
+ AccessorMethodName:
50
+ Description: Check the naming of accessor methods for get_/set_.
51
+ Enabled: true
52
+
53
+ Alias:
54
+ Description: 'Use alias_method instead of alias.'
55
+ Enabled: true
56
+
57
+ AlignArray:
58
+ Description: >-
59
+ Align the elements of an array literal if they span more than
60
+ one line.
61
+ Enabled: true
62
+
63
+ AlignHash:
64
+ Description: >-
65
+ Align the elements of a hash literal if they span more than
66
+ one line.
67
+ Enabled: true
68
+
69
+ AlignParameters:
70
+ Description: >-
71
+ Align the parameters of a method call if they span more
72
+ than one line.
73
+ Enabled: true
74
+
75
+ AndOr:
76
+ Description: 'Use &&/|| instead of and/or.'
77
+ Enabled: true
78
+
79
+ ArrayJoin:
80
+ Description: 'Use Array#join instead of Array#*.'
81
+ Enabled: true
82
+
83
+ AsciiComments:
84
+ Description: 'Use only ascii symbols in comments.'
85
+ Enabled: true
86
+
87
+ AsciiIdentifiers:
88
+ Description: 'Use only ascii symbols in identifiers.'
89
+ Enabled: true
90
+
91
+ Attr:
92
+ Description: 'Checks for uses of Module#attr.'
93
+ Enabled: true
94
+
95
+ BeginBlock:
96
+ Description: 'Avoid the use of BEGIN blocks.'
97
+ Enabled: true
98
+
99
+ BlockComments:
100
+ Description: 'Do not use block comments.'
101
+ Enabled: true
102
+
103
+ BlockNesting:
104
+ Description: 'Avoid excessive block nesting'
105
+ Enabled: true
106
+
107
+ Blocks:
108
+ Description: >-
109
+ Avoid using {...} for multi-line blocks (multiline chaining is
110
+ always ugly).
111
+ Prefer {...} over do...end for single-line blocks.
112
+ Enabled: true
113
+
114
+ BracesAroundHashParameters:
115
+ Description: 'Enforce braces style inside hash parameters.'
116
+ Enabled: true
117
+
118
+ CaseEquality:
119
+ Description: 'Avoid explicit use of the case equality operator(===).'
120
+ Enabled: true
121
+
122
+ CaseIndentation:
123
+ Description: 'Indentation of when in a case/when/[else/]end.'
124
+ Enabled: true
125
+
126
+ CharacterLiteral:
127
+ Description: 'Checks for uses of character literals.'
128
+ Enabled: true
129
+
130
+ ClassAndModuleCamelCase:
131
+ Description: 'Use CamelCase for classes and modules.'
132
+ Enabled: true
133
+
134
+ ClassAndModuleChildren:
135
+ Description: 'Checks style of children classes and modules.'
136
+ Enabled: true
137
+
138
+ ClassMethods:
139
+ Description: 'Use self when defining module/class methods.'
140
+ Enabled: true
141
+
142
+ ClassVars:
143
+ Description: 'Avoid the use of class variables.'
144
+ Enabled: true
145
+
146
+ CollectionMethods:
147
+ Description: 'Preferred collection methods.'
148
+ Enabled: true
149
+
150
+ ColonMethodCall:
151
+ Description: 'Do not use :: for method call.'
152
+ Enabled: true
153
+
154
+ CommentAnnotation:
155
+ Description: >-
156
+ Checks formatting of special comments
157
+ (TODO, FIXME, OPTIMIZE, HACK, REVIEW).
158
+ Enabled: true
159
+
160
+ CommentIndentation:
161
+ Description: 'Indentation of comments.'
162
+ Enabled: true
163
+
164
+ ConstantName:
165
+ Description: 'Constants should use SCREAMING_SNAKE_CASE.'
166
+ Enabled: true
167
+
168
+ CyclomaticComplexity:
169
+ Description: 'Avoid complex methods.'
170
+ Enabled: true
171
+
172
+ DefWithParentheses:
173
+ Description: 'Use def with parentheses when there are arguments.'
174
+ Enabled: true
175
+
176
+ Delegate:
177
+ Description: 'Prefer delegate method for delegations.'
178
+ Enabled: true
179
+
180
+ DeprecatedHashMethods:
181
+ Description: 'Checks for use of deprecated Hash methods.'
182
+ Enabled: true
183
+
184
+ Documentation:
185
+ Description: 'Document classes and non-namespace modules.'
186
+ Enabled: true
187
+
188
+ DotPosition:
189
+ Description: 'Checks the position of the dot in multi-line method calls.'
190
+ Enabled: true
191
+
192
+ DoubleNegation:
193
+ Description: 'Checks for uses of double negation (!!).'
194
+ Enabled: true
195
+
196
+ EachWithObject:
197
+ Description: 'Prefer `each_with_object` over `inject` or `reduce`.'
198
+ Enabled: true
199
+
200
+ EmptyLineBetweenDefs:
201
+ Description: 'Use empty lines between defs.'
202
+ Enabled: true
203
+
204
+ EmptyLines:
205
+ Description: "Don't use several empty lines in a row."
206
+ Enabled: true
207
+
208
+ EmptyLinesAroundAccessModifier:
209
+ Description: "Keep blank lines around access modifiers."
210
+ Enabled: true
211
+
212
+ EmptyLinesAroundBody:
213
+ Description: "Keeps track of empty lines around expression bodies."
214
+ Enabled: true
215
+
216
+ EmptyLiteral:
217
+ Description: 'Prefer literals to Array.new/Hash.new/String.new.'
218
+ Enabled: true
219
+
220
+ Encoding:
221
+ Description: 'Use UTF-8 as the source file encoding.'
222
+ Enabled: true
223
+
224
+ EndBlock:
225
+ Description: 'Avoid the use of END blocks.'
226
+ Enabled: true
227
+
228
+ EndOfLine:
229
+ Description: 'Use Unix-style line endings.'
230
+ Enabled: true
231
+
232
+ EvenOdd:
233
+ Description: 'Favor the use of Fixnum#even? && Fixnum#odd?'
234
+ Enabled: true
235
+
236
+ FileName:
237
+ Description: 'Use snake_case for source file names.'
238
+ Enabled: true
239
+
240
+ FlipFlop:
241
+ Description: 'Checks for flip flops'
242
+ Enabled: true
243
+
244
+ For:
245
+ Description: 'Checks use of for or each in multiline loops.'
246
+ Enabled: true
247
+
248
+ FormatString:
249
+ Description: 'Enforce the use of Kernel#sprintf, Kernel#format or String#%.'
250
+ Enabled: true
251
+
252
+ GlobalVars:
253
+ Description: 'Do not introduce global variables.'
254
+ Enabled: true
255
+
256
+ HashSyntax:
257
+ Description: >-
258
+ Prefer Ruby 1.9 hash syntax { a: 1, b: 2 } over 1.8 syntax
259
+ { :a => 1, :b => 2 }.
260
+ Enabled: true
261
+
262
+ IfUnlessModifier:
263
+ Description: >-
264
+ Favor modifier if/unless usage when you have a
265
+ single-line body.
266
+ Enabled: true
267
+
268
+ IfWithSemicolon:
269
+ Description: 'Never use if x; .... Use the ternary operator instead.'
270
+ Enabled: true
271
+
272
+ IndentationConsistency:
273
+ Description: 'Keep indentation straight.'
274
+ Enabled: true
275
+
276
+ IndentationWidth:
277
+ Description: 'Use 2 spaces for indentation.'
278
+ Enabled: true
279
+
280
+ IndentArray:
281
+ Description: >-
282
+ Checks the indentation of the first element in an array
283
+ literal.
284
+ Enabled: true
285
+
286
+ IndentHash:
287
+ Description: 'Checks the indentation of the first key in a hash literal.'
288
+ Enabled: true
289
+
290
+ Lambda:
291
+ Description: 'Use the new lambda literal syntax for single-line blocks.'
292
+ Enabled: true
293
+
294
+ LambdaCall:
295
+ Description: 'Use lambda.call(...) instead of lambda.(...).'
296
+ Enabled: true
297
+
298
+ LeadingCommentSpace:
299
+ Description: 'Comments should start with a space.'
300
+ Enabled: true
301
+
302
+ LineEndConcatenation:
303
+ Description: >-
304
+ Use \ instead of + or << to concatenate two string literals at
305
+ line end.
306
+ Enabled: true
307
+
308
+ MethodCallParentheses:
309
+ Description: 'Do not use parentheses for method calls with no arguments.'
310
+ Enabled: true
311
+
312
+ MethodDefParentheses:
313
+ Description: >-
314
+ Checks if the method definitions have or don't have
315
+ parentheses.
316
+ Enabled: true
317
+
318
+ MethodName:
319
+ Description: 'Use the configured style when naming methods.'
320
+ Enabled: true
321
+
322
+ ModuleFunction:
323
+ Description: 'Checks for usage of `extend self` in modules.'
324
+ Enabled: true
325
+
326
+ MultilineBlockChain:
327
+ Description: 'Avoid multi-line chains of blocks.'
328
+ Enabled: true
329
+
330
+ MultilineIfThen:
331
+ Description: 'Never use then for multi-line if/unless.'
332
+ Enabled: true
333
+
334
+ MultilineTernaryOperator:
335
+ Description: >-
336
+ Avoid multi-line ?: (the ternary operator);
337
+ use if/unless instead.
338
+ Enabled: true
339
+
340
+ NegatedIf:
341
+ Description: >-
342
+ Favor unless over if for negative conditions
343
+ (or control flow or).
344
+ Enabled: true
345
+
346
+ NegatedWhile:
347
+ Description: 'Favor until over while for negative conditions.'
348
+ Enabled: true
349
+
350
+ NestedTernaryOperator:
351
+ Description: 'Use one expression per branch in a ternary operator.'
352
+ Enabled: true
353
+
354
+ Next:
355
+ Description: 'Use `next` to skip iteration instead of a condition at the end.'
356
+ Enabled: true
357
+
358
+ NilComparison:
359
+ Description: 'Prefer x.nil? to x == nil.'
360
+ Enabled: true
361
+
362
+ NonNilCheck:
363
+ Description: 'Checks for redundant nil checks.'
364
+ Enabled: true
365
+
366
+ Not:
367
+ Description: 'Use ! instead of not.'
368
+ Enabled: true
369
+
370
+ NumericLiterals:
371
+ Description: >-
372
+ Add underscores to large numeric literals to improve their
373
+ readability.
374
+ Enabled: true
375
+
376
+ OneLineConditional:
377
+ Description: >-
378
+ Favor the ternary operator(?:) over
379
+ if/then/else/end constructs.
380
+ Enabled: true
381
+
382
+ OpMethod:
383
+ Description: 'When defining binary operators, name the argument other.'
384
+ Enabled: true
385
+
386
+ ParameterLists:
387
+ Description: 'Avoid parameter lists longer than three or four parameters.'
388
+ Enabled: true
389
+
390
+ ParenthesesAroundCondition:
391
+ Description: >-
392
+ Don't use parentheses around the condition of an
393
+ if/unless/while.
394
+ Enabled: true
395
+
396
+ PercentLiteralDelimiters:
397
+ Description: 'Use `%`-literal delimiters consistently'
398
+ Enabled: true
399
+
400
+ PerlBackrefs:
401
+ Description: 'Avoid Perl-style regex back references.'
402
+ Enabled: true
403
+
404
+ PredicateName:
405
+ Description: 'Check the names of predicate methods.'
406
+ Enabled: true
407
+
408
+ Proc:
409
+ Description: 'Use proc instead of Proc.new.'
410
+ Enabled: true
411
+
412
+ RaiseArgs:
413
+ Description: 'Checks the arguments passed to raise/fail.'
414
+ Enabled: true
415
+
416
+ RedundantBegin:
417
+ Description: "Don't use begin blocks when they are not needed."
418
+ Enabled: true
419
+
420
+ RedundantException:
421
+ Description: "Checks for an obsolete RuntimeException argument in raise/fail."
422
+ Enabled: true
423
+
424
+ RedundantReturn:
425
+ Description: "Don't use return where it's not required."
426
+ Enabled: true
427
+
428
+ RedundantSelf:
429
+ Description: "Don't use self where it's not needed."
430
+ Enabled: true
431
+
432
+ RegexpLiteral:
433
+ Description: >-
434
+ Use %r for regular expressions matching more than
435
+ `MaxSlashes` '/' characters.
436
+ Use %r only for regular expressions matching more than
437
+ `MaxSlashes` '/' character.
438
+ Enabled: true
439
+
440
+ RescueModifier:
441
+ Description: 'Avoid using rescue in its modifier form.'
442
+ Enabled: true
443
+
444
+ SelfAssignment:
445
+ Description: 'Checks for places where self-assignment shorthand should have been used.'
446
+ Enabled: true
447
+
448
+ Semicolon:
449
+ Description: "Don't use semicolons to terminate expressions."
450
+ Enabled: true
451
+
452
+ SignalException:
453
+ Description: 'Checks for proper usage of fail and raise.'
454
+ Enabled: true
455
+
456
+ SingleLineBlockParams:
457
+ Description: 'Enforces the names of some block params.'
458
+ Enabled: true
459
+
460
+ SingleLineMethods:
461
+ Description: 'Avoid single-line methods.'
462
+ Enabled: true
463
+
464
+ SingleSpaceBeforeFirstArg:
465
+ Description: >-
466
+ Checks that exactly one space is used between a method name
467
+ and the first argument for method calls without parentheses.
468
+ Enabled: true
469
+
470
+ SpaceAfterColon:
471
+ Description: 'Use spaces after colons.'
472
+ Enabled: true
473
+
474
+ SpaceAfterComma:
475
+ Description: 'Use spaces after commas.'
476
+ Enabled: true
477
+
478
+ SpaceAfterControlKeyword:
479
+ Description: 'Use spaces after if/elsif/unless/while/until/case/when.'
480
+ Enabled: true
481
+
482
+ SpaceAfterMethodName:
483
+ Description: >-
484
+ Never put a space between a method name and the opening
485
+ parenthesis in a method definition.
486
+ Enabled: true
487
+
488
+ SpaceAfterNot:
489
+ Description: Tracks redundant space after the ! operator.
490
+ Enabled: true
491
+
492
+ SpaceAfterSemicolon:
493
+ Description: 'Use spaces after semicolons.'
494
+ Enabled: true
495
+
496
+ SpaceBeforeBlockBraces:
497
+ Description: >-
498
+ Checks that the left block brace has or doesn't have space
499
+ before it.
500
+ Enabled: true
501
+
502
+ SpaceInsideBlockBraces:
503
+ Description: >-
504
+ Checks that block braces have or don't have surrounding space.
505
+ For blocks taking parameters, checks that the left brace has
506
+ or doesn't have trailing space.
507
+ Enabled: true
508
+
509
+ SpaceAroundEqualsInParameterDefault:
510
+ Description: >-
511
+ Checks that the equals signs in parameter default assignments
512
+ have or don't have surrounding space depending on
513
+ configuration.
514
+ Enabled: true
515
+
516
+ SpaceAroundOperators:
517
+ Description: 'Use spaces around operators.'
518
+ Enabled: true
519
+
520
+ SpaceBeforeModifierKeyword:
521
+ Description: 'Put a space before the modifier keyword.'
522
+ Enabled: true
523
+
524
+ SpaceInsideBrackets:
525
+ Description: 'No spaces after [ or before ].'
526
+ Enabled: true
527
+
528
+ SpaceInsideHashLiteralBraces:
529
+ Description: "Use spaces inside hash literal braces - or don't."
530
+ Enabled: true
531
+
532
+ SpaceInsideParens:
533
+ Description: 'No spaces after ( or before ).'
534
+ Enabled: true
535
+
536
+ SpecialGlobalVars:
537
+ Description: 'Avoid Perl-style global variables.'
538
+ Enabled: true
539
+
540
+ StringLiterals:
541
+ Description: 'Checks if uses of quotes match the configured preference.'
542
+ Enabled: true
543
+
544
+ Tab:
545
+ Description: 'No hard tabs.'
546
+ Enabled: true
547
+
548
+ TrailingBlankLines:
549
+ Description: 'Checks trailing blank lines and final newline.'
550
+ Enabled: true
551
+
552
+ TrailingComma:
553
+ Description: 'Checks for trailing comma in parameter lists and literals.'
554
+ Enabled: true
555
+
556
+ TrailingWhitespace:
557
+ Description: 'Avoid trailing whitespace.'
558
+ Enabled: true
559
+
560
+ TrivialAccessors:
561
+ Description: 'Prefer attr_* methods to trivial readers/writers.'
562
+ Enabled: true
563
+
564
+ UnlessElse:
565
+ Description: >-
566
+ Never use unless with else. Rewrite these with the positive
567
+ case first.
568
+ Enabled: true
569
+
570
+ UnneededCapitalW:
571
+ Description: 'Checks for %W when interpolation is not needed.'
572
+ Enabled: true
573
+
574
+ VariableInterpolation:
575
+ Description: >-
576
+ Don't interpolate global, instance and class variables
577
+ directly in strings.
578
+ Enabled: true
579
+
580
+ VariableName:
581
+ Description: 'Use the configured style when naming variables.'
582
+ Enabled: true
583
+
584
+ WhenThen:
585
+ Description: 'Use when x then ... for one-line cases.'
586
+ Enabled: true
587
+
588
+ WhileUntilDo:
589
+ Description: 'Checks for redundant do after while or until.'
590
+ Enabled: true
591
+
592
+ WhileUntilModifier:
593
+ Description: >-
594
+ Favor modifier while/until usage when you have a
595
+ single-line body.
596
+ Enabled: true
597
+
598
+ WordArray:
599
+ Description: 'Use %w or %W for arrays of words.'
600
+ Enabled: true
601
+
602
+ #################### Lint ################################
603
+ ### Warnings
604
+
605
+ AmbiguousOperator:
606
+ Description: >-
607
+ Checks for ambiguous operators in the first argument of a
608
+ method invocation without parentheses.
609
+ Enabled: true
610
+
611
+ AmbiguousRegexpLiteral:
612
+ Description: >-
613
+ Checks for ambiguous regexp literals in the first argument of
614
+ a method invocation without parenthesis.
615
+ Enabled: true
616
+
617
+ AssignmentInCondition:
618
+ Description: "Don't use assignment in conditions."
619
+ Enabled: true
620
+
621
+ BlockAlignment:
622
+ Description: 'Align block ends correctly.'
623
+ Enabled: true
624
+
625
+ ConditionPosition:
626
+ Description: 'Checks for condition placed in a confusing position relative to the keyword.'
627
+ Enabled: true
628
+
629
+ Debugger:
630
+ Description: 'Check for debugger calls.'
631
+ Enabled: true
632
+
633
+ DeprecatedClassMethods:
634
+ Description: 'Check for deprecated class method calls.'
635
+ Enabled: true
636
+
637
+ ElseLayout:
638
+ Description: 'Check for odd code arrangement in an else block.'
639
+ Enabled: true
640
+
641
+ EmptyEnsure:
642
+ Description: 'Checks for empty ensure block.'
643
+ Enabled: true
644
+
645
+ EmptyInterpolation:
646
+ Description: 'Checks for empty string interpolation.'
647
+ Enabled: true
648
+
649
+ EndAlignment:
650
+ Description: 'Align ends correctly.'
651
+ Enabled: true
652
+
653
+ EndInMethod:
654
+ Description: 'END blocks should not be placed inside method definitions.'
655
+ Enabled: true
656
+
657
+ EnsureReturn:
658
+ Description: 'Never use return in an ensure block.'
659
+ Enabled: true
660
+
661
+ Eval:
662
+ Description: 'The use of eval represents a serious security risk.'
663
+ Enabled: true
664
+
665
+ GuardClause:
666
+ Description: 'Check for conditionals that can be replaced with guard clauses'
667
+ Enabled: true
668
+
669
+ HandleExceptions:
670
+ Description: "Don't suppress exception."
671
+ Enabled: true
672
+
673
+ InvalidCharacterLiteral:
674
+ Description: >-
675
+ Checks for invalid character literals with a non-escaped
676
+ whitespace character.
677
+ Enabled: true
678
+
679
+ LiteralInCondition:
680
+ Description: 'Checks of literals used in conditions.'
681
+ Enabled: true
682
+
683
+ LiteralInInterpolation:
684
+ Description: 'Checks for literals used in interpolation.'
685
+ Enabled: true
686
+
687
+ Loop:
688
+ Description: >-
689
+ Use Kernel#loop with break rather than begin/end/until or
690
+ begin/end/while for post-loop tests.
691
+ Enabled: true
692
+
693
+ ParenthesesAsGroupedExpression:
694
+ Description: >-
695
+ Checks for method calls with a space before the opening
696
+ parenthesis.
697
+ Enabled: true
698
+
699
+ RequireParentheses:
700
+ Description: >-
701
+ Use parentheses in the method call to avoid confusion
702
+ about precedence.
703
+ Enabled: true
704
+
705
+ RescueException:
706
+ Description: 'Avoid rescuing the Exception class.'
707
+ Enabled: true
708
+
709
+ ShadowingOuterLocalVariable:
710
+ Description: >-
711
+ Do not use the same name as outer local variable
712
+ for block arguments or block local variables.
713
+ Enabled: true
714
+
715
+ SpaceBeforeFirstArg:
716
+ Description: >-
717
+ Put a space between a method name and the first argument
718
+ in a method call without parentheses.
719
+ Enabled: true
720
+
721
+ StringConversionInInterpolation:
722
+ Description: 'Checks for Object#to_s usage in string interpolation.'
723
+ Enabled: true
724
+
725
+ UnderscorePrefixedVariableName:
726
+ Description: 'Do not use prefix `_` for a variable that is used.'
727
+ Enabled: true
728
+
729
+ UnusedBlockArgument:
730
+ Description: 'Checks for unused block arguments.'
731
+ Enabled: true
732
+
733
+ UnusedMethodArgument:
734
+ Description: 'Checks for unused method arguments.'
735
+ Enabled: true
736
+
737
+ UnreachableCode:
738
+ Description: 'Unreachable code.'
739
+ Enabled: true
740
+
741
+ UselessAccessModifier:
742
+ Description: 'Checks for useless access modifiers.'
743
+ Enabled: true
744
+
745
+ UselessAssignment:
746
+ Description: 'Checks for useless assignment to a local variable.'
747
+ Enabled: true
748
+
749
+ UselessComparison:
750
+ Description: 'Checks for comparison of something with itself.'
751
+ Enabled: true
752
+
753
+ UselessElseWithoutRescue:
754
+ Description: 'Checks for useless `else` in `begin..end` without `rescue`.'
755
+ Enabled: true
756
+
757
+ UselessSetterCall:
758
+ Description: 'Checks for useless setter call to a local variable.'
759
+ Enabled: true
760
+
761
+ Void:
762
+ Description: 'Possible use of operator/literal/variable in void context.'
763
+ Enabled: true
764
+
765
+ ##################### Rails ##################################
766
+
767
+ ActionFilter:
768
+ Description: 'Enforces consistent use of action filter methods.'
769
+ Enabled: true
770
+
771
+ DefaultScope:
772
+ Description: 'Checks if the argument passed to default_scope is a block.'
773
+ Enabled: true
774
+
775
+ HasAndBelongsToMany:
776
+ Description: 'Prefer has_many :through to has_and_belongs_to_many.'
777
+ Enabled: true
778
+
779
+ Output:
780
+ Description: 'Checks for calls to puts, print, etc.'
781
+ Enabled: true
782
+
783
+ ReadWriteAttribute:
784
+ Description: 'Checks for read_attribute(:attr) and write_attribute(:attr, val).'
785
+ Enabled: true
786
+
787
+ ScopeArgs:
788
+ Description: 'Checks the arguments of ActiveRecord scopes.'
789
+ Enabled: true
790
+
791
+ Validation:
792
+ Description: 'Use sexy validations.'
793
+ Enabled: true