returner 0.1.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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: d6474a1b334b452a81b9e45ec7b5900f2ff23e415cb2e46a6e3b849536b44cbc
4
+ data.tar.gz: 02be264fb44786c13879fb43b781e9a152a6bdeb11720f23c0737c1bcdf858f0
5
+ SHA512:
6
+ metadata.gz: f3eb4ef4b6abf0e7d6485df93320250744cb3c18bd571837ee5a20be178a63070fb38ee5878cf8fcf3f3b79934a44167869c567c8efdcc34d489613c5ea58934
7
+ data.tar.gz: c6569427259131a8dcaf77c87d4ab8f5c8b0a3446d9afbe3ef62ab103d3b2f759130a45a350869a6136cb7fb031a459b6768d86b5352a82571e0ac0cd19caa4d
data/.gitignore ADDED
@@ -0,0 +1,11 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+
10
+ # rspec failure tracking
11
+ .rspec_status
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/.rubocop.yml ADDED
@@ -0,0 +1,654 @@
1
+ AllCops:
2
+ Exclude:
3
+ - db/schema.rb
4
+
5
+ require:
6
+ - rubocop-rails
7
+ - rubocop-performance
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
78
+
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
+
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
90
+
91
+ Metrics/AbcSize:
92
+ Description: >-
93
+ A calculated magnitude based on number of assignments,
94
+ branches, and conditions.
95
+ Enabled: false
96
+
97
+ 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
+ Lint/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
+ Metrics/LineLength:
213
+ Description: 'Limit lines to 80 characters.'
214
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#80-character-limits'
215
+ Max: 80
216
+
217
+ Metrics/MethodLength:
218
+ Description: 'Avoid methods longer than 10 lines of code.'
219
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#short-methods'
220
+ Enabled: false
221
+
222
+ Style/ModuleFunction:
223
+ Description: 'Checks for usage of `extend self` in modules.'
224
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#module-function'
225
+ Enabled: false
226
+
227
+ Style/MultilineBlockChain:
228
+ Description: 'Avoid multi-line chains of blocks.'
229
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#single-line-blocks'
230
+ Enabled: false
231
+
232
+ Style/NegatedIf:
233
+ Description: >-
234
+ Favor unless over if for negative conditions
235
+ (or control flow or).
236
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#unless-for-negatives'
237
+ Enabled: false
238
+
239
+ Style/NegatedWhile:
240
+ Description: 'Favor until over while for negative conditions.'
241
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#until-for-negatives'
242
+ Enabled: false
243
+
244
+ Style/Next:
245
+ Description: 'Use `next` to skip iteration instead of a condition at the end.'
246
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals'
247
+ Enabled: false
248
+
249
+ Style/NilComparison:
250
+ Description: 'Prefer x.nil? to x == nil.'
251
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#predicate-methods'
252
+ Enabled: false
253
+
254
+ Style/Not:
255
+ Description: 'Use ! instead of not.'
256
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#bang-not-not'
257
+ Enabled: false
258
+
259
+ Style/NumericLiterals:
260
+ Description: >-
261
+ Add underscores to large numeric literals to improve their
262
+ readability.
263
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscores-in-numerics'
264
+ Enabled: false
265
+
266
+ Style/OneLineConditional:
267
+ Description: >-
268
+ Favor the ternary operator(?:) over
269
+ if/then/else/end constructs.
270
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#ternary-operator'
271
+ Enabled: false
272
+
273
+ Naming/BinaryOperatorParameterName:
274
+ Description: 'When defining binary operators, name the argument other.'
275
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#other-arg'
276
+ Enabled: false
277
+
278
+ Metrics/ParameterLists:
279
+ Description: 'Avoid parameter lists longer than three or four parameters.'
280
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#too-many-params'
281
+ Enabled: false
282
+
283
+ Style/PercentLiteralDelimiters:
284
+ Description: 'Use `%`-literal delimiters consistently'
285
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-literal-braces'
286
+ Enabled: false
287
+
288
+ Style/PerlBackrefs:
289
+ Description: 'Avoid Perl-style regex back references.'
290
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-perl-regexp-last-matchers'
291
+ Enabled: false
292
+
293
+ Naming/PredicateName:
294
+ Description: 'Check the names of predicate methods.'
295
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#bool-methods-qmark'
296
+ NamePrefixBlacklist:
297
+ - is_
298
+ Exclude:
299
+ - spec/**/*
300
+
301
+ Style/Proc:
302
+ Description: 'Use proc instead of Proc.new.'
303
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#proc'
304
+ Enabled: false
305
+
306
+ Style/RaiseArgs:
307
+ Description: 'Checks the arguments passed to raise/fail.'
308
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#exception-class-messages'
309
+ Enabled: false
310
+
311
+ Style/RegexpLiteral:
312
+ Description: 'Use / or %r around regular expressions.'
313
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-r'
314
+ Enabled: false
315
+
316
+ Style/Sample:
317
+ Description: >-
318
+ Use `sample` instead of `shuffle.first`,
319
+ `shuffle.last`, and `shuffle[Fixnum]`.
320
+ Reference: 'https://github.com/JuanitoFatas/fast-ruby#arrayshufflefirst-vs-arraysample-code'
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'
343
+ Enabled: false
344
+
345
+ Style/SpecialGlobalVars:
346
+ Description: 'Avoid Perl-style global variables.'
347
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-cryptic-perlisms'
348
+ Enabled: false
349
+
350
+ 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
+ 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 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/TrailingCommaInHashLiteral:
377
+ Description: 'Checks for trailing comma in hash literals.'
378
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
379
+ EnforcedStyleForMultiline: comma
380
+ SupportedStylesForMultiline:
381
+ - comma
382
+ - consistent_comma
383
+ - no_comma
384
+ Enabled: true
385
+
386
+ Style/TrivialAccessors:
387
+ Description: 'Prefer attr_* methods to trivial readers/writers.'
388
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#attr_family'
389
+ Enabled: false
390
+
391
+ Style/VariableInterpolation:
392
+ Description: >-
393
+ Don't interpolate global, instance and class variables
394
+ directly in strings.
395
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#curlies-interpolate'
396
+ Enabled: false
397
+
398
+ Style/WhenThen:
399
+ Description: 'Use when x then ... for one-line cases.'
400
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#one-line-cases'
401
+ Enabled: false
402
+
403
+ Style/WhileUntilModifier:
404
+ Description: >-
405
+ Favor modifier while/until usage when you have a
406
+ single-line body.
407
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#while-as-a-modifier'
408
+ Enabled: false
409
+
410
+ Style/WordArray:
411
+ Description: 'Use %w or %W for arrays of words.'
412
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-w'
413
+ Enabled: false
414
+
415
+ # Layout
416
+
417
+ Layout/AlignParameters:
418
+ Description: 'Here we check if the parameters on a multi-line method call or definition are aligned.'
419
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-double-indent'
420
+ Enabled: false
421
+
422
+ Layout/ConditionPosition:
423
+ Description: >-
424
+ Checks for condition placed in a confusing position relative to
425
+ the keyword.
426
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#same-line-condition'
427
+ Enabled: false
428
+
429
+ Layout/DotPosition:
430
+ Description: 'Checks the position of the dot in multi-line method calls.'
431
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains'
432
+ EnforcedStyle: trailing
433
+
434
+ Layout/ExtraSpacing:
435
+ Description: 'Do not use unnecessary spacing.'
436
+ Enabled: true
437
+
438
+ Layout/MultilineOperationIndentation:
439
+ Description: >-
440
+ Checks indentation of binary operations that span more than
441
+ one line.
442
+ Enabled: true
443
+ EnforcedStyle: indented
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/InitialIndentation:
453
+ Description: >-
454
+ Checks the indentation of the first non-blank non-comment line in a file.
455
+ Enabled: false
456
+
457
+ # Lint
458
+
459
+ Lint/AmbiguousOperator:
460
+ Description: >-
461
+ Checks for ambiguous operators in the first argument of a
462
+ method invocation without parentheses.
463
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-as-args'
464
+ Enabled: false
465
+
466
+ Lint/AmbiguousRegexpLiteral:
467
+ Description: >-
468
+ Checks for ambiguous regexp literals in the first argument of
469
+ a method invocation without parenthesis.
470
+ Enabled: false
471
+
472
+ Lint/AssignmentInCondition:
473
+ Description: "Don't use assignment in conditions."
474
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#safe-assignment-in-condition'
475
+ Enabled: false
476
+
477
+ Lint/CircularArgumentReference:
478
+ Description: "Don't refer to the keyword argument in the default value."
479
+ Enabled: false
480
+
481
+ Lint/DeprecatedClassMethods:
482
+ Description: 'Check for deprecated class method calls.'
483
+ Enabled: false
484
+
485
+ Lint/DuplicatedKey:
486
+ Description: 'Check for duplicate keys in hash literals.'
487
+ Enabled: false
488
+
489
+ Lint/EachWithObjectArgument:
490
+ Description: 'Check for immutable argument given to each_with_object.'
491
+ Enabled: false
492
+
493
+ Lint/ElseLayout:
494
+ Description: 'Check for odd code arrangement in an else block.'
495
+ Enabled: false
496
+
497
+ Lint/FormatParameterMismatch:
498
+ Description: 'The number of parameters to format/sprint must match the fields.'
499
+ Enabled: false
500
+
501
+ Lint/HandleExceptions:
502
+ Description: "Don't suppress exception."
503
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#dont-hide-exceptions'
504
+ Enabled: false
505
+
506
+ Lint/LiteralAsCondition:
507
+ Description: 'Checks of literals used in conditions.'
508
+ Enabled: false
509
+
510
+ Lint/LiteralInInterpolation:
511
+ Description: 'Checks for literals used in interpolation.'
512
+ Enabled: false
513
+
514
+ Lint/Loop:
515
+ Description: >-
516
+ Use Kernel#loop with break rather than begin/end/until or
517
+ begin/end/while for post-loop tests.
518
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#loop-with-break'
519
+ Enabled: false
520
+
521
+ Lint/NestedMethodDefinition:
522
+ Description: 'Do not use nested method definitions.'
523
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-methods'
524
+ Enabled: false
525
+
526
+ Lint/NonLocalExitFromIterator:
527
+ Description: 'Do not use return in iterator to cause non-local exit.'
528
+ Enabled: false
529
+
530
+ Lint/ParenthesesAsGroupedExpression:
531
+ Description: >-
532
+ Checks for method calls with a space before the opening
533
+ parenthesis.
534
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-no-spaces'
535
+ Enabled: false
536
+
537
+ Lint/RequireParentheses:
538
+ Description: >-
539
+ Use parentheses in the method call to avoid confusion
540
+ about precedence.
541
+ Enabled: false
542
+
543
+ Lint/UnderscorePrefixedVariableName:
544
+ Description: 'Do not use prefix `_` for a variable that is used.'
545
+ Enabled: false
546
+
547
+ Lint/UnneededCopDisableDirective:
548
+ Description: >-
549
+ Checks for rubocop:disable comments that can be removed.
550
+ Note: this cop is not disabled when disabling all cops.
551
+ It must be explicitly disabled.
552
+ Enabled: false
553
+
554
+ Lint/Void:
555
+ Description: 'Possible use of operator/literal/variable in void context.'
556
+ Enabled: false
557
+
558
+ # Performance
559
+
560
+ Performance/CaseWhenSplat:
561
+ Description: >-
562
+ Place `when` conditions that use splat at the end
563
+ of the list of `when` branches.
564
+ Enabled: false
565
+
566
+ Performance/Count:
567
+ Description: >-
568
+ Use `count` instead of `select...size`, `reject...size`,
569
+ `select...count`, `reject...count`, `select...length`,
570
+ and `reject...length`.
571
+ Enabled: false
572
+
573
+ Performance/Detect:
574
+ Description: >-
575
+ Use `detect` instead of `select.first`, `find_all.first`,
576
+ `select.last`, and `find_all.last`.
577
+ Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerabledetect-vs-enumerableselectfirst-code'
578
+ Enabled: false
579
+
580
+ Performance/FlatMap:
581
+ Description: >-
582
+ Use `Enumerable#flat_map`
583
+ instead of `Enumerable#map...Array#flatten(1)`
584
+ or `Enumberable#collect..Array#flatten(1)`
585
+ Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerablemaparrayflatten-vs-enumerableflat_map-code'
586
+ Enabled: false
587
+
588
+ Performance/ReverseEach:
589
+ Description: 'Use `reverse_each` instead of `reverse.each`.'
590
+ Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerablereverseeach-vs-enumerablereverse_each-code'
591
+ Enabled: false
592
+
593
+ Performance/Size:
594
+ Description: >-
595
+ Use `size` instead of `count` for counting
596
+ the number of elements in `Array` and `Hash`.
597
+ Reference: 'https://github.com/JuanitoFatas/fast-ruby#arraycount-vs-arraysize-code'
598
+ Enabled: false
599
+
600
+ Performance/StringReplacement:
601
+ Description: >-
602
+ Use `tr` instead of `gsub` when you are replacing the same
603
+ number of characters. Use `delete` instead of `gsub` when
604
+ you are deleting characters.
605
+ Reference: 'https://github.com/JuanitoFatas/fast-ruby#stringgsub-vs-stringtr-code'
606
+ Enabled: false
607
+
608
+ # Rails
609
+
610
+ Rails/ActionFilter:
611
+ Description: 'Enforces consistent use of action filter methods.'
612
+ Enabled: false
613
+
614
+ Rails/Date:
615
+ Description: >-
616
+ Checks the correct usage of date aware methods,
617
+ such as Date.today, Date.current etc.
618
+ Enabled: false
619
+
620
+ Rails/FindBy:
621
+ Description: 'Prefer find_by over where.first.'
622
+ Enabled: false
623
+
624
+ Rails/FindEach:
625
+ Description: 'Prefer all.find_each over all.find.'
626
+ Enabled: false
627
+
628
+ Rails/HasAndBelongsToMany:
629
+ Description: 'Prefer has_many :through to has_and_belongs_to_many.'
630
+ Enabled: false
631
+
632
+ Rails/Output:
633
+ Description: 'Checks for calls to puts, print, etc.'
634
+ Enabled: false
635
+
636
+ Rails/ReadWriteAttribute:
637
+ Description: >-
638
+ Checks for read_attribute(:attr) and
639
+ write_attribute(:attr, val).
640
+ Enabled: false
641
+
642
+ Rails/ScopeArgs:
643
+ Description: 'Checks the arguments of ActiveRecord scopes.'
644
+ Enabled: false
645
+
646
+ Rails/TimeZone:
647
+ Description: 'Checks the correct usage of time zone aware methods.'
648
+ StyleGuide: 'https://github.com/bbatsov/rails-style-guide#time'
649
+ Reference: 'http://danilenko.org/2012/7/6/rails_timezones'
650
+ Enabled: false
651
+
652
+ Rails/Validation:
653
+ Description: 'Use validates :attribute, hash of validations.'
654
+ Enabled: false
data/.travis.yml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ sudo: false
3
+ language: ruby
4
+ cache: bundler
5
+ rvm:
6
+ - 2.6.3
7
+ before_install: gem install bundler -v 2.0.2
@@ -0,0 +1,74 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ In the interest of fostering an open and welcoming environment, we as
6
+ contributors and maintainers pledge to making participation in our project and
7
+ our community a harassment-free experience for everyone, regardless of age, body
8
+ size, disability, ethnicity, gender identity and expression, level of experience,
9
+ nationality, personal appearance, race, religion, or sexual identity and
10
+ orientation.
11
+
12
+ ## Our Standards
13
+
14
+ Examples of behavior that contributes to creating a positive environment
15
+ include:
16
+
17
+ * Using welcoming and inclusive language
18
+ * Being respectful of differing viewpoints and experiences
19
+ * Gracefully accepting constructive criticism
20
+ * Focusing on what is best for the community
21
+ * Showing empathy towards other community members
22
+
23
+ Examples of unacceptable behavior by participants include:
24
+
25
+ * The use of sexualized language or imagery and unwelcome sexual attention or
26
+ advances
27
+ * Trolling, insulting/derogatory comments, and personal or political attacks
28
+ * Public or private harassment
29
+ * Publishing others' private information, such as a physical or electronic
30
+ address, without explicit permission
31
+ * Other conduct which could reasonably be considered inappropriate in a
32
+ professional setting
33
+
34
+ ## Our Responsibilities
35
+
36
+ Project maintainers are responsible for clarifying the standards of acceptable
37
+ behavior and are expected to take appropriate and fair corrective action in
38
+ response to any instances of unacceptable behavior.
39
+
40
+ Project maintainers have the right and responsibility to remove, edit, or
41
+ reject comments, commits, code, wiki edits, issues, and other contributions
42
+ that are not aligned to this Code of Conduct, or to ban temporarily or
43
+ permanently any contributor for other behaviors that they deem inappropriate,
44
+ threatening, offensive, or harmful.
45
+
46
+ ## Scope
47
+
48
+ This Code of Conduct applies both within project spaces and in public spaces
49
+ when an individual is representing the project or its community. Examples of
50
+ representing a project or community include using an official project e-mail
51
+ address, posting via an official social media account, or acting as an appointed
52
+ representative at an online or offline event. Representation of a project may be
53
+ further defined and clarified by project maintainers.
54
+
55
+ ## Enforcement
56
+
57
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
58
+ reported by contacting the project team at caioertai@gmail.com. All
59
+ complaints will be reviewed and investigated and will result in a response that
60
+ is deemed necessary and appropriate to the circumstances. The project team is
61
+ obligated to maintain confidentiality with regard to the reporter of an incident.
62
+ Further details of specific enforcement policies may be posted separately.
63
+
64
+ Project maintainers who do not follow or enforce the Code of Conduct in good
65
+ faith may face temporary or permanent repercussions as determined by other
66
+ members of the project's leadership.
67
+
68
+ ## Attribution
69
+
70
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71
+ available at [http://contributor-covenant.org/version/1/4][version]
72
+
73
+ [homepage]: http://contributor-covenant.org
74
+ [version]: http://contributor-covenant.org/version/1/4/
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source "https://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in returner.gemspec
4
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,35 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ returner (0.1.0)
5
+
6
+ GEM
7
+ remote: https://rubygems.org/
8
+ specs:
9
+ diff-lcs (1.3)
10
+ rake (10.5.0)
11
+ rspec (3.9.0)
12
+ rspec-core (~> 3.9.0)
13
+ rspec-expectations (~> 3.9.0)
14
+ rspec-mocks (~> 3.9.0)
15
+ rspec-core (3.9.0)
16
+ rspec-support (~> 3.9.0)
17
+ rspec-expectations (3.9.0)
18
+ diff-lcs (>= 1.2.0, < 2.0)
19
+ rspec-support (~> 3.9.0)
20
+ rspec-mocks (3.9.0)
21
+ diff-lcs (>= 1.2.0, < 2.0)
22
+ rspec-support (~> 3.9.0)
23
+ rspec-support (3.9.0)
24
+
25
+ PLATFORMS
26
+ ruby
27
+
28
+ DEPENDENCIES
29
+ bundler (~> 2.0)
30
+ rake (~> 10.0)
31
+ returner!
32
+ rspec (~> 3.0)
33
+
34
+ BUNDLED WITH
35
+ 2.0.2
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2019 Caio Andrade
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,43 @@
1
+ # Returner
2
+
3
+ Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/returner`. To experiment with that code, run `bin/console` for an interactive prompt.
4
+
5
+ TODO: Delete this and the text above, and describe your gem
6
+
7
+ ## Installation
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'returner'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install returner
22
+
23
+ ## Usage
24
+
25
+ TODO: Write usage instructions here
26
+
27
+ ## Development
28
+
29
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30
+
31
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32
+
33
+ ## Contributing
34
+
35
+ Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/returner. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
36
+
37
+ ## License
38
+
39
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
40
+
41
+ ## Code of Conduct
42
+
43
+ Everyone interacting in the Returner project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/returner/blob/master/CODE_OF_CONDUCT.md).
data/Rakefile ADDED
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
data/bin/console ADDED
@@ -0,0 +1,22 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "returner"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+
15
+ class Blank
16
+ extend Returner
17
+ returns true, to: :nil?
18
+ returns false, to: :present?
19
+ returns [], to: :addresses
20
+ end
21
+
22
+ IRB.start(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+ set -vx
5
+
6
+ bundle install
7
+
8
+ # Do any other automated setup that you need to do here
data/lib/returner.rb ADDED
@@ -0,0 +1,11 @@
1
+ require "returner/version"
2
+
3
+ module Returner
4
+ class Error < StandardError; end
5
+
6
+ def returns(value, to: [])
7
+ [*to].each do |method_name|
8
+ define_method(method_name) { value }
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,3 @@
1
+ module Returner
2
+ VERSION = "0.1.0"
3
+ end
data/returner.gemspec ADDED
@@ -0,0 +1,32 @@
1
+ lib = File.expand_path("lib", __dir__)
2
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
+ require "returner/version"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "returner"
7
+ spec.version = Returner::VERSION
8
+ spec.authors = ["Caio Andrade"]
9
+ spec.email = ["caioertai@gmail.com"]
10
+
11
+ spec.summary = "Quickly defines methods with the same return value."
12
+ spec.description = "Simple module with a class macro for defining multiple methods with the same return value."
13
+ spec.homepage = "https://github.com/caioertai/returner"
14
+ spec.license = "MIT"
15
+
16
+ spec.metadata["homepage_uri"] = spec.homepage
17
+ spec.metadata["source_code_uri"] = "https://github.com/caioertai/returner"
18
+ # spec.metadata["changelog_uri"] = "https://github.com/caioertai/returner/blob/master/CHANGELOG.md"
19
+
20
+ # Specify which files should be added to the gem when it is released.
21
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
22
+ spec.files = Dir.chdir(File.expand_path(__dir__)) do
23
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
24
+ end
25
+ spec.bindir = "exe"
26
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
27
+ spec.require_paths = ["lib"]
28
+
29
+ spec.add_development_dependency "bundler", "~> 2.0"
30
+ spec.add_development_dependency "rake", "~> 10.0"
31
+ spec.add_development_dependency "rspec", "~> 3.0"
32
+ end
metadata ADDED
@@ -0,0 +1,103 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: returner
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Caio Andrade
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2019-10-24 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '2.0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '2.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '3.0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '3.0'
55
+ description: Simple module with a class macro for defining multiple methods with the
56
+ same return value.
57
+ email:
58
+ - caioertai@gmail.com
59
+ executables: []
60
+ extensions: []
61
+ extra_rdoc_files: []
62
+ files:
63
+ - ".gitignore"
64
+ - ".rspec"
65
+ - ".rubocop.yml"
66
+ - ".travis.yml"
67
+ - CODE_OF_CONDUCT.md
68
+ - Gemfile
69
+ - Gemfile.lock
70
+ - LICENSE.txt
71
+ - README.md
72
+ - Rakefile
73
+ - bin/console
74
+ - bin/setup
75
+ - lib/returner.rb
76
+ - lib/returner/version.rb
77
+ - returner.gemspec
78
+ homepage: https://github.com/caioertai/returner
79
+ licenses:
80
+ - MIT
81
+ metadata:
82
+ homepage_uri: https://github.com/caioertai/returner
83
+ source_code_uri: https://github.com/caioertai/returner
84
+ post_install_message:
85
+ rdoc_options: []
86
+ require_paths:
87
+ - lib
88
+ required_ruby_version: !ruby/object:Gem::Requirement
89
+ requirements:
90
+ - - ">="
91
+ - !ruby/object:Gem::Version
92
+ version: '0'
93
+ required_rubygems_version: !ruby/object:Gem::Requirement
94
+ requirements:
95
+ - - ">="
96
+ - !ruby/object:Gem::Version
97
+ version: '0'
98
+ requirements: []
99
+ rubygems_version: 3.0.3
100
+ signing_key:
101
+ specification_version: 4
102
+ summary: Quickly defines methods with the same return value.
103
+ test_files: []