dummy_locale 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: aceae56fbc7982a114f2005625a1d5d43de93e757d39b694e0aa525e2fd349dc
4
+ data.tar.gz: 175dae20a84ec540e5722dc8b9d3a4a9252fc676c3154181cab36e110ad86e26
5
+ SHA512:
6
+ metadata.gz: 43c3cba2fb04580810702b28b50d073d8823b4a63c52905e45fffb6093898d456e88e125f9457ae2624d833b276cb617a40862ba0b3c959aef0279d3c7b12cdb
7
+ data.tar.gz: 4a7f4c3f8d709a610a2925a73ad279e3b6684e435fa00ff0b1fab9298da9469607fd6b15b5dc7bb77e5f5d8a96e82f80feba6692ffddb3b67d90a3e4b49c6461
data/.gitignore ADDED
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require "spec_helper"
data/.rubocop.yml ADDED
@@ -0,0 +1,638 @@
1
+ AllCops:
2
+ Exclude:
3
+ - '*.gemspec'
4
+ - db/schema.rb
5
+
6
+ Style/AccessorMethodName:
7
+ Description: Check the naming of accessor methods for get_/set_.
8
+ Enabled: false
9
+
10
+ Style/Alias:
11
+ Description: 'Use alias_method instead of alias.'
12
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#alias-method'
13
+ Enabled: false
14
+
15
+ Style/AlignParameters:
16
+ Description: 'Here we check if the parameters on a multi-line method call or definition are aligned.'
17
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-double-indent'
18
+ Enabled: false
19
+
20
+ Style/ArrayJoin:
21
+ Description: 'Use Array#join instead of Array#*.'
22
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#array-join'
23
+ Enabled: false
24
+
25
+ Style/AsciiComments:
26
+ Description: 'Use only ascii symbols in comments.'
27
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#english-comments'
28
+ Enabled: false
29
+
30
+ Style/AsciiIdentifiers:
31
+ Description: 'Use only ascii symbols in identifiers.'
32
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#english-identifiers'
33
+ Enabled: false
34
+
35
+ Style/Attr:
36
+ Description: 'Checks for uses of Module#attr.'
37
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#attr'
38
+ Enabled: false
39
+
40
+ Metrics/BlockNesting:
41
+ Description: 'Avoid excessive block nesting'
42
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#three-is-the-number-thou-shalt-count'
43
+ Enabled: false
44
+
45
+ Style/CaseEquality:
46
+ Description: 'Avoid explicit use of the case equality operator(===).'
47
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-case-equality'
48
+ Enabled: false
49
+
50
+ Style/CharacterLiteral:
51
+ Description: 'Checks for uses of character literals.'
52
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-character-literals'
53
+ Enabled: false
54
+
55
+ Style/ClassAndModuleChildren:
56
+ Description: 'Checks style of children classes and modules.'
57
+ Enabled: true
58
+ EnforcedStyle: nested
59
+
60
+ Metrics/ClassLength:
61
+ Description: 'Avoid classes longer than 100 lines of code.'
62
+ Enabled: false
63
+
64
+ Metrics/ModuleLength:
65
+ Description: 'Avoid modules longer than 100 lines of code.'
66
+ Enabled: false
67
+
68
+ Style/ClassVars:
69
+ Description: 'Avoid the use of class variables.'
70
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-class-vars'
71
+ Enabled: false
72
+
73
+ Style/CollectionMethods:
74
+ Enabled: true
75
+ PreferredMethods:
76
+ find: detect
77
+ inject: reduce
78
+ collect: map
79
+ find_all: select
80
+
81
+ Style/ColonMethodCall:
82
+ Description: 'Do not use :: for method call.'
83
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#double-colons'
84
+ Enabled: false
85
+
86
+ Style/CommentAnnotation:
87
+ Description: >-
88
+ Checks formatting of special comments
89
+ (TODO, FIXME, OPTIMIZE, HACK, REVIEW).
90
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#annotate-keywords'
91
+ Enabled: false
92
+
93
+ Metrics/AbcSize:
94
+ Description: >-
95
+ A calculated magnitude based on number of assignments,
96
+ branches, and conditions.
97
+ Enabled: false
98
+
99
+ Metrics/CyclomaticComplexity:
100
+ Description: >-
101
+ A complexity metric that is strongly correlated to the number
102
+ of test cases needed to validate a method.
103
+ Enabled: false
104
+
105
+ Rails/Delegate:
106
+ Description: 'Prefer delegate method for delegations.'
107
+ Enabled: false
108
+
109
+ Style/PreferredHashMethods:
110
+ Description: 'Checks use of `has_key?` and `has_value?` Hash methods.'
111
+ StyleGuide: '#hash-key'
112
+ Enabled: false
113
+
114
+ Style/Documentation:
115
+ Description: 'Document classes and non-namespace modules.'
116
+ Enabled: false
117
+
118
+ Style/DotPosition:
119
+ Description: 'Checks the position of the dot in multi-line method calls.'
120
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains'
121
+ EnforcedStyle: trailing
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
+ Style/ExtraSpacing:
149
+ Description: 'Do not use unnecessary spacing.'
150
+ Enabled: true
151
+
152
+ Style/FileName:
153
+ Description: 'Use snake_case for source file names.'
154
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#snake-case-files'
155
+ Enabled: false
156
+
157
+ Style/FrozenStringLiteralComment:
158
+ Description: >-
159
+ Add the frozen_string_literal comment to the top of files
160
+ to help transition from Ruby 2.3.0 to Ruby 3.0.
161
+ Enabled: false
162
+
163
+ Style/FlipFlop:
164
+ Description: 'Checks for flip flops'
165
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-flip-flops'
166
+ Enabled: false
167
+
168
+ Style/FormatString:
169
+ Description: 'Enforce the use of Kernel#sprintf, Kernel#format or String#%.'
170
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#sprintf'
171
+ Enabled: false
172
+
173
+ Style/GlobalVars:
174
+ Description: 'Do not introduce global variables.'
175
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#instance-vars'
176
+ Reference: 'http://www.zenspider.com/Languages/Ruby/QuickRef.html'
177
+ Enabled: false
178
+
179
+ Style/GuardClause:
180
+ Description: 'Check for conditionals that can be replaced with guard clauses'
181
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals'
182
+ Enabled: false
183
+
184
+ Style/IfUnlessModifier:
185
+ Description: >-
186
+ Favor modifier if/unless usage when you have a
187
+ single-line body.
188
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#if-as-a-modifier'
189
+ Enabled: false
190
+
191
+ Style/IfWithSemicolon:
192
+ Description: 'Do not use if x; .... Use the ternary operator instead.'
193
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-semicolon-ifs'
194
+ Enabled: false
195
+
196
+ Style/InlineComment:
197
+ Description: 'Avoid inline comments.'
198
+ Enabled: false
199
+
200
+ Style/Lambda:
201
+ Description: 'Use the new lambda literal syntax for single-line blocks.'
202
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#lambda-multi-line'
203
+ Enabled: false
204
+
205
+ Style/LambdaCall:
206
+ Description: 'Use lambda.call(...) instead of lambda.(...).'
207
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#proc-call'
208
+ Enabled: false
209
+
210
+ Style/LineEndConcatenation:
211
+ Description: >-
212
+ Use \ instead of + or << to concatenate two string literals at
213
+ line end.
214
+ Enabled: false
215
+
216
+ Metrics/LineLength:
217
+ Description: 'Limit lines to 80 characters.'
218
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#80-character-limits'
219
+ Max: 80
220
+
221
+ Metrics/MethodLength:
222
+ Description: 'Avoid methods longer than 10 lines of code.'
223
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#short-methods'
224
+ Enabled: false
225
+
226
+ Style/ModuleFunction:
227
+ Description: 'Checks for usage of `extend self` in modules.'
228
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#module-function'
229
+ Enabled: false
230
+
231
+ Style/MultilineOperationIndentation:
232
+ Description: >-
233
+ Checks indentation of binary operations that span more than
234
+ one line.
235
+ Enabled: true
236
+ EnforcedStyle: indented
237
+
238
+ Style/MultilineBlockChain:
239
+ Description: 'Avoid multi-line chains of blocks.'
240
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#single-line-blocks'
241
+ Enabled: false
242
+
243
+ Style/MultilineMethodCallIndentation:
244
+ Description: >-
245
+ Checks indentation of method calls with the dot operator
246
+ that span more than one line.
247
+ Enabled: true
248
+ EnforcedStyle: indented
249
+
250
+ Style/NegatedIf:
251
+ Description: >-
252
+ Favor unless over if for negative conditions
253
+ (or control flow or).
254
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#unless-for-negatives'
255
+ Enabled: false
256
+
257
+ Style/NegatedWhile:
258
+ Description: 'Favor until over while for negative conditions.'
259
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#until-for-negatives'
260
+ Enabled: false
261
+
262
+ Style/Next:
263
+ Description: 'Use `next` to skip iteration instead of a condition at the end.'
264
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals'
265
+ Enabled: false
266
+
267
+ Style/NilComparison:
268
+ Description: 'Prefer x.nil? to x == nil.'
269
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#predicate-methods'
270
+ Enabled: false
271
+
272
+ Style/Not:
273
+ Description: 'Use ! instead of not.'
274
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#bang-not-not'
275
+ Enabled: false
276
+
277
+ Style/NumericLiterals:
278
+ Description: >-
279
+ Add underscores to large numeric literals to improve their
280
+ readability.
281
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#underscores-in-numerics'
282
+ Enabled: false
283
+
284
+ Style/OneLineConditional:
285
+ Description: >-
286
+ Favor the ternary operator(?:) over
287
+ if/then/else/end constructs.
288
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#ternary-operator'
289
+ Enabled: false
290
+
291
+ Style/OpMethod:
292
+ Description: 'When defining binary operators, name the argument other.'
293
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#other-arg'
294
+ Enabled: false
295
+
296
+ Metrics/ParameterLists:
297
+ Description: 'Avoid parameter lists longer than three or four parameters.'
298
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#too-many-params'
299
+ Enabled: false
300
+
301
+ Style/PercentLiteralDelimiters:
302
+ Description: 'Use `%`-literal delimiters consistently'
303
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-literal-braces'
304
+ Enabled: false
305
+
306
+ Style/PerlBackrefs:
307
+ Description: 'Avoid Perl-style regex back references.'
308
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-perl-regexp-last-matchers'
309
+ Enabled: false
310
+
311
+ Style/PredicateName:
312
+ Description: 'Check the names of predicate methods.'
313
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#bool-methods-qmark'
314
+ NamePrefixBlacklist:
315
+ - is_
316
+ Exclude:
317
+ - spec/**/*
318
+
319
+ Style/Proc:
320
+ Description: 'Use proc instead of Proc.new.'
321
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#proc'
322
+ Enabled: false
323
+
324
+ Style/RaiseArgs:
325
+ Description: 'Checks the arguments passed to raise/fail.'
326
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#exception-class-messages'
327
+ Enabled: false
328
+
329
+ Style/RegexpLiteral:
330
+ Description: 'Use / or %r around regular expressions.'
331
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-r'
332
+ Enabled: false
333
+
334
+ Style/SelfAssignment:
335
+ Description: >-
336
+ Checks for places where self-assignment shorthand should have
337
+ been used.
338
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#self-assignment'
339
+ Enabled: false
340
+
341
+ Style/SingleLineBlockParams:
342
+ Description: 'Enforces the names of some block params.'
343
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#reduce-blocks'
344
+ Enabled: false
345
+
346
+ Style/SingleLineMethods:
347
+ Description: 'Avoid single-line methods.'
348
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-single-line-methods'
349
+ Enabled: false
350
+
351
+ Style/SignalException:
352
+ Description: 'Checks for proper usage of fail and raise.'
353
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#fail-method'
354
+ Enabled: false
355
+
356
+ Style/SpecialGlobalVars:
357
+ Description: 'Avoid Perl-style global variables.'
358
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-cryptic-perlisms'
359
+ Enabled: false
360
+
361
+ Style/StringLiterals:
362
+ Description: 'Checks if uses of quotes match the configured preference.'
363
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#consistent-string-literals'
364
+ EnforcedStyle: double_quotes
365
+ Enabled: true
366
+
367
+ Style/TrailingCommaInArguments:
368
+ Description: 'Checks for trailing comma in argument lists.'
369
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
370
+ EnforcedStyleForMultiline: comma
371
+ SupportedStyles:
372
+ - comma
373
+ - consistent_comma
374
+ - no_comma
375
+ Enabled: true
376
+
377
+ Style/TrailingCommaInLiteral:
378
+ Description: 'Checks for trailing comma in array and hash literals.'
379
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas'
380
+ EnforcedStyleForMultiline: comma
381
+ SupportedStyles:
382
+ - comma
383
+ - consistent_comma
384
+ - no_comma
385
+ Enabled: true
386
+
387
+ Style/TrivialAccessors:
388
+ Description: 'Prefer attr_* methods to trivial readers/writers.'
389
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#attr_family'
390
+ Enabled: false
391
+
392
+ Style/VariableInterpolation:
393
+ Description: >-
394
+ Don't interpolate global, instance and class variables
395
+ directly in strings.
396
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#curlies-interpolate'
397
+ Enabled: false
398
+
399
+ Style/WhenThen:
400
+ Description: 'Use when x then ... for one-line cases.'
401
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#one-line-cases'
402
+ Enabled: false
403
+
404
+ Style/WhileUntilModifier:
405
+ Description: >-
406
+ Favor modifier while/until usage when you have a
407
+ single-line body.
408
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#while-as-a-modifier'
409
+ Enabled: false
410
+
411
+ Style/WordArray:
412
+ Description: 'Use %w or %W for arrays of words.'
413
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#percent-w'
414
+ Enabled: false
415
+
416
+ # Lint
417
+
418
+ Lint/AmbiguousOperator:
419
+ Description: >-
420
+ Checks for ambiguous operators in the first argument of a
421
+ method invocation without parentheses.
422
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-as-args'
423
+ Enabled: false
424
+
425
+ Lint/AmbiguousRegexpLiteral:
426
+ Description: >-
427
+ Checks for ambiguous regexp literals in the first argument of
428
+ a method invocation without parenthesis.
429
+ Enabled: false
430
+
431
+ Lint/AssignmentInCondition:
432
+ Description: "Don't use assignment in conditions."
433
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#safe-assignment-in-condition'
434
+ Enabled: false
435
+
436
+ Lint/CircularArgumentReference:
437
+ Description: "Don't refer to the keyword argument in the default value."
438
+ Enabled: false
439
+
440
+ Lint/ConditionPosition:
441
+ Description: >-
442
+ Checks for condition placed in a confusing position relative to
443
+ the keyword.
444
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#same-line-condition'
445
+ Enabled: false
446
+
447
+ Lint/DeprecatedClassMethods:
448
+ Description: 'Check for deprecated class method calls.'
449
+ Enabled: false
450
+
451
+ Lint/DuplicatedKey:
452
+ Description: 'Check for duplicate keys in hash literals.'
453
+ Enabled: false
454
+
455
+ Lint/EachWithObjectArgument:
456
+ Description: 'Check for immutable argument given to each_with_object.'
457
+ Enabled: false
458
+
459
+ Lint/ElseLayout:
460
+ Description: 'Check for odd code arrangement in an else block.'
461
+ Enabled: false
462
+
463
+ Lint/FormatParameterMismatch:
464
+ Description: 'The number of parameters to format/sprint must match the fields.'
465
+ Enabled: false
466
+
467
+ Lint/HandleExceptions:
468
+ Description: "Don't suppress exception."
469
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#dont-hide-exceptions'
470
+ Enabled: false
471
+
472
+ Lint/InvalidCharacterLiteral:
473
+ Description: >-
474
+ Checks for invalid character literals with a non-escaped
475
+ whitespace character.
476
+ Enabled: false
477
+
478
+ Style/InitialIndentation:
479
+ Description: >-
480
+ Checks the indentation of the first non-blank non-comment line in a file.
481
+ Enabled: false
482
+
483
+ Lint/LiteralInCondition:
484
+ Description: 'Checks of literals used in conditions.'
485
+ Enabled: false
486
+
487
+ Lint/LiteralInInterpolation:
488
+ Description: 'Checks for literals used in interpolation.'
489
+ Enabled: false
490
+
491
+ Lint/Loop:
492
+ Description: >-
493
+ Use Kernel#loop with break rather than begin/end/until or
494
+ begin/end/while for post-loop tests.
495
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#loop-with-break'
496
+ Enabled: false
497
+
498
+ Lint/NestedMethodDefinition:
499
+ Description: 'Do not use nested method definitions.'
500
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-nested-methods'
501
+ Enabled: false
502
+
503
+ Lint/NonLocalExitFromIterator:
504
+ Description: 'Do not use return in iterator to cause non-local exit.'
505
+ Enabled: false
506
+
507
+ Lint/ParenthesesAsGroupedExpression:
508
+ Description: >-
509
+ Checks for method calls with a space before the opening
510
+ parenthesis.
511
+ StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#parens-no-spaces'
512
+ Enabled: false
513
+
514
+ Lint/RequireParentheses:
515
+ Description: >-
516
+ Use parentheses in the method call to avoid confusion
517
+ about precedence.
518
+ Enabled: false
519
+
520
+ Lint/UnderscorePrefixedVariableName:
521
+ Description: 'Do not use prefix `_` for a variable that is used.'
522
+ Enabled: false
523
+
524
+ Lint/UnneededDisable:
525
+ Description: >-
526
+ Checks for rubocop:disable comments that can be removed.
527
+ Note: this cop is not disabled when disabling all cops.
528
+ It must be explicitly disabled.
529
+ Enabled: false
530
+
531
+ Lint/Void:
532
+ Description: 'Possible use of operator/literal/variable in void context.'
533
+ Enabled: false
534
+
535
+ # Performance
536
+
537
+ Performance/CaseWhenSplat:
538
+ Description: >-
539
+ Place `when` conditions that use splat at the end
540
+ of the list of `when` branches.
541
+ Enabled: false
542
+
543
+ Performance/Count:
544
+ Description: >-
545
+ Use `count` instead of `select...size`, `reject...size`,
546
+ `select...count`, `reject...count`, `select...length`,
547
+ and `reject...length`.
548
+ Enabled: false
549
+
550
+ Performance/Detect:
551
+ Description: >-
552
+ Use `detect` instead of `select.first`, `find_all.first`,
553
+ `select.last`, and `find_all.last`.
554
+ Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerabledetect-vs-enumerableselectfirst-code'
555
+ Enabled: false
556
+
557
+ Performance/FlatMap:
558
+ Description: >-
559
+ Use `Enumerable#flat_map`
560
+ instead of `Enumerable#map...Array#flatten(1)`
561
+ or `Enumberable#collect..Array#flatten(1)`
562
+ Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerablemaparrayflatten-vs-enumerableflat_map-code'
563
+ Enabled: false
564
+
565
+ Performance/ReverseEach:
566
+ Description: 'Use `reverse_each` instead of `reverse.each`.'
567
+ Reference: 'https://github.com/JuanitoFatas/fast-ruby#enumerablereverseeach-vs-enumerablereverse_each-code'
568
+ Enabled: false
569
+
570
+ Performance/Sample:
571
+ Description: >-
572
+ Use `sample` instead of `shuffle.first`,
573
+ `shuffle.last`, and `shuffle[Fixnum]`.
574
+ Reference: 'https://github.com/JuanitoFatas/fast-ruby#arrayshufflefirst-vs-arraysample-code'
575
+ Enabled: false
576
+
577
+ Performance/Size:
578
+ Description: >-
579
+ Use `size` instead of `count` for counting
580
+ the number of elements in `Array` and `Hash`.
581
+ Reference: 'https://github.com/JuanitoFatas/fast-ruby#arraycount-vs-arraysize-code'
582
+ Enabled: false
583
+
584
+ Performance/StringReplacement:
585
+ Description: >-
586
+ Use `tr` instead of `gsub` when you are replacing the same
587
+ number of characters. Use `delete` instead of `gsub` when
588
+ you are deleting characters.
589
+ Reference: 'https://github.com/JuanitoFatas/fast-ruby#stringgsub-vs-stringtr-code'
590
+ Enabled: false
591
+
592
+ # Rails
593
+
594
+ Rails/ActionFilter:
595
+ Description: 'Enforces consistent use of action filter methods.'
596
+ Enabled: false
597
+
598
+ Rails/Date:
599
+ Description: >-
600
+ Checks the correct usage of date aware methods,
601
+ such as Date.today, Date.current etc.
602
+ Enabled: false
603
+
604
+ Rails/FindBy:
605
+ Description: 'Prefer find_by over where.first.'
606
+ Enabled: false
607
+
608
+ Rails/FindEach:
609
+ Description: 'Prefer all.find_each over all.find.'
610
+ Enabled: false
611
+
612
+ Rails/HasAndBelongsToMany:
613
+ Description: 'Prefer has_many :through to has_and_belongs_to_many.'
614
+ Enabled: false
615
+
616
+ Rails/Output:
617
+ Description: 'Checks for calls to puts, print, etc.'
618
+ Enabled: false
619
+
620
+ Rails/ReadWriteAttribute:
621
+ Description: >-
622
+ Checks for read_attribute(:attr) and
623
+ write_attribute(:attr, val).
624
+ Enabled: false
625
+
626
+ Rails/ScopeArgs:
627
+ Description: 'Checks the arguments of ActiveRecord scopes.'
628
+ Enabled: false
629
+
630
+ Rails/TimeZone:
631
+ Description: 'Checks the correct usage of time zone aware methods.'
632
+ StyleGuide: 'https://github.com/bbatsov/rails-style-guide#time'
633
+ Reference: 'http://danilenko.org/2012/7/6/rails_timezones'
634
+ Enabled: false
635
+
636
+ Rails/Validation:
637
+ Description: 'Use validates :attribute, hash of validations.'
638
+ Enabled: false
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.3.3
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,24 @@
1
+ # Contributing
2
+
3
+ We love contributions from everyone. By participating in this project, you
4
+ agree to abide by the thoughtbot [code of conduct].
5
+
6
+ [code of conduct]: https://thoughtbot.com/open-source-code-of-conduct
7
+
8
+ We expect everyone to follow the code of conduct anywhere in thoughtbot's
9
+ project codebases, issue trackers, chatrooms, and mailing lists.
10
+
11
+ ## Contributing Code
12
+
13
+ 1. Fork the repository.
14
+ 2. Run `bin/setup`.
15
+ 3. Run `bin/rake` to verify that the tests pass.
16
+ 4. Make your change with new passing tests, following the [style guide].
17
+ 5. Write a [good commit message], push your fork, and submit a pull request.
18
+
19
+ [style guide]: https://github.com/thoughtbot/guides/tree/master/style
20
+ [good commit message]: http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html
21
+
22
+ Others will give constructive feedback. This is a time for discussion and
23
+ improvements, and making the necessary changes will be required before we can
24
+ merge the contribution.
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in dummy_locale.gemspec
4
+ gemspec
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2017 Derek Prior
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,53 @@
1
+ # Dummy Locale
2
+
3
+ Dummy Locale builds a complete copy of the specified source locale at runtime.
4
+
5
+ ## But Why?
6
+
7
+ > Product Manager: "We need to ensure our application is ready for
8
+ > internationalization."
9
+ >
10
+ > Developer: "Alright, I have extracted all strings to translations."
11
+ >
12
+ > Product Manager: "How can I verify this work is complete?"
13
+ >
14
+ > Developer: "Umm..."
15
+
16
+ Even if the product manager takes your assertion on faith, you've likely missed
17
+ labels generated by form builders, full error messages displayed when
18
+ re-rendering forms, and other strings that Rails defaults to English via
19
+ `humanize`. Even raising on missing translations will fail to catch these.
20
+
21
+ Dummy Locale builds a complete copy of your source locale, with each value
22
+ "translated" by bracketing it with the locale. For example, in the default
23
+ configuration, a key that translates to "Example" in the source locale will
24
+ translate to "ZZExampleZZ" in the dummy locale.
25
+
26
+ The application remains usable but allows developers and product managers to
27
+ easily see which strings may have been missed.
28
+
29
+ ## Installation
30
+
31
+ Add `gem "dummy_locale"` to your Gemfile and bundle. It is recommended this be
32
+ added to development and staging environments.
33
+
34
+ ## Usage
35
+
36
+ Create `config/initializers/dummy_locale.rb` like so:
37
+
38
+ ```ruby
39
+ if defined?(DummyLocale)
40
+ DummyLocale.generate(source_locale: :en, destination_locale: :zz)
41
+ end
42
+ ```
43
+
44
+ Those are the default values for `source_locale` and `destination_locale`. They
45
+ can be omitted if desired.
46
+
47
+ Run `rails server`, visit your application, and switch your locale to the
48
+ `destination_locale`.
49
+
50
+ ## About
51
+
52
+ Dummy Locale is maintained by [Derek Prior]
53
+ [Derek Prior]: http://prioritized.net
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,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "dummy_locale"
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
+ IRB.start
data/bin/setup ADDED
@@ -0,0 +1,7 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+
5
+ bundle install
6
+
7
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,27 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path("../lib", __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require "dummy_locale/version"
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = "dummy_locale"
8
+ spec.version = DummyLocale::VERSION
9
+ spec.authors = ["Derek Prior"]
10
+ spec.email = ["derekprior@gmail.com"]
11
+
12
+ spec.summary = "Generates a dummy locale for visually confirming translations"
13
+ spec.homepage = "https://github.com/thoughtbot/dummy_locale"
14
+ spec.license = "MIT"
15
+
16
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
17
+ spec.bindir = "exe"
18
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
19
+ spec.require_paths = ["lib"]
20
+
21
+ spec.add_development_dependency "bundler", ">= 1.10"
22
+ spec.add_development_dependency "rake", ">= 10.0"
23
+ spec.add_development_dependency "rspec", "~> 3.5"
24
+
25
+ spec.add_runtime_dependency "i18n"
26
+ spec.add_runtime_dependency "activesupport"
27
+ end
@@ -0,0 +1,47 @@
1
+ require "active_support/core_ext/hash"
2
+
3
+ module DummyLocale
4
+ class Locale
5
+ def initialize(source_locale: :en, destination_locale: :zz)
6
+ @source_locale = source_locale.to_sym
7
+ @destination_locale = destination_locale.to_sym
8
+ @tag = destination_locale.to_s.upcase
9
+ end
10
+
11
+ # Generates the destination locale from the source locale
12
+ #
13
+ # Wraps the translated values in an upcased version of the destination
14
+ # locale specifier and adds the destination locale to the list of available
15
+ # locales.
16
+ def generate
17
+ I18n.backend.load_translations
18
+ translations = wrap(source_translations)
19
+ I18n.backend.store_translations(destination_locale, translations)
20
+ I18n.available_locales += [destination_locale]
21
+ end
22
+
23
+ private
24
+
25
+ attr_reader :source_locale, :destination_locale, :tag
26
+
27
+ def source_translations
28
+ I18n.backend.send(:translations)[source_locale] ||
29
+ raise("Unable to find source translations for #{source_locale}")
30
+ end
31
+
32
+ def wrap(translations)
33
+ case translations
34
+ when Hash
35
+ translations.transform_values { |value| wrap(value) }
36
+ when Array
37
+ translations.map { |item| wrap(item) }
38
+ else
39
+ wrap_with_tag(translations)
40
+ end
41
+ end
42
+
43
+ def wrap_with_tag(translation)
44
+ "#{tag}#{translation}#{tag}"
45
+ end
46
+ end
47
+ end
@@ -0,0 +1,3 @@
1
+ module DummyLocale
2
+ VERSION = "0.1.0".freeze
3
+ end
@@ -0,0 +1,35 @@
1
+ require "i18n"
2
+ require "dummy_locale/version"
3
+ require "dummy_locale/locale"
4
+
5
+
6
+ # DummyLocale builds a complete copy of the source locale at runtime, modifying
7
+ # each translated string in a way that allows you to easily distinguish
8
+ # internationalized strings from hard-coded strings when doing UI testing.
9
+ module DummyLocale
10
+
11
+ # Creates the dummy locale from the source locale and hooks `I18n.reload!`
12
+ #
13
+ # When Rails or other code calls `I18n.reload!` to pick up new and modified
14
+ # entries, DummyLocale will regenerate the locale from the updated source.
15
+ # This helps us seamlessly pick up translation changes in development.
16
+ def self.generate(source_locale: :en, destination_locale: :zz)
17
+ dummy_locale = Locale.new(
18
+ source_locale: source_locale,
19
+ destination_locale: destination_locale
20
+ )
21
+
22
+ dummy_locale.generate
23
+ I18n.backend.class.prepend(reloader_for(dummy_locale))
24
+ end
25
+
26
+ # Generates a module that is aware of DummyLocale
27
+ def self.reloader_for(dummy_locale)
28
+ Module.new do
29
+ define_method "reload!" do
30
+ super()
31
+ dummy_locale.generate
32
+ end
33
+ end
34
+ end
35
+ end
metadata ADDED
@@ -0,0 +1,128 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: dummy_locale
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Derek Prior
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2023-02-10 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.10'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '1.10'
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.5'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '3.5'
55
+ - !ruby/object:Gem::Dependency
56
+ name: i18n
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: activesupport
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ description:
84
+ email:
85
+ - derekprior@gmail.com
86
+ executables: []
87
+ extensions: []
88
+ extra_rdoc_files: []
89
+ files:
90
+ - ".gitignore"
91
+ - ".rspec"
92
+ - ".rubocop.yml"
93
+ - ".ruby-version"
94
+ - CONTRIBUTING.md
95
+ - Gemfile
96
+ - LICENSE.txt
97
+ - README.md
98
+ - Rakefile
99
+ - bin/console
100
+ - bin/setup
101
+ - dummy_locale.gemspec
102
+ - lib/dummy_locale.rb
103
+ - lib/dummy_locale/locale.rb
104
+ - lib/dummy_locale/version.rb
105
+ homepage: https://github.com/thoughtbot/dummy_locale
106
+ licenses:
107
+ - MIT
108
+ metadata: {}
109
+ post_install_message:
110
+ rdoc_options: []
111
+ require_paths:
112
+ - lib
113
+ required_ruby_version: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ required_rubygems_version: !ruby/object:Gem::Requirement
119
+ requirements:
120
+ - - ">="
121
+ - !ruby/object:Gem::Version
122
+ version: '0'
123
+ requirements: []
124
+ rubygems_version: 3.2.32
125
+ signing_key:
126
+ specification_version: 4
127
+ summary: Generates a dummy locale for visually confirming translations
128
+ test_files: []