otto 1.2.0 → 1.3.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c17a841334ba79be6d1c4625eb8e8e39eda301be3a77813c8ea6386bb3d0d6b5
4
- data.tar.gz: 2639d6f7ef18aa85bf75646d5c9d97814d1bf3a585e53003de7ccb4e8ce1eccf
3
+ metadata.gz: 7974135aa7b516b1d0424fd1fb7f686524f0d091168a19df5527ec1e69d7314f
4
+ data.tar.gz: a20a52ce1479f00f880afa3ad43ed43bb85f34e519c9e024cd717a7d873dad5c
5
5
  SHA512:
6
- metadata.gz: 40e9f5ed072e4d86dd27c49d397fa3ece8904420a3264166ad187aeea9c26c3818c32c45986903914df664cbb7671c8edabad18601f60013c8f05d2ce742d65f
7
- data.tar.gz: 95d85cabd00d26658ce816021289ca7a21600dee34ac051ccfa6cf79b8713742d5389e67042d49991a1a63794fe30e3cd76d11bfb7d3ee52a8281e42e184174b
6
+ metadata.gz: 6a69222b7e5234e487d0098a25bbd36b2e9fc7637f563cf9f6b8562e5b03a314f06b97de755a1ec061310222c8c8ac35f215a8f6ad2b0d3e541ba1eec658f73d
7
+ data.tar.gz: 503f510059cc42f553981cd5ec27a19c5655d2047e11263eb81c63d7b2a49a09ebcd7f5df83da6f68e295b9927f8859812a2240ad4b1e05e8365702cfb89f91b
data/.gitignore CHANGED
@@ -9,6 +9,7 @@
9
9
  *.md
10
10
  *.txt
11
11
  !LICENSE.txt
12
+ !spec/fixtures/*.txt
12
13
  .ruby-version
13
14
  appendonlydir
14
15
  etc/config
data/.rubocop.yml CHANGED
@@ -8,66 +8,410 @@
8
8
  # refer to the RuboCop documentation:
9
9
  # https://docs.rubocop.org/rubocop/cops.html
10
10
  #
11
- # Running `rubocop --regenerate-todo` will update the todo file
12
- # with the latest state of the onion (using the same options
13
- # as those documented at the top of the todo file). This is
14
- # useful for a gradual migration of the codebase.
15
- #
16
- inherit_from: .rubocop_todo.yml
17
11
 
18
12
  plugins:
19
13
  - rubocop-performance
20
14
  - rubocop-thread_safety
15
+ - rubocop-rspec
21
16
 
22
17
  AllCops:
23
18
  NewCops: enable
19
+ DisabledByDefault: false # flip to true for a good autocorrect time
24
20
  UseCache: true
25
21
  MaxFilesInCache: 100
26
22
  TargetRubyVersion: 3.4
27
23
  Exclude:
28
- - "migrate/**/*.rb"
29
- - "migrate/*.rb"
30
- - "try/**/*"
31
- - "try/*.rb"
24
+ - "spec/**/*.rb"
32
25
  - "vendor/**/*"
33
26
 
27
+ Layout/CaseIndentation:
28
+ Enabled: true
29
+ EnforcedStyle: end # case, end
30
+ IndentOneStep: false
31
+ IndentationWidth: 2
32
+
33
+ Layout/CommentIndentation:
34
+ Enabled: true
35
+
36
+ Layout/MultilineMethodCallBraceLayout:
37
+ Enabled: true
38
+ EnforcedStyle: new_line # symmetrical, new_line, same_line
39
+
40
+ Layout/TrailingWhitespace:
41
+ Enabled: true
42
+
43
+ Layout/SpaceAroundEqualsInParameterDefault:
44
+ Enabled: true
45
+
46
+ Layout/SpaceAroundOperators:
47
+ Enabled: false
48
+
49
+ # Use parentheses around a logical expression if it makes easier to read.
50
+ Style/RedundantParentheses:
51
+ Enabled: false
52
+
53
+ Lint/UnusedMethodArgument:
54
+ Enabled: true
55
+
56
+ Lint/UselessAssignment:
57
+ Enabled: true
58
+
59
+ Lint/DuplicateBranch:
60
+ Enabled: true
61
+ IgnoreLiteralBranches: false
62
+ IgnoreConstantBranches: false
63
+ IgnoreDuplicateElseBranch: false
64
+
65
+ # Offense count: 3
66
+ # Configuration parameters: AllowedMethods, AllowedPatterns.
67
+ Metrics/PerceivedComplexity:
68
+ Max: 20
69
+
70
+ # Offense count: 186
71
+ # Configuration parameters: AllowedConstants.
72
+ Style/Documentation:
73
+ Enabled: false
74
+
75
+ Style/RescueStandardError:
76
+ Enabled: true
77
+ EnforcedStyle: explicit
78
+
79
+ # When true: Use match? instead of =~ when MatchData is not used. True is preferred but not for autocorrection. Regexs are too picky. Need to manually check every time.
80
+ Performance/RegexpMatch:
81
+ Enabled: false
82
+
83
+ Style/TrailingCommaInHashLiteral:
84
+ Enabled: true
85
+ EnforcedStyleForMultiline: comma
86
+
87
+ Style/StringLiterals:
88
+ Enabled: true
89
+ EnforcedStyle: single_quotes
90
+
91
+ # The Style/DoubleNegation cop is disabled because double negation provides
92
+ # a concise, idiomatic way to convert values to boolean in Ruby. Alternative
93
+ # approaches like ternary expressions or comparison with nil create unnecessary
94
+ # verbosity without adding clarity. In cases where boolean coercion is the
95
+ # explicit intent, !! clearly communicates this purpose to other Ruby developers.
96
+ Style/DoubleNegation:
97
+ Enabled: false
98
+
99
+ # Offense count: non-0
100
+ Style/FormatString:
101
+ EnforcedStyle: format
102
+ Enabled: true
103
+
104
+ Style/FormatStringToken:
105
+ EnforcedStyle: unannotated
106
+ Enabled: true
107
+
108
+ Style/RedundantReturn:
109
+ Enabled: true
110
+ AllowMultipleReturnValues: false
111
+
112
+ Style/IfUnlessModifier:
113
+ Enabled: false
114
+
115
+ # We prefer `extend self` and `class << self`.
116
+ Style/ModuleFunction:
117
+ Enabled: true
118
+ AutoCorrect: false
119
+ EnforcedStyle: extend_self
120
+
121
+ # Prefer 3 line if/else over one-liner
122
+ Style/GuardClause:
123
+ Enabled: true
124
+ MinBodyLength: 3
125
+ AllowConsecutiveConditionals: false
126
+
127
+ Style/SymbolArray:
128
+ EnforcedStyle: brackets
129
+ Enabled: true
130
+
131
+ Style/StringLiteralsInInterpolation:
132
+ Enabled: true
133
+
134
+ Style/BlockDelimiters:
135
+ Enabled: true
136
+
137
+ Naming/PredicateMethod:
138
+ Enabled: true
139
+ Mode: "conservative"
140
+ AllowedMethods:
141
+ - validate!
142
+ - migrate
143
+
144
+ # We use class instance variables quite a bit, mostly for readonly values set
145
+ # at boot time. Except for our models with have redis-rb Redis instances
146
+ # connected on their associated db via ModelClass.dbclient. We're well aware
147
+ # so keeping this disabled reduces warning noise.
148
+ ThreadSafety/ClassInstanceVariable:
149
+ Enabled: false
150
+
151
+ Naming/RescuedExceptionsVariableName:
152
+ Enabled: true
153
+ PreferredName: ex # Default is 'e'
154
+
155
+ Naming/PredicatePrefix:
156
+ Enabled: true
157
+ ForbiddenPrefixes: [is_, has_, have_]
158
+ AllowedMethods: [
159
+ has_passphrase?, # correlates with the REST API field `has_passphrase`
160
+ ]
161
+
162
+ Layout/MultilineMethodCallIndentation:
163
+ EnforcedStyle: indented
164
+ IndentationWidth: 2
165
+
34
166
  Gemspec/DeprecatedAttributeAssignment:
35
167
  Enabled: true
36
168
 
37
169
  Gemspec/DevelopmentDependencies:
38
170
  Enabled: true
39
171
 
40
- Layout/HashAlignment:
172
+ Layout/ElseAlignment:
41
173
  Enabled: false
42
174
 
43
- Lint/Void:
175
+ Layout/EndAlignment:
44
176
  Enabled: false
177
+ # Severity: low
178
+ # SupportedStylesAlignWith: 2
179
+ # Leave commented out. When we set align with, endless "error occurred"
180
+ # EnforcedStyle: keyword # keyword, variable, start_of_line
45
181
 
182
+ Layout/ExtraSpacing:
183
+ Enabled: true
184
+ AllowForAlignment: true
185
+ AllowBeforeTrailingComments: true
186
+ ForceEqualSignAlignment: true
187
+
188
+ Layout/IndentationConsistency:
189
+ EnforcedStyle: indented_internal_methods
190
+ Enabled: true
191
+
192
+ Layout/IndentationWidth:
193
+ # We don't want to enforce indentation width because it's doing weird things
194
+ # with if/else statements that capture values. The `if` expression is aligned
195
+ # with the right side of the `test` but the `else` expression is aligned with
196
+ # the start of the line.
197
+ Width: 2
198
+ Enabled: false
199
+
200
+ Layout/HashAlignment:
201
+ Enabled: true
202
+
203
+ Layout/FirstHashElementIndentation:
204
+ Enabled: true
205
+
206
+ Lint/Void:
207
+ Enabled: true
208
+
209
+ Lint/CopDirectiveSyntax:
210
+ Enabled: true
211
+
212
+ # Offense count: 122
213
+ # Assignment Branch Condition size
46
214
  Metrics/AbcSize:
47
215
  Enabled: false
48
216
  Max: 20
49
217
 
50
- Metrics/ClassLength:
218
+ # Offense count: 217
219
+ Layout/LineLength:
220
+ Enabled: false
221
+ AllowHeredoc: true
222
+ AllowURI: true
223
+ URISchemes:
224
+ - https
225
+ IgnoreCopDirectives: true
226
+ AllowedPatterns: []
227
+ SplitStrings: false
228
+ Max: 100
229
+
230
+ # Align the arguments of a method call if they span more than one line.
231
+ Layout/ArgumentAlignment:
51
232
  Enabled: true
52
- Max: 200
233
+ EnforcedStyle: with_fixed_indentation # with_first_argument, with_fixed_indentation
234
+ IndentationWidth: 2
53
235
 
54
- Metrics/CyclomaticComplexity:
55
- Enabled: false
236
+ Layout/EmptyLineAfterGuardClause:
237
+ Enabled: true
56
238
 
239
+ Layout/EmptyLineBetweenDefs:
240
+ Enabled: true
241
+
242
+ Layout/EmptyLines:
243
+ Enabled: true
244
+
245
+ Layout/EmptyLinesAroundAccessModifier:
246
+ Enabled: true
247
+
248
+ Layout/EmptyLinesAroundAttributeAccessor:
249
+ Enabled: true
250
+
251
+ Layout/EmptyLinesAroundBlockBody:
252
+ Enabled: true
253
+
254
+ Layout/EmptyLinesAroundClassBody:
255
+ Enabled: true
256
+
257
+ Layout/EmptyLinesAroundExceptionHandlingKeywords:
258
+ Enabled: true
259
+
260
+ Layout/EmptyLinesAroundMethodBody:
261
+ Enabled: true
262
+
263
+ Layout/EmptyLinesAroundModuleBody:
264
+ Enabled: true
265
+
266
+ Metrics/ClassLength:
267
+ Enabled: true
268
+ Max: 350
269
+
270
+ # Offense count: non-0
57
271
  Metrics/MethodLength:
58
272
  Enabled: true
59
- Max: 40
273
+ Max: 50
60
274
  CountAsOne: ["method_call"]
61
275
 
62
276
  Metrics/ModuleLength:
63
277
  Enabled: true
64
- Max: 250
278
+ Max: 350
65
279
  CountAsOne: ["method_call"]
66
280
 
67
281
  Performance/Size:
68
282
  Enabled: true
69
- Exclude:
70
- # - lib/example.rb
283
+ Exclude: []
284
+
285
+ Naming/AsciiIdentifiers:
286
+ Enabled: true
287
+
288
+ Metrics/CyclomaticComplexity:
289
+ Enabled: false
71
290
 
72
291
  Style/NegatedIfElseCondition:
73
292
  Enabled: true
293
+
294
+ Style/TrailingCommaInArguments:
295
+ Enabled: true
296
+ EnforcedStyleForMultiline: comma
297
+
298
+ Style/TrailingCommaInArrayLiteral:
299
+ Enabled: true
300
+ EnforcedStyleForMultiline: comma
301
+
302
+ # Use #empty? when testing for objects of length 0.
303
+ Style/ZeroLengthPredicate:
304
+ Enabled: true
305
+ Safe: true
306
+
307
+ Style/MethodDefParentheses:
308
+ Enabled: true
309
+
310
+ Style/FrozenStringLiteralComment:
311
+ Enabled: true
312
+ EnforcedStyle: never
313
+
314
+ Style/SuperArguments:
315
+ Enabled: true
316
+
317
+ # Offense count: non-0
318
+ ThreadSafety/ClassAndModuleAttributes:
319
+ Description: Avoid mutating class and module attributes.
320
+ Enabled: true
321
+ ActiveSupportClassAttributeAllowed: false
322
+
323
+ ThreadSafety/DirChdir:
324
+ Description: Avoid using `Dir.chdir` due to its process-wide effect.
325
+ Enabled: true
326
+ AllowCallWithBlock: false
327
+
328
+ # Do not assign mutable objects to class instance variables.
329
+ ThreadSafety/MutableClassInstanceVariable:
330
+ Description:
331
+ Enabled: true
332
+ EnforcedStyle: literals # one of literals, strict
333
+ SafeAutoCorrect: false
334
+
335
+ # Avoid starting new threads. Let a framework like Sidekiq handle the threads.
336
+ ThreadSafety/NewThread:
337
+ Enabled: true
338
+
339
+ # Avoid instance variables in Rack middleware.
340
+ ThreadSafety/RackMiddlewareInstanceVariable:
341
+ Description:
342
+ Enabled: true
343
+ Include:
344
+ - lib/middleware/*.rb
345
+ - lib/middleware/onetime/*.rb
346
+
347
+ # Unsafe autocorrect:
348
+ Performance/MapCompact:
349
+ Enabled: false
350
+ Performance/StringInclude:
351
+ Enabled: false
352
+ Style/ClassAndModuleChildren:
353
+ Enabled: false
354
+ Style/GlobalStdStream:
355
+ Enabled: false
356
+ Style/HashConversion:
357
+ Enabled: false
358
+ Style/HashEachMethods:
359
+ Enabled: false
360
+ Style/IdenticalConditionalBranches:
361
+ Enabled: false
362
+ Style/MinMaxComparison:
363
+ Enabled: false
364
+ Style/MutableConstant:
365
+ Enabled: false
366
+ Style/NumericPredicate:
367
+ Enabled: false
368
+ Style/RaiseArgs:
369
+ Enabled: false
370
+ Style/RedundantInterpolation:
371
+ Enabled: false
372
+ Style/SafeNavigation:
373
+ Enabled: false
374
+ Style/SpecialGlobalVars:
375
+ Enabled: false
376
+ Style/StringConcatenation:
377
+ Enabled: false
378
+ Style/SymbolProc:
379
+ Enabled: false
380
+
381
+ # warnings
382
+ Lint/RedundantCopDisableDirective:
383
+ Enabled: false
384
+ Lint/AssignmentInCondition:
385
+ Enabled: false
386
+
387
+ # Manual corrections
388
+ Metrics/BlockLength:
389
+ Enabled: false
390
+ Metrics/BlockNesting:
391
+ Enabled: false
392
+ Metrics/ParameterLists:
393
+ Enabled: false
394
+ Naming/AccessorMethodName:
395
+ Enabled: false
396
+ Naming/MethodParameterName:
397
+ Enabled: false
398
+ Performance/CollectionLiteralInLoop:
399
+ Enabled: false
400
+ Style/OptionalBooleanParameter:
401
+ Enabled: false
402
+
403
+ # warnings
404
+ Lint/DuplicateMethods:
405
+ Enabled: false
406
+ Lint/UselessOr:
407
+ Enabled: false
408
+ Lint/UnreachableLoop:
409
+ Enabled: false
410
+ Lint/MissingCopEnableDirective:
411
+ Enabled: false
412
+ Lint/MissingSuper:
413
+ Enabled: false
414
+ Lint/EmptyFile:
415
+ Enabled: false
416
+ Lint/RescueException:
417
+ Enabled: false
data/Gemfile CHANGED
@@ -5,8 +5,8 @@ source 'https://rubygems.org'
5
5
  gemspec
6
6
 
7
7
  group :development, :test do
8
- gem 'rspec', '~> 3.12'
9
8
  gem 'rack-test'
9
+ gem 'rspec', '~> 3.12'
10
10
  end
11
11
 
12
12
  group 'development' do
data/Gemfile.lock CHANGED
@@ -1,8 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- otto (1.2.0)
5
- addressable (~> 2.2, < 3)
4
+ otto (1.3.0)
6
5
  rack (~> 3.1, < 4.0)
7
6
  rack-parser (~> 0.7)
8
7
  rexml (>= 3.3.6)
@@ -10,32 +9,45 @@ PATH
10
9
  GEM
11
10
  remote: https://rubygems.org/
12
11
  specs:
13
- addressable (2.8.7)
14
- public_suffix (>= 2.0.2, < 7.0)
15
- ast (2.4.2)
16
- byebug (11.1.3)
12
+ ast (2.4.3)
13
+ byebug (12.0.0)
17
14
  coderay (1.1.3)
15
+ date (3.4.1)
18
16
  diff-lcs (1.6.2)
19
- drydock (0.6.9)
20
- json (2.7.2)
21
- language_server-protocol (3.17.0.3)
17
+ erb (5.0.2)
18
+ io-console (0.8.1)
19
+ irb (1.15.2)
20
+ pp (>= 0.6.0)
21
+ rdoc (>= 4.0.0)
22
+ reline (>= 0.4.2)
23
+ json (2.13.2)
24
+ language_server-protocol (3.17.0.5)
25
+ lint_roller (1.1.0)
22
26
  logger (1.7.0)
23
- method_source (1.0.0)
24
- parallel (1.24.0)
25
- parser (3.3.0.5)
27
+ method_source (1.1.0)
28
+ minitest (5.25.5)
29
+ parallel (1.27.0)
30
+ parser (3.3.9.0)
26
31
  ast (~> 2.4.1)
27
32
  racc
33
+ pastel (0.8.0)
34
+ tty-color (~> 0.5)
35
+ pp (0.6.2)
36
+ prettyprint
28
37
  prettier_print (1.2.1)
38
+ prettyprint (0.2.0)
29
39
  prism (1.4.0)
30
- pry (0.14.2)
40
+ pry (0.15.2)
31
41
  coderay (~> 1.1)
32
42
  method_source (~> 1.0)
33
- pry-byebug (3.10.1)
34
- byebug (~> 11.0)
35
- pry (>= 0.13, < 0.15)
36
- public_suffix (6.0.1)
37
- racc (1.7.3)
38
- rack (3.1.16)
43
+ pry-byebug (3.11.0)
44
+ byebug (~> 12.0)
45
+ pry (>= 0.13, < 0.16)
46
+ psych (5.2.6)
47
+ date
48
+ stringio
49
+ racc (1.8.1)
50
+ rack (3.2.0)
39
51
  rack-parser (0.7.0)
40
52
  rack
41
53
  rack-test (2.2.0)
@@ -43,8 +55,13 @@ GEM
43
55
  rainbow (3.1.1)
44
56
  rbs (3.9.4)
45
57
  logger
46
- regexp_parser (2.9.0)
47
- rexml (3.3.7)
58
+ rdoc (6.14.2)
59
+ erb
60
+ psych (>= 4.0.0)
61
+ regexp_parser (2.11.0)
62
+ reline (0.6.2)
63
+ io-console (~> 0.5)
64
+ rexml (3.4.1)
48
65
  rspec (3.13.1)
49
66
  rspec-core (~> 3.13.0)
50
67
  rspec-expectations (~> 3.13.0)
@@ -58,44 +75,57 @@ GEM
58
75
  diff-lcs (>= 1.2.0, < 2.0)
59
76
  rspec-support (~> 3.13.0)
60
77
  rspec-support (3.13.4)
61
- rubocop (1.62.1)
78
+ rubocop (1.79.1)
62
79
  json (~> 2.3)
63
- language_server-protocol (>= 3.17.0)
80
+ language_server-protocol (~> 3.17.0.2)
81
+ lint_roller (~> 1.1.0)
64
82
  parallel (~> 1.10)
65
83
  parser (>= 3.3.0.2)
66
84
  rainbow (>= 2.2.2, < 4.0)
67
- regexp_parser (>= 1.8, < 3.0)
68
- rexml (>= 3.2.5, < 4.0)
69
- rubocop-ast (>= 1.31.1, < 2.0)
85
+ regexp_parser (>= 2.9.3, < 3.0)
86
+ rubocop-ast (>= 1.46.0, < 2.0)
70
87
  ruby-progressbar (~> 1.7)
71
- unicode-display_width (>= 2.4.0, < 3.0)
72
- rubocop-ast (1.31.2)
73
- parser (>= 3.3.0.4)
74
- rubocop-performance (1.23.1)
75
- rubocop (>= 1.48.1, < 2.0)
76
- rubocop-ast (>= 1.31.1, < 2.0)
77
- rubocop-rspec (3.4.0)
78
- rubocop (~> 1.61)
79
- rubocop-thread_safety (0.6.0)
80
- rubocop (>= 1.48.1)
81
- ruby-lsp (0.26.0)
88
+ unicode-display_width (>= 2.4.0, < 4.0)
89
+ rubocop-ast (1.46.0)
90
+ parser (>= 3.3.7.2)
91
+ prism (~> 1.4)
92
+ rubocop-performance (1.25.0)
93
+ lint_roller (~> 1.1)
94
+ rubocop (>= 1.75.0, < 2.0)
95
+ rubocop-ast (>= 1.38.0, < 2.0)
96
+ rubocop-rspec (3.6.0)
97
+ lint_roller (~> 1.1)
98
+ rubocop (~> 1.72, >= 1.72.1)
99
+ rubocop-thread_safety (0.7.3)
100
+ lint_roller (~> 1.1)
101
+ rubocop (~> 1.72, >= 1.72.1)
102
+ rubocop-ast (>= 1.44.0, < 2.0)
103
+ ruby-lsp (0.26.1)
82
104
  language_server-protocol (~> 3.17.0)
83
105
  prism (>= 1.2, < 2.0)
84
106
  rbs (>= 3, < 5)
85
107
  ruby-progressbar (1.13.0)
86
108
  stackprof (0.2.27)
87
- storable (0.10.0)
109
+ stringio (3.1.7)
88
110
  syntax_tree (6.3.0)
89
111
  prettier_print (>= 1.2.0)
90
- sysinfo (0.10.0)
91
- drydock (< 1.0)
92
- storable (~> 0.10)
93
- tryouts (2.2.0)
94
- sysinfo (~> 0.10)
95
- unicode-display_width (2.5.0)
112
+ tryouts (3.2.1)
113
+ irb
114
+ minitest (~> 5.0)
115
+ pastel (~> 0.8)
116
+ prism (~> 1.0)
117
+ rspec (~> 3.0)
118
+ tty-cursor (~> 0.7)
119
+ tty-screen (~> 0.8)
120
+ tty-color (0.6.0)
121
+ tty-cursor (0.7.1)
122
+ tty-screen (0.8.2)
123
+ unicode-display_width (3.1.4)
124
+ unicode-emoji (~> 4.0, >= 4.0.4)
125
+ unicode-emoji (4.0.4)
96
126
 
97
127
  PLATFORMS
98
- arm64-darwin-22
128
+ arm64-darwin-24
99
129
  ruby
100
130
 
101
131
  DEPENDENCIES
@@ -113,4 +143,4 @@ DEPENDENCIES
113
143
  tryouts
114
144
 
115
145
  BUNDLED WITH
116
- 2.5.7
146
+ 2.6.9