takky 0.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 8dac37566b4cc4fc5cd0b291e3e974a6bbc41400
4
+ data.tar.gz: 1c3d8468f86e363b061606780958e79531587b41
5
+ SHA512:
6
+ metadata.gz: 43a80ac3c7b35dcb72ee111c8c35e8b18aa6742ba158eeccc4872ff3ac4e4b8d390dac13e180bee90c794814403adddad802721697885093f1fbfca1d2d7b064
7
+ data.tar.gz: be84ff04a743373f2e5d17645e0a37db0251298fa74654e0206db4531f86ffb44592c9c6d66d3056eb2340302a134aaa8f80bcc8b7c3c9b2ff8ba1ff4ac21f3c
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
@@ -0,0 +1,862 @@
1
+ AllCops:
2
+ RunRailsCops: true
3
+
4
+ Style/AccessModifierIndentation:
5
+ Description: Check indentation of private/protected visibility modifiers.
6
+ Enabled: true
7
+
8
+ Style/AccessorMethodName:
9
+ Description: Check the naming of accessor methods for get_/set_.
10
+ Enabled: false
11
+
12
+ Style/Alias:
13
+ Description: 'Use alias_method instead of alias.'
14
+ Enabled: false
15
+
16
+ Style/AlignArray:
17
+ Description: >-
18
+ Align the elements of an array literal if they span more than
19
+ one line.
20
+ Enabled: true
21
+
22
+ Style/AlignHash:
23
+ Description: >-
24
+ Align the elements of a hash literal if they span more than
25
+ one line.
26
+ Enabled: true
27
+
28
+ Style/AlignParameters:
29
+ Description: >-
30
+ Align the parameters of a method call if they span more
31
+ than one line.
32
+ Enabled: true
33
+
34
+ Style/AndOr:
35
+ Description: 'Use &&/|| instead of and/or.'
36
+ Enabled: true
37
+
38
+ Style/ArrayJoin:
39
+ Description: 'Use Array#join instead of Array#*.'
40
+ Enabled: false
41
+
42
+ Style/AsciiComments:
43
+ Description: 'Use only ascii symbols in comments.'
44
+ Enabled: false
45
+
46
+ Style/AsciiIdentifiers:
47
+ Description: 'Use only ascii symbols in identifiers.'
48
+ Enabled: false
49
+
50
+ Style/Attr:
51
+ Description: 'Checks for uses of Module#attr.'
52
+ Enabled: false
53
+
54
+ Style/BeginBlock:
55
+ Description: 'Avoid the use of BEGIN blocks.'
56
+ Enabled: true
57
+
58
+ Style/BarePercentLiterals:
59
+ Description: 'Checks if usage of %() or %Q() matches configuration.'
60
+ Enabled: true
61
+
62
+ Style/BlockComments:
63
+ Description: 'Do not use block comments.'
64
+ Enabled: true
65
+
66
+ Style/BlockEndNewline:
67
+ Description: 'Put end statement of multiline block on its own line.'
68
+ Enabled: true
69
+
70
+ Style/Blocks:
71
+ Description: >-
72
+ Avoid using {...} for multi-line blocks (multiline chaining is
73
+ always ugly).
74
+ Prefer {...} over do...end for single-line blocks.
75
+ Enabled: false
76
+
77
+ Style/BracesAroundHashParameters:
78
+ Description: 'Enforce braces style inside hash parameters.'
79
+ Enabled: true
80
+
81
+ Style/CaseEquality:
82
+ Description: 'Avoid explicit use of the case equality operator(===).'
83
+ Enabled: false
84
+
85
+ Style/CaseIndentation:
86
+ Description: 'Indentation of when in a case/when/[else/]end.'
87
+ Enabled: true
88
+
89
+ Style/CharacterLiteral:
90
+ Description: 'Checks for uses of character literals.'
91
+ Enabled: false
92
+
93
+ Style/ClassAndModuleCamelCase:
94
+ Description: 'Use CamelCase for classes and modules.'
95
+ Enabled: true
96
+
97
+ Style/ClassAndModuleChildren:
98
+ Description: 'Checks style of children classes and modules.'
99
+ Enabled: false
100
+
101
+ Style/ClassCheck:
102
+ Description: 'Enforces consistent use of `Object#is_a?` or `Object#kind_of?`.'
103
+ Enabled: true
104
+
105
+ Style/ClassMethods:
106
+ Description: 'Use self when defining module/class methods.'
107
+ Enabled: true
108
+
109
+ Style/ClassVars:
110
+ Description: 'Avoid the use of class variables.'
111
+ Enabled: false
112
+
113
+ Style/CollectionMethods:
114
+ Description: 'Preferred collection methods.'
115
+ Enabled: true
116
+ PreferredMethods:
117
+ find: detect
118
+ reduce: reduce
119
+ collect: map
120
+ find_all: select
121
+
122
+ Style/ColonMethodCall:
123
+ Description: 'Do not use :: for method call.'
124
+ Enabled: false
125
+
126
+ Style/CommentAnnotation:
127
+ Description: >-
128
+ Checks formatting of special comments
129
+ (TODO, FIXME, OPTIMIZE, HACK, REVIEW).
130
+ Enabled: false
131
+
132
+ Style/CommentIndentation:
133
+ Description: 'Indentation of comments.'
134
+ Enabled: true
135
+
136
+ Style/ConstantName:
137
+ Description: 'Constants should use SCREAMING_SNAKE_CASE.'
138
+ Enabled: true
139
+
140
+ Style/DefWithParentheses:
141
+ Description: 'Use def with parentheses when there are arguments.'
142
+ Enabled: true
143
+
144
+ Style/DeprecatedHashMethods:
145
+ Description: 'Checks for use of deprecated Hash methods.'
146
+ Enabled: false
147
+
148
+ Style/Documentation:
149
+ Description: 'Document classes and non-namespace modules.'
150
+ Enabled: false
151
+
152
+ Style/DotPosition:
153
+ Description: 'Checks the position of the dot in multi-line method calls.'
154
+ Enabled: true
155
+ EnforcedStyle: trailing
156
+
157
+ Style/DoubleNegation:
158
+ Description: 'Checks for uses of double negation (!!).'
159
+ Enabled: false
160
+
161
+ Style/EachWithObject:
162
+ Description: 'Prefer `each_with_object` over `inject` or `reduce`.'
163
+ Enabled: false
164
+
165
+ Style/EmptyLineBetweenDefs:
166
+ Description: 'Use empty lines between defs.'
167
+ Enabled: true
168
+
169
+ Style/EmptyLines:
170
+ Description: "Don't use several empty lines in a row."
171
+ Enabled: true
172
+
173
+ Style/EmptyLinesAroundAccessModifier:
174
+ Description: "Keep blank lines around access modifiers."
175
+ Enabled: true
176
+
177
+ # Style/EmptyLinesAroundBody:
178
+ # Description: "Keeps track of empty lines around expression bodies."
179
+ # Enabled: true
180
+
181
+ Style/EmptyLiteral:
182
+ Description: 'Prefer literals to Array.new/Hash.new/String.new.'
183
+ Enabled: false
184
+
185
+ Style/Encoding:
186
+ Description: 'Use UTF-8 as the source file encoding.'
187
+ Enabled: false
188
+
189
+ Style/EndBlock:
190
+ Description: 'Avoid the use of END blocks.'
191
+ Enabled: true
192
+
193
+ Style/EndOfLine:
194
+ Description: 'Use Unix-style line endings.'
195
+ Enabled: true
196
+
197
+ Style/EvenOdd:
198
+ Description: 'Favor the use of Fixnum#even? && Fixnum#odd?'
199
+ Enabled: false
200
+
201
+ Style/FileName:
202
+ Description: 'Use snake_case for source file names.'
203
+ Enabled: false
204
+
205
+ Style/FlipFlop:
206
+ Description: 'Checks for flip flops'
207
+ Enabled: false
208
+
209
+ Style/For:
210
+ Description: 'Checks use of for or each in multiline loops.'
211
+ Enabled: true
212
+
213
+ Style/FormatString:
214
+ Description: 'Enforce the use of Kernel#sprintf, Kernel#format or String#%.'
215
+ Enabled: false
216
+
217
+ Style/GlobalVars:
218
+ Description: 'Do not introduce global variables.'
219
+ Enabled: false
220
+
221
+ Style/GuardClause:
222
+ Description: 'Check for conditionals that can be replaced with guard clauses'
223
+ Enabled: false
224
+
225
+ Style/HashSyntax:
226
+ Description: >-
227
+ Prefer Ruby 1.9 hash syntax { a: 1, b: 2 } over 1.8 syntax
228
+ { :a => 1, :b => 2 }.
229
+ Enabled: true
230
+
231
+ Style/IfUnlessModifier:
232
+ Description: >-
233
+ Favor modifier if/unless usage when you have a
234
+ single-line body.
235
+ Enabled: false
236
+
237
+ Style/IfWithSemicolon:
238
+ Description: 'Never use if x; .... Use the ternary operator instead.'
239
+ Enabled: false
240
+
241
+ Style/IndentationConsistency:
242
+ Description: 'Keep indentation straight.'
243
+ Enabled: true
244
+
245
+ Style/IndentationWidth:
246
+ Description: 'Use 2 spaces for indentation.'
247
+ Enabled: true
248
+
249
+ Style/IndentArray:
250
+ Description: >-
251
+ Checks the indentation of the first element in an array
252
+ literal.
253
+ Enabled: true
254
+
255
+ Style/IndentHash:
256
+ Description: 'Checks the indentation of the first key in a hash literal.'
257
+ Enabled: true
258
+
259
+ Style/InlineComment:
260
+ Description: 'Avoid inline comments.'
261
+ Enabled: false
262
+
263
+ Style/Lambda:
264
+ Description: 'Use the new lambda literal syntax for single-line blocks.'
265
+ Enabled: false
266
+
267
+ Style/LambdaCall:
268
+ Description: 'Use lambda.call(...) instead of lambda.(...).'
269
+ Enabled: false
270
+
271
+ Style/LeadingCommentSpace:
272
+ Description: 'Comments should start with a space.'
273
+ Enabled: true
274
+
275
+ Style/LineEndConcatenation:
276
+ Description: >-
277
+ Use \ instead of + or << to concatenate two string literals at
278
+ line end.
279
+ Enabled: false
280
+
281
+ Style/MethodCalledOnDoEndBlock:
282
+ Description: 'Avoid chaining a method call on a do...end block.'
283
+ Enabled: true
284
+
285
+ Style/MethodCallParentheses:
286
+ Description: 'Do not use parentheses for method calls with no arguments.'
287
+ Enabled: true
288
+
289
+ Style/MethodDefParentheses:
290
+ Description: >-
291
+ Checks if the method definitions have or don't have
292
+ parentheses.
293
+ Enabled: true
294
+
295
+ Style/MethodName:
296
+ Description: 'Use the configured style when naming methods.'
297
+ Enabled: true
298
+
299
+ Style/ModuleFunction:
300
+ Description: 'Checks for usage of `extend self` in modules.'
301
+ Enabled: false
302
+
303
+ Style/MultilineBlockChain:
304
+ Description: 'Avoid multi-line chains of blocks.'
305
+ Enabled: true
306
+
307
+ Style/MultilineBlockLayout:
308
+ Description: 'Ensures newlines after multiline block do statements.'
309
+ Enabled: true
310
+
311
+ Style/MultilineIfThen:
312
+ Description: 'Never use then for multi-line if/unless.'
313
+ Enabled: true
314
+
315
+ Style/MultilineOperationIndentation:
316
+ Enabled: true
317
+
318
+ Style/MultilineTernaryOperator:
319
+ Description: >-
320
+ Avoid multi-line ?: (the ternary operator);
321
+ use if/unless instead.
322
+ Enabled: true
323
+
324
+ Style/NegatedIf:
325
+ Description: >-
326
+ Favor unless over if for negative conditions
327
+ (or control flow or).
328
+ Enabled: false
329
+
330
+ Style/NegatedWhile:
331
+ Description: 'Favor until over while for negative conditions.'
332
+ Enabled: false
333
+
334
+ Style/NestedTernaryOperator:
335
+ Description: 'Use one expression per branch in a ternary operator.'
336
+ Enabled: true
337
+
338
+ Style/Next:
339
+ Description: 'Use `next` to skip iteration instead of a condition at the end.'
340
+ Enabled: false
341
+
342
+ Style/NilComparison:
343
+ Description: 'Prefer x.nil? to x == nil.'
344
+ Enabled: false
345
+
346
+ Style/NonNilCheck:
347
+ Description: 'Checks for redundant nil checks.'
348
+ Enabled: true
349
+
350
+ Style/Not:
351
+ Description: 'Use ! instead of not.'
352
+ Enabled: false
353
+
354
+ Style/NumericLiterals:
355
+ Description: >-
356
+ Add underscores to large numeric literals to improve their
357
+ readability.
358
+ Enabled: false
359
+
360
+ Style/OneLineConditional:
361
+ Description: >-
362
+ Favor the ternary operator(?:) over
363
+ if/then/else/end constructs.
364
+ Enabled: false
365
+
366
+ Style/OpMethod:
367
+ Description: 'When defining binary operators, name the argument other.'
368
+ Enabled: false
369
+
370
+ Style/ParenthesesAroundCondition:
371
+ Description: >-
372
+ Don't use parentheses around the condition of an
373
+ if/unless/while.
374
+ Enabled: true
375
+
376
+ Style/PercentLiteralDelimiters:
377
+ Description: 'Use `%`-literal delimiters consistently'
378
+ Enabled: false
379
+
380
+ Style/PercentQLiterals:
381
+ Description: 'Checks if uses of %Q/%q match the configured preference.'
382
+ Enabled: true
383
+
384
+ Style/PerlBackrefs:
385
+ Description: 'Avoid Perl-style regex back references.'
386
+ Enabled: false
387
+
388
+ Style/PredicateName:
389
+ Description: 'Check the names of predicate methods.'
390
+ Enabled: true
391
+ NamePrefixBlacklist:
392
+ - is_
393
+
394
+ Style/Proc:
395
+ Description: 'Use proc instead of Proc.new.'
396
+ Enabled: false
397
+
398
+ Style/RaiseArgs:
399
+ Description: 'Checks the arguments passed to raise/fail.'
400
+ Enabled: false
401
+
402
+ Style/RedundantBegin:
403
+ Description: "Don't use begin blocks when they are not needed."
404
+ Enabled: true
405
+
406
+ Style/RedundantException:
407
+ Description: "Checks for an obsolete RuntimeException argument in raise/fail."
408
+ Enabled: true
409
+
410
+ Style/RedundantReturn:
411
+ Description: "Don't use return where it's not required."
412
+ Enabled: true
413
+
414
+ Style/RedundantSelf:
415
+ Description: "Don't use self where it's not needed."
416
+ Enabled: true
417
+
418
+ Style/RegexpLiteral:
419
+ Description: >-
420
+ Use %r for regular expressions matching more than
421
+ `MaxSlashes` '/' characters.
422
+ Use %r only for regular expressions matching more than
423
+ `MaxSlashes` '/' character.
424
+ Enabled: false
425
+
426
+ Style/RescueModifier:
427
+ Description: 'Avoid using rescue in its modifier form.'
428
+ Enabled: true
429
+
430
+ Style/SelfAssignment:
431
+ Description: >-
432
+ Checks for places where self-assignment shorthand should have
433
+ been used.
434
+ Enabled: false
435
+
436
+ Style/Semicolon:
437
+ Description: "Don't use semicolons to terminate expressions."
438
+ Enabled: true
439
+
440
+ Style/SignalException:
441
+ Description: 'Checks for proper usage of fail and raise.'
442
+ Enabled: false
443
+
444
+ Style/SingleLineBlockParams:
445
+ Description: 'Enforces the names of some block params.'
446
+ Enabled: false
447
+
448
+ Style/SingleLineMethods:
449
+ Description: 'Avoid single-line methods.'
450
+ Enabled: false
451
+
452
+ Style/SingleSpaceBeforeFirstArg:
453
+ Description: >-
454
+ Checks that exactly one space is used between a method name
455
+ and the first argument for method calls without parentheses.
456
+ Enabled: true
457
+
458
+ Style/SpaceAfterColon:
459
+ Description: 'Use spaces after colons.'
460
+ Enabled: true
461
+
462
+ Style/SpaceAfterComma:
463
+ Description: 'Use spaces after commas.'
464
+ Enabled: true
465
+
466
+ Style/SpaceAfterControlKeyword:
467
+ Description: 'Use spaces after if/elsif/unless/while/until/case/when.'
468
+ Enabled: true
469
+
470
+ Style/SpaceAfterMethodName:
471
+ Description: >-
472
+ Never put a space between a method name and the opening
473
+ parenthesis in a method definition.
474
+ Enabled: true
475
+
476
+ Style/SpaceAfterNot:
477
+ Description: Tracks redundant space after the ! operator.
478
+ Enabled: true
479
+
480
+ Style/SpaceAfterSemicolon:
481
+ Description: 'Use spaces after semicolons.'
482
+ Enabled: true
483
+
484
+ Style/SpaceBeforeBlockBraces:
485
+ Description: >-
486
+ Checks that the left block brace has or doesn't have space
487
+ before it.
488
+ Enabled: true
489
+
490
+ Style/SpaceBeforeComma:
491
+ Description: 'No spaces before commas.'
492
+ Enabled: true
493
+
494
+ Style/SpaceBeforeComment:
495
+ Description: >-
496
+ Checks for missing space between code and a comment on the
497
+ same line.
498
+ Enabled: true
499
+
500
+ Style/SpaceBeforeSemicolon:
501
+ Description: 'No spaces before semicolons.'
502
+ Enabled: true
503
+
504
+ Style/SpaceInsideBlockBraces:
505
+ Description: >-
506
+ Checks that block braces have or don't have surrounding space.
507
+ For blocks taking parameters, checks that the left brace has
508
+ or doesn't have trailing space.
509
+ Enabled: true
510
+
511
+ Style/SpaceAroundEqualsInParameterDefault:
512
+ Description: >-
513
+ Checks that the equals signs in parameter default assignments
514
+ have or don't have surrounding space depending on
515
+ configuration.
516
+ Enabled: true
517
+
518
+ Style/SpaceAroundOperators:
519
+ Description: 'Use spaces around operators.'
520
+ Enabled: true
521
+
522
+ Style/SpaceBeforeModifierKeyword:
523
+ Description: 'Put a space before the modifier keyword.'
524
+ Enabled: true
525
+
526
+ Style/SpaceInsideBrackets:
527
+ Description: 'No spaces after [ or before ].'
528
+ Enabled: true
529
+
530
+ Style/SpaceInsideHashLiteralBraces:
531
+ Description: "Use spaces inside hash literal braces - or don't."
532
+ Enabled: false
533
+ EnforcedStyle: no_space
534
+
535
+ Style/SpaceInsideParens:
536
+ Description: 'No spaces after ( or before ).'
537
+ Enabled: true
538
+
539
+ Style/SpaceInsideRangeLiteral:
540
+ Description: 'No spaces inside range literals.'
541
+ Enabled: true
542
+
543
+ Style/SpecialGlobalVars:
544
+ Description: 'Avoid Perl-style global variables.'
545
+ Enabled: false
546
+
547
+ Style/StringLiterals:
548
+ Description: 'Checks if uses of quotes match the configured preference.'
549
+ EnforcedStyle: double_quotes
550
+ Enabled: true
551
+
552
+ Style/StringLiteralsInInterpolation:
553
+ EnforcedStyle: double_quotes
554
+ Enabled: true
555
+
556
+ Style/SymbolArray:
557
+ Description: 'Use %i or %I for arrays of symbols.'
558
+ Enabled: true
559
+
560
+ Style/Tab:
561
+ Description: 'No hard tabs.'
562
+ Enabled: true
563
+
564
+ Style/TrailingBlankLines:
565
+ Description: 'Checks trailing blank lines and final newline.'
566
+ Enabled: true
567
+
568
+ Style/TrailingComma:
569
+ Description: 'Checks for trailing comma in parameter lists and literals.'
570
+ Enabled: false
571
+
572
+ Style/TrailingWhitespace:
573
+ Description: 'Avoid trailing whitespace.'
574
+ Enabled: true
575
+
576
+ Style/TrivialAccessors:
577
+ Description: 'Prefer attr_* methods to trivial readers/writers.'
578
+ Enabled: false
579
+
580
+ Style/UnlessElse:
581
+ Description: >-
582
+ Never use unless with else. Rewrite these with the positive
583
+ case first.
584
+ Enabled: true
585
+
586
+ Style/UnneededCapitalW:
587
+ Description: 'Checks for %W when interpolation is not needed.'
588
+ Enabled: true
589
+
590
+ Style/UnneededPercentQ:
591
+ Description: 'Checks for %q/%Q when single quotes or double quotes would do.'
592
+ Enabled: true
593
+
594
+ Style/UnneededPercentX:
595
+ Description: 'Checks for %x when `` would do.'
596
+ Enabled: true
597
+
598
+ Style/VariableInterpolation:
599
+ Description: >-
600
+ Don't interpolate global, instance and class variables
601
+ directly in strings.
602
+ Enabled: false
603
+
604
+ Style/VariableName:
605
+ Description: 'Use the configured style when naming variables.'
606
+ Enabled: true
607
+
608
+ Style/WhenThen:
609
+ Description: 'Use when x then ... for one-line cases.'
610
+ Enabled: false
611
+
612
+ Style/WhileUntilDo:
613
+ Description: 'Checks for redundant do after while or until.'
614
+ Enabled: true
615
+
616
+ Style/WhileUntilModifier:
617
+ Description: >-
618
+ Favor modifier while/until usage when you have a
619
+ single-line body.
620
+ Enabled: false
621
+
622
+ Style/WordArray:
623
+ Description: 'Use %w or %W for arrays of words.'
624
+ Enabled: false
625
+
626
+ #################### Metrics ################################
627
+ Metrics/AbcSize:
628
+ Max: 38
629
+
630
+ Metrics/BlockNesting:
631
+ Description: 'Avoid excessive block nesting'
632
+ Enabled: false
633
+
634
+ Metrics/ClassLength:
635
+ Description: 'Avoid classes longer than 100 lines of code.'
636
+ Enabled: true
637
+
638
+ Metrics/CyclomaticComplexity:
639
+ Description: >-
640
+ A complexity metric that is strongy correlated to the number
641
+ of test cases needed to validate a method.
642
+ Enabled: false
643
+
644
+ Metrics/LineLength:
645
+ Description: 'Limit lines to 80 characters.'
646
+ Enabled: true
647
+ Max: 80
648
+
649
+ Metrics/MethodLength:
650
+ Description: 'Avoid methods longer than 10 lines of code.'
651
+ Enabled: false
652
+
653
+ Metrics/ParameterLists:
654
+ Description: 'Avoid parameter lists longer than three or four parameters.'
655
+ Enabled: false
656
+
657
+ Metrics/PerceivedComplexity:
658
+ Description: >-
659
+ A complexity metric geared towards measuring complexity for a
660
+ human reader.
661
+ Enabled: true
662
+
663
+ #################### Lint ################################
664
+ ### Warnings
665
+
666
+ Lint/AmbiguousOperator:
667
+ Description: >-
668
+ Checks for ambiguous operators in the first argument of a
669
+ method invocation without parentheses.
670
+ Enabled: false
671
+
672
+ Lint/AmbiguousRegexpLiteral:
673
+ Description: >-
674
+ Checks for ambiguous regexp literals in the first argument of
675
+ a method invocation without parenthesis.
676
+ Enabled: false
677
+
678
+ Lint/AssignmentInCondition:
679
+ Description: "Don't use assignment in conditions."
680
+ Enabled: false
681
+
682
+ Lint/BlockAlignment:
683
+ Description: 'Align block ends correctly.'
684
+ Enabled: true
685
+
686
+ Lint/ConditionPosition:
687
+ Description: >-
688
+ Checks for condition placed in a confusing position relative to
689
+ the keyword.
690
+ Enabled: false
691
+
692
+ Lint/Debugger:
693
+ Description: 'Check for debugger calls.'
694
+ Enabled: true
695
+
696
+ Lint/DefEndAlignment:
697
+ Description: 'Align ends corresponding to defs correctly.'
698
+ Enabled: true
699
+
700
+ Lint/DeprecatedClassMethods:
701
+ Description: 'Check for deprecated class method calls.'
702
+ Enabled: false
703
+
704
+ Lint/ElseLayout:
705
+ Description: 'Check for odd code arrangement in an else block.'
706
+ Enabled: false
707
+
708
+ Lint/EmptyEnsure:
709
+ Description: 'Checks for empty ensure block.'
710
+ Enabled: true
711
+
712
+ Lint/EmptyInterpolation:
713
+ Description: 'Checks for empty string interpolation.'
714
+ Enabled: true
715
+
716
+ Lint/EndAlignment:
717
+ Description: 'Align ends correctly.'
718
+ Enabled: true
719
+
720
+ Lint/EndInMethod:
721
+ Description: 'END blocks should not be placed inside method definitions.'
722
+ Enabled: true
723
+
724
+ Lint/EnsureReturn:
725
+ Description: 'Never use return in an ensure block.'
726
+ Enabled: true
727
+
728
+ Lint/Eval:
729
+ Description: 'The use of eval represents a serious security risk.'
730
+ Enabled: true
731
+
732
+ Lint/HandleExceptions:
733
+ Description: "Don't suppress exception."
734
+ Enabled: false
735
+
736
+ Lint/InvalidCharacterLiteral:
737
+ Description: >-
738
+ Checks for invalid character literals with a non-escaped
739
+ whitespace character.
740
+ Enabled: false
741
+
742
+ Lint/LiteralInCondition:
743
+ Description: 'Checks of literals used in conditions.'
744
+ Enabled: false
745
+
746
+ Lint/LiteralInInterpolation:
747
+ Description: 'Checks for literals used in interpolation.'
748
+ Enabled: false
749
+
750
+ Lint/Loop:
751
+ Description: >-
752
+ Use Kernel#loop with break rather than begin/end/until or
753
+ begin/end/while for post-loop tests.
754
+ Enabled: false
755
+
756
+ Lint/ParenthesesAsGroupedExpression:
757
+ Description: >-
758
+ Checks for method calls with a space before the opening
759
+ parenthesis.
760
+ Enabled: false
761
+
762
+ Lint/RequireParentheses:
763
+ Description: >-
764
+ Use parentheses in the method call to avoid confusion
765
+ about precedence.
766
+ Enabled: false
767
+
768
+ Lint/RescueException:
769
+ Description: 'Avoid rescuing the Exception class.'
770
+ Enabled: true
771
+
772
+ Lint/ShadowingOuterLocalVariable:
773
+ Description: >-
774
+ Do not use the same name as outer local variable
775
+ for block arguments or block local variables.
776
+ Enabled: true
777
+
778
+ Lint/SpaceBeforeFirstArg:
779
+ Description: >-
780
+ Put a space between a method name and the first argument
781
+ in a method call without parentheses.
782
+ Enabled: true
783
+
784
+ Lint/StringConversionInInterpolation:
785
+ Description: 'Checks for Object#to_s usage in string interpolation.'
786
+ Enabled: true
787
+
788
+ Lint/UnderscorePrefixedVariableName:
789
+ Description: 'Do not use prefix `_` for a variable that is used.'
790
+ Enabled: false
791
+
792
+ Lint/UnusedBlockArgument:
793
+ Description: 'Checks for unused block arguments.'
794
+ Enabled: true
795
+
796
+ Lint/UnusedMethodArgument:
797
+ Description: 'Checks for unused method arguments.'
798
+ Enabled: true
799
+
800
+ Lint/UnreachableCode:
801
+ Description: 'Unreachable code.'
802
+ Enabled: true
803
+
804
+ Lint/UselessAccessModifier:
805
+ Description: 'Checks for useless access modifiers.'
806
+ Enabled: true
807
+
808
+ Lint/UselessAssignment:
809
+ Description: 'Checks for useless assignment to a local variable.'
810
+ Enabled: true
811
+
812
+ Lint/UselessComparison:
813
+ Description: 'Checks for comparison of something with itself.'
814
+ Enabled: true
815
+
816
+ Lint/UselessElseWithoutRescue:
817
+ Description: 'Checks for useless `else` in `begin..end` without `rescue`.'
818
+ Enabled: true
819
+
820
+ Lint/UselessSetterCall:
821
+ Description: 'Checks for useless setter call to a local variable.'
822
+ Enabled: true
823
+
824
+ Lint/Void:
825
+ Description: 'Possible use of operator/literal/variable in void context.'
826
+ Enabled: false
827
+
828
+ ##################### Rails ##################################
829
+
830
+ Rails/ActionFilter:
831
+ Description: 'Enforces consistent use of action filter methods.'
832
+ Enabled: false
833
+
834
+ Rails/DefaultScope:
835
+ Description: 'Checks if the argument passed to default_scope is a block.'
836
+ Enabled: true
837
+
838
+ Rails/Delegate:
839
+ Description: 'Prefer delegate method for delegations.'
840
+ Enabled: false
841
+
842
+ Rails/HasAndBelongsToMany:
843
+ Description: 'Prefer has_many :through to has_and_belongs_to_many.'
844
+ Enabled: true
845
+
846
+ Rails/Output:
847
+ Description: 'Checks for calls to puts, print, etc.'
848
+ Enabled: true
849
+
850
+ Rails/ReadWriteAttribute:
851
+ Description: >-
852
+ Checks for read_attribute(:attr) and
853
+ write_attribute(:attr, val).
854
+ Enabled: true
855
+
856
+ Rails/ScopeArgs:
857
+ Description: 'Checks the arguments of ActiveRecord scopes.'
858
+ Enabled: true
859
+
860
+ Rails/Validation:
861
+ Description: 'Use validates :attribute, hash of validations.'
862
+ Enabled: true
@@ -0,0 +1,3 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.1.5
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source "https://rubygems.org"
2
+
3
+ gemspec
@@ -0,0 +1,35 @@
1
+ # Takky, an asynchronous image/file attachment gem
2
+
3
+ [![Build Status](https://travis-ci.org/jmdeldin/takky.svg)](https://magnum.travis-ci.com/jmdeldin/takky)
4
+ [![Code Climate](https://codeclimate.com/github/jmdeldin/takky/badges/gpa.svg)](https://codeclimate.com/github/jmdeldin/takky)
5
+
6
+ Takky aims to make uploading, storing, and processing file attachments
7
+ simpler, easier, clearer, and more robust than existing file management
8
+ gems. It works best in asynchronous environments using Sidekiq, but it
9
+ supports synchronous uploads to Amazon S3 by default.
10
+
11
+ ## Installation
12
+
13
+ Add this line to your application's Gemfile:
14
+
15
+ ```ruby
16
+ gem "takky"
17
+ ```
18
+
19
+ And then execute:
20
+
21
+ ```sh
22
+ % bundle
23
+ ```
24
+
25
+ ## Usage
26
+
27
+ ## Development
28
+
29
+ ## Contributing
30
+
31
+ 1. Fork it ( https://github.com/jmdeldin/takky/fork )
32
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
33
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
34
+ 4. Push to the branch (`git push origin my-new-feature`)
35
+ 5. Create a new Pull Request
@@ -0,0 +1,10 @@
1
+ require "bundler/gem_tasks"
2
+ require "rake/clean"
3
+ require "rake/testtask"
4
+
5
+ CLOBBER << "pkg"
6
+
7
+ Rake::TestTask.new do |t|
8
+ t.test_files = FileList["spec/*_spec.rb"]
9
+ t.libs << "spec"
10
+ end
@@ -0,0 +1,5 @@
1
+ module Takky
2
+ VERSION = "0.0.0"
3
+
4
+ require "takky/path"
5
+ end
@@ -0,0 +1,24 @@
1
+ require "forwardable"
2
+
3
+ module Takky
4
+ class Path
5
+ extend Forwardable
6
+
7
+ attr_reader :attachment, :prefix
8
+ def_delegators :@attachment, :environment, :filename
9
+
10
+ # TODO: this prefix should be configurable at the model level
11
+ def initialize(attachment, prefix: "img")
12
+ @attachment = attachment
13
+ @prefix = prefix
14
+ end
15
+
16
+ def to_s
17
+ r = root and "#{r}/#{filename}"
18
+ end
19
+
20
+ def root
21
+ filename && "#{prefix}/#{environment}/#{attachment.id}"
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,33 @@
1
+ require "spec_helper"
2
+
3
+ class TestPath < TestCase
4
+ let(:filename) { "hashed_filename.jpg" }
5
+ let(:attachment) {
6
+ OpenStruct.new(filename: "filename.jpg", id: 1, environment: "t")
7
+ }
8
+
9
+ let(:path) { described_class.new(attachment) }
10
+
11
+ describe "#to_s" do
12
+ # TODO: empty strings?
13
+ it "is nil if the attachment filename is blank" do
14
+ attachment.filename = nil
15
+ path.to_s.must_equal nil
16
+ end
17
+
18
+ it "returns the path otherwise" do
19
+ path.to_s.must_equal "img/t/1/filename.jpg"
20
+ end
21
+ end
22
+
23
+ describe "#root" do
24
+ it "is nil if the attachment filename is blank" do
25
+ attachment.filename = nil
26
+ path.root.must_equal nil
27
+ end
28
+
29
+ it "returns the path otherwise" do
30
+ path.root.must_equal "img/t/#{attachment.id}"
31
+ end
32
+ end
33
+ end
@@ -0,0 +1,9 @@
1
+ require "minitest/autorun"
2
+ require "minitest/pride" unless ENV["TERM"] == "dumb"
3
+ require "takky"
4
+
5
+ class TestCase < MiniTest::Spec
6
+ def described_class
7
+ Kernel.const_get self.class.superclass.to_s.sub(/\ATest/, "Takky::")
8
+ end
9
+ end
@@ -0,0 +1,22 @@
1
+ lib = File.expand_path("../lib", __FILE__)
2
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
+ require "takky"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "takky"
7
+ spec.version = Takky::VERSION
8
+ spec.authors = ["Jon-Michael Deldin"]
9
+ spec.email = ["dev@jmdeldin.com"]
10
+
11
+ spec.summary = "Asynchronous model upload/attachment gem."
12
+ # spec.description
13
+ spec.homepage = "https://github.com/jmdeldin/takky"
14
+
15
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f =~ /test/ }
16
+ spec.bindir = "exe"
17
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
18
+ spec.require_paths = ["lib"]
19
+
20
+ spec.add_development_dependency "bundler", "~> 1.8"
21
+ spec.add_development_dependency "rake", "~> 10.0"
22
+ end
metadata ADDED
@@ -0,0 +1,83 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: takky
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Jon-Michael Deldin
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2015-03-20 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: '1.8'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.8'
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
+ description:
42
+ email:
43
+ - dev@jmdeldin.com
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - ".gitignore"
49
+ - ".rubocop.yml"
50
+ - ".travis.yml"
51
+ - Gemfile
52
+ - README.md
53
+ - Rakefile
54
+ - lib/takky.rb
55
+ - lib/takky/path.rb
56
+ - spec/path_spec.rb
57
+ - spec/spec_helper.rb
58
+ - takky.gemspec
59
+ homepage: https://github.com/jmdeldin/takky
60
+ licenses: []
61
+ metadata: {}
62
+ post_install_message:
63
+ rdoc_options: []
64
+ require_paths:
65
+ - lib
66
+ required_ruby_version: !ruby/object:Gem::Requirement
67
+ requirements:
68
+ - - ">="
69
+ - !ruby/object:Gem::Version
70
+ version: '0'
71
+ required_rubygems_version: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ requirements: []
77
+ rubyforge_project:
78
+ rubygems_version: 2.2.2
79
+ signing_key:
80
+ specification_version: 4
81
+ summary: Asynchronous model upload/attachment gem.
82
+ test_files: []
83
+ has_rdoc: