sorbet-result 1.0.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. checksums.yaml +4 -4
  2. data/.ruby-version +1 -1
  3. data/.standard.yml +6 -0
  4. data/.tool-versions +1 -1
  5. data/CHANGELOG.md +21 -0
  6. data/Gemfile +3 -5
  7. data/Gemfile.lock +79 -64
  8. data/README.md +25 -2
  9. data/Rakefile +3 -5
  10. data/lib/minitest/result_assertions.rb +48 -0
  11. data/lib/sorbet-result.rb +1 -5
  12. data/lib/typed/result.rb +199 -7
  13. data/sorbet/rbi/gems/.gitattributes +1 -0
  14. data/sorbet/rbi/gems/ast@2.4.2.rbi +1 -0
  15. data/sorbet/rbi/gems/erubi@1.13.0.rbi +150 -0
  16. data/sorbet/rbi/gems/{io-console@0.6.0.rbi → io-console@0.7.2.rbi} +1 -0
  17. data/sorbet/rbi/gems/{json@2.6.3.rbi → json@2.7.5.rbi} +168 -72
  18. data/sorbet/rbi/gems/language_server-protocol@3.17.0.3.rbi +14238 -0
  19. data/sorbet/rbi/gems/lint_roller@1.1.0.rbi +240 -0
  20. data/sorbet/rbi/gems/{minitest@5.18.1.rbi → minitest@5.25.1.rbi} +337 -282
  21. data/sorbet/rbi/gems/netrc@0.11.0.rbi +1 -0
  22. data/sorbet/rbi/gems/{parallel@1.23.0.rbi → parallel@1.26.3.rbi} +38 -20
  23. data/sorbet/rbi/gems/{parser@3.2.2.3.rbi → parser@3.3.5.1.rbi} +663 -2397
  24. data/sorbet/rbi/gems/prism@1.2.0.rbi +39085 -0
  25. data/sorbet/rbi/gems/psych@5.1.2.rbi +1732 -0
  26. data/sorbet/rbi/gems/{racc@1.7.1.rbi → racc@1.8.1.rbi} +37 -36
  27. data/sorbet/rbi/gems/rainbow@3.1.1.rbi +1 -0
  28. data/sorbet/rbi/gems/{rake@13.0.6.rbi → rake@13.2.1.rbi} +79 -75
  29. data/sorbet/rbi/gems/rbi@0.2.1.rbi +4535 -0
  30. data/sorbet/rbi/gems/{regexp_parser@2.8.1.rbi → regexp_parser@2.9.2.rbi} +190 -167
  31. data/sorbet/rbi/gems/{reline@0.3.5.rbi → reline@0.5.10.rbi} +1 -0
  32. data/sorbet/rbi/gems/{rubocop-ast@1.29.0.rbi → rubocop-ast@1.33.1.rbi} +1220 -748
  33. data/sorbet/rbi/gems/rubocop-performance@1.22.1.rbi +9 -0
  34. data/sorbet/rbi/gems/rubocop-sorbet@0.7.8.rbi +9 -0
  35. data/sorbet/rbi/gems/{rubocop@1.52.1.rbi → rubocop@1.66.1.rbi} +6236 -3446
  36. data/sorbet/rbi/gems/ruby-progressbar@1.13.0.rbi +1 -0
  37. data/sorbet/rbi/gems/spoom@1.5.0.rbi +4932 -0
  38. data/sorbet/rbi/gems/standard-custom@1.0.2.rbi +9 -0
  39. data/sorbet/rbi/gems/standard-performance@1.5.0.rbi +9 -0
  40. data/sorbet/rbi/gems/standard-sorbet@0.0.2.rbi +53 -0
  41. data/sorbet/rbi/gems/standard@1.41.1.rbi +926 -0
  42. data/sorbet/rbi/gems/stringio@3.1.1.rbi +9 -0
  43. data/sorbet/rbi/gems/{tapioca@0.11.6.rbi → tapioca@0.16.3.rbi} +937 -635
  44. data/sorbet/rbi/gems/{thor@1.2.2.rbi → thor@1.3.2.rbi} +832 -419
  45. data/sorbet/rbi/gems/{unicode-display_width@2.4.2.rbi → unicode-display_width@2.6.0.rbi} +1 -0
  46. data/sorbet/rbi/gems/{yard-sorbet@0.8.1.rbi → yard-sorbet@0.9.0.rbi} +36 -29
  47. data/sorbet/rbi/gems/{yard@0.9.34.rbi → yard@0.9.37.rbi} +431 -271
  48. data/sorbet/tapioca/config.yml +3 -12
  49. data/sorbet/tapioca/require.rb +0 -1
  50. metadata +37 -47
  51. data/.rubocop.yml +0 -33
  52. data/lib/typed/failure.rb +0 -81
  53. data/lib/typed/success.rb +0 -80
  54. data/sorbet/rbi/gems/diff-lcs@1.5.0.rbi +0 -1083
  55. data/sorbet/rbi/gems/irb@1.7.0.rbi +0 -342
  56. data/sorbet/rbi/gems/rbi@0.0.16.rbi +0 -3008
  57. data/sorbet/rbi/gems/rexml@3.2.5.rbi +0 -4717
  58. data/sorbet/rbi/gems/rubocop-minitest@0.31.0.rbi +0 -2528
  59. data/sorbet/rbi/gems/rubocop-rake@0.6.0.rbi +0 -328
  60. data/sorbet/rbi/gems/rubocop-sorbet@0.7.0.rbi +0 -1043
  61. data/sorbet/rbi/gems/spoom@1.2.1.rbi +0 -2503
  62. data/sorbet/rbi/gems/unparser@0.6.8.rbi +0 -4525
  63. data/sorbet/rbi/gems/zeitwerk@2.6.8.rbi +0 -986
@@ -1,986 +0,0 @@
1
- # typed: true
2
-
3
- # DO NOT EDIT MANUALLY
4
- # This is an autogenerated file for types exported from the `zeitwerk` gem.
5
- # Please instead update this file by running `bin/tapioca gem zeitwerk`.
6
-
7
- # source://zeitwerk//lib/zeitwerk/kernel.rb#3
8
- module Kernel
9
- private
10
-
11
- # source://zeitwerk//lib/zeitwerk/kernel.rb#27
12
- def require(path); end
13
-
14
- class << self
15
- # source://zeitwerk//lib/zeitwerk/kernel.rb#27
16
- def require(path); end
17
- end
18
- end
19
-
20
- # source://zeitwerk//lib/zeitwerk.rb#3
21
- module Zeitwerk
22
- class << self
23
- # This is a dangerous method.
24
- #
25
- # source://zeitwerk//lib/zeitwerk.rb#20
26
- def with_loader; end
27
- end
28
- end
29
-
30
- # source://zeitwerk//lib/zeitwerk/error.rb#4
31
- class Zeitwerk::Error < ::StandardError; end
32
-
33
- # Centralizes the logic for the trace point used to detect the creation of
34
- # explicit namespaces, needed to descend into matching subdirectories right
35
- # after the constant has been defined.
36
- #
37
- # The implementation assumes an explicit namespace is managed by one loader.
38
- # Loaders that reopen namespaces owned by other projects are responsible for
39
- # loading their constant before setup. This is documented.
40
- #
41
- # source://zeitwerk//lib/zeitwerk/explicit_namespace.rb#11
42
- module Zeitwerk::ExplicitNamespace
43
- extend ::Zeitwerk::RealModName
44
-
45
- class << self
46
- # source://zeitwerk//lib/zeitwerk/explicit_namespace.rb#35
47
- def __register(cpath, loader); end
48
-
49
- # source://zeitwerk//lib/zeitwerk/explicit_namespace.rb#53
50
- def __registered?(cpath); end
51
-
52
- # source://zeitwerk//lib/zeitwerk/explicit_namespace.rb#45
53
- def __unregister_loader(loader); end
54
-
55
- private
56
-
57
- # Maps constant paths that correspond to explicit namespaces according to
58
- # the file system, to the loader responsible for them.
59
- #
60
- # source://zeitwerk//lib/zeitwerk/explicit_namespace.rb#20
61
- def cpaths; end
62
-
63
- # source://zeitwerk//lib/zeitwerk/explicit_namespace.rb#58
64
- def disable_tracer_if_unneeded; end
65
-
66
- # Returns the value of attribute mutex.
67
- #
68
- # source://zeitwerk//lib/zeitwerk/explicit_namespace.rb#24
69
- def mutex; end
70
-
71
- # source://zeitwerk//lib/zeitwerk/explicit_namespace.rb#35
72
- def register(cpath, loader); end
73
-
74
- # source://zeitwerk//lib/zeitwerk/explicit_namespace.rb#53
75
- def registered?(cpath); end
76
-
77
- # source://zeitwerk//lib/zeitwerk/explicit_namespace.rb#65
78
- def tracepoint_class_callback(event); end
79
-
80
- # Returns the value of attribute tracer.
81
- #
82
- # source://zeitwerk//lib/zeitwerk/explicit_namespace.rb#28
83
- def tracer; end
84
-
85
- # source://zeitwerk//lib/zeitwerk/explicit_namespace.rb#45
86
- def unregister_loader(loader); end
87
- end
88
- end
89
-
90
- # source://zeitwerk//lib/zeitwerk/gem_inflector.rb#4
91
- class Zeitwerk::GemInflector < ::Zeitwerk::Inflector
92
- # @return [GemInflector] a new instance of GemInflector
93
- #
94
- # source://zeitwerk//lib/zeitwerk/gem_inflector.rb#6
95
- def initialize(root_file); end
96
-
97
- # source://zeitwerk//lib/zeitwerk/gem_inflector.rb#13
98
- def camelize(basename, abspath); end
99
- end
100
-
101
- # @private
102
- #
103
- # source://zeitwerk//lib/zeitwerk/gem_loader.rb#5
104
- class Zeitwerk::GemLoader < ::Zeitwerk::Loader
105
- # @return [GemLoader] a new instance of GemLoader
106
- #
107
- # source://zeitwerk//lib/zeitwerk/gem_loader.rb#19
108
- def initialize(root_file, namespace:, warn_on_extra_files:); end
109
-
110
- # source://zeitwerk//lib/zeitwerk/gem_loader.rb#34
111
- def setup; end
112
-
113
- private
114
-
115
- # source://zeitwerk//lib/zeitwerk/gem_loader.rb#42
116
- def warn_on_extra_files; end
117
-
118
- class << self
119
- # @private
120
- #
121
- # source://zeitwerk//lib/zeitwerk/gem_loader.rb#14
122
- def __new(root_file, namespace:, warn_on_extra_files:); end
123
-
124
- private
125
-
126
- def new(*_arg0); end
127
- end
128
- end
129
-
130
- # source://zeitwerk//lib/zeitwerk/inflector.rb#4
131
- class Zeitwerk::Inflector
132
- # Very basic snake case -> camel case conversion.
133
- #
134
- # inflector = Zeitwerk::Inflector.new
135
- # inflector.camelize("post", ...) # => "Post"
136
- # inflector.camelize("users_controller", ...) # => "UsersController"
137
- # inflector.camelize("api", ...) # => "Api"
138
- #
139
- # Takes into account hard-coded mappings configured with `inflect`.
140
- #
141
- # source://zeitwerk//lib/zeitwerk/inflector.rb#15
142
- def camelize(basename, _abspath); end
143
-
144
- # Configures hard-coded inflections:
145
- #
146
- # inflector = Zeitwerk::Inflector.new
147
- # inflector.inflect(
148
- # "html_parser" => "HTMLParser",
149
- # "mysql_adapter" => "MySQLAdapter"
150
- # )
151
- #
152
- # inflector.camelize("html_parser", abspath) # => "HTMLParser"
153
- # inflector.camelize("mysql_adapter", abspath) # => "MySQLAdapter"
154
- # inflector.camelize("users_controller", abspath) # => "UsersController"
155
- #
156
- # source://zeitwerk//lib/zeitwerk/inflector.rb#32
157
- def inflect(inflections); end
158
-
159
- private
160
-
161
- # Hard-coded basename to constant name user maps that override the default
162
- # inflection logic.
163
- #
164
- # source://zeitwerk//lib/zeitwerk/inflector.rb#42
165
- def overrides; end
166
- end
167
-
168
- # This is a private module.
169
- #
170
- # source://zeitwerk//lib/zeitwerk/internal.rb#4
171
- module Zeitwerk::Internal
172
- # source://zeitwerk//lib/zeitwerk/internal.rb#5
173
- def internal(method_name); end
174
- end
175
-
176
- # source://zeitwerk//lib/zeitwerk/loader.rb#6
177
- class Zeitwerk::Loader
178
- include ::Zeitwerk::RealModName
179
- include ::Zeitwerk::Loader::Callbacks
180
- include ::Zeitwerk::Loader::Helpers
181
- include ::Zeitwerk::Loader::Config
182
- include ::Zeitwerk::Loader::EagerLoad
183
- extend ::Zeitwerk::Internal
184
- extend ::Zeitwerk::RealModName
185
-
186
- # @return [Loader] a new instance of Loader
187
- #
188
- # source://zeitwerk//lib/zeitwerk/loader.rb#98
189
- def initialize; end
190
-
191
- # source://zeitwerk//lib/zeitwerk/loader.rb#42
192
- def __autoloaded_dirs; end
193
-
194
- # source://zeitwerk//lib/zeitwerk/loader.rb#32
195
- def __autoloads; end
196
-
197
- # source://zeitwerk//lib/zeitwerk/loader.rb#76
198
- def __namespace_dirs; end
199
-
200
- # source://zeitwerk//lib/zeitwerk/loader.rb#260
201
- def __shadowed_file?(file); end
202
-
203
- # source://zeitwerk//lib/zeitwerk/loader.rb#87
204
- def __shadowed_files; end
205
-
206
- # source://zeitwerk//lib/zeitwerk/loader.rb#58
207
- def __to_unload; end
208
-
209
- # Unloads all loaded code, and calls setup again so that the loader is able
210
- # to pick any changes in the file system.
211
- #
212
- # This method is not thread-safe, please see how this can be achieved by
213
- # client code in the README of the project.
214
- #
215
- # @raise [Zeitwerk::Error]
216
- #
217
- # source://zeitwerk//lib/zeitwerk/loader.rb#221
218
- def reload; end
219
-
220
- # Sets autoloads in the root namespaces.
221
- #
222
- # source://zeitwerk//lib/zeitwerk/loader.rb#117
223
- def setup; end
224
-
225
- # Removes loaded constants and configured autoloads.
226
- #
227
- # The objects the constants stored are no longer reachable through them. In
228
- # addition, since said objects are normally not referenced from anywhere
229
- # else, they are eligible for garbage collection, which would effectively
230
- # unload them.
231
- #
232
- # This method is public but undocumented. Main interface is `reload`, which
233
- # means `unload` + `setup`. This one is available to be used together with
234
- # `unregister`, which is undocumented too.
235
- #
236
- # source://zeitwerk//lib/zeitwerk/loader.rb#143
237
- def unload; end
238
-
239
- # Says if the given constant path would be unloaded on reload. This
240
- # predicate returns `false` if reloading is disabled.
241
- #
242
- # @return [Boolean]
243
- #
244
- # source://zeitwerk//lib/zeitwerk/loader.rb#235
245
- def unloadable_cpath?(cpath); end
246
-
247
- # Returns an array with the constant paths that would be unloaded on reload.
248
- # This predicate returns an empty array if reloading is disabled.
249
- #
250
- # source://zeitwerk//lib/zeitwerk/loader.rb#243
251
- def unloadable_cpaths; end
252
-
253
- # This is a dangerous method.
254
- #
255
- # source://zeitwerk//lib/zeitwerk/loader.rb#251
256
- def unregister; end
257
-
258
- private
259
-
260
- # source://zeitwerk//lib/zeitwerk/loader.rb#425
261
- def autoload_file(parent, cname, file); end
262
-
263
- # @return [Boolean]
264
- #
265
- # source://zeitwerk//lib/zeitwerk/loader.rb#483
266
- def autoload_path_set_by_me_for?(parent, cname); end
267
-
268
- # source://zeitwerk//lib/zeitwerk/loader.rb#395
269
- def autoload_subdir(parent, cname, subdir); end
270
-
271
- # We keep track of autoloaded directories to remove them from the registry
272
- # at the end of eager loading.
273
- #
274
- # Files are removed as they are autoloaded, but directories need to wait due
275
- # to concurrency (see why in Zeitwerk::Loader::Callbacks#on_dir_autoloaded).
276
- #
277
- # source://zeitwerk//lib/zeitwerk/loader.rb#42
278
- def autoloaded_dirs; end
279
-
280
- # Maps absolute paths for which an autoload has been set ---and not
281
- # executed--- to their corresponding parent class or module and constant
282
- # name.
283
- #
284
- # "/Users/fxn/blog/app/models/user.rb" => [Object, :User],
285
- # "/Users/fxn/blog/app/models/hotel/pricing.rb" => [Hotel, :Pricing]
286
- # ...
287
- #
288
- # source://zeitwerk//lib/zeitwerk/loader.rb#32
289
- def autoloads; end
290
-
291
- # Returns the value of attribute mutex.
292
- #
293
- # source://zeitwerk//lib/zeitwerk/loader.rb#91
294
- def mutex; end
295
-
296
- # Returns the value of attribute mutex2.
297
- #
298
- # source://zeitwerk//lib/zeitwerk/loader.rb#95
299
- def mutex2; end
300
-
301
- # Maps namespace constant paths to their respective directories.
302
- #
303
- # For example, given this mapping:
304
- #
305
- # "Admin" => [
306
- # "/Users/fxn/blog/app/controllers/admin",
307
- # "/Users/fxn/blog/app/models/admin",
308
- # ...
309
- # ]
310
- #
311
- # when `Admin` gets defined we know that it plays the role of a namespace
312
- # and that its children are spread over those directories. We'll visit them
313
- # to set up the corresponding autoloads.
314
- #
315
- # source://zeitwerk//lib/zeitwerk/loader.rb#76
316
- def namespace_dirs; end
317
-
318
- # `dir` is the directory that would have autovivified a namespace. `file` is
319
- # the file where we've found the namespace is explicitly defined.
320
- #
321
- # source://zeitwerk//lib/zeitwerk/loader.rb#451
322
- def promote_namespace_from_implicit_to_explicit(dir:, file:, parent:, cname:); end
323
-
324
- # source://zeitwerk//lib/zeitwerk/loader.rb#497
325
- def raise_if_conflicting_directory(dir); end
326
-
327
- # source://zeitwerk//lib/zeitwerk/loader.rb#492
328
- def register_explicit_namespace(cpath); end
329
-
330
- # source://zeitwerk//lib/zeitwerk/loader.rb#522
331
- def run_on_unload_callbacks(cpath, value, abspath); end
332
-
333
- # source://zeitwerk//lib/zeitwerk/loader.rb#462
334
- def set_autoload(parent, cname, abspath); end
335
-
336
- # source://zeitwerk//lib/zeitwerk/loader.rb#360
337
- def set_autoloads_in_dir(dir, parent); end
338
-
339
- # source://zeitwerk//lib/zeitwerk/loader.rb#260
340
- def shadowed_file?(file); end
341
-
342
- # A shadowed file is a file managed by this loader that is ignored when
343
- # setting autoloads because its matching constant is already taken.
344
- #
345
- # This private set is populated as we descend. For example, if the loader
346
- # has only scanned the top-level, `shadowed_files` does not have shadowed
347
- # files that may exist deep in the project tree yet.
348
- #
349
- # source://zeitwerk//lib/zeitwerk/loader.rb#87
350
- def shadowed_files; end
351
-
352
- # Stores metadata needed for unloading. Its entries look like this:
353
- #
354
- # "Admin::Role" => [".../admin/role.rb", [Admin, :Role]]
355
- #
356
- # The cpath as key helps implementing unloadable_cpath? The file name is
357
- # stored in order to be able to delete it from $LOADED_FEATURES, and the
358
- # pair [Module, Symbol] is used to remove_const the constant from the class
359
- # or module object.
360
- #
361
- # If reloading is enabled, this hash is filled as constants are autoloaded
362
- # or eager loaded. Otherwise, the collection remains empty.
363
- #
364
- # source://zeitwerk//lib/zeitwerk/loader.rb#58
365
- def to_unload; end
366
-
367
- # source://zeitwerk//lib/zeitwerk/loader.rb#529
368
- def unload_autoload(parent, cname); end
369
-
370
- # source://zeitwerk//lib/zeitwerk/loader.rb#535
371
- def unload_cref(parent, cname); end
372
-
373
- class << self
374
- # Returns an array with the absolute paths of the root directories of all
375
- # registered loaders. This is a read-only collection.
376
- #
377
- # source://zeitwerk//lib/zeitwerk/loader.rb#354
378
- def all_dirs; end
379
-
380
- # Returns the value of attribute default_logger.
381
- #
382
- # source://zeitwerk//lib/zeitwerk/loader.rb#270
383
- def default_logger; end
384
-
385
- # Sets the attribute default_logger
386
- #
387
- # @param value the value to set the attribute default_logger to.
388
- #
389
- # source://zeitwerk//lib/zeitwerk/loader.rb#270
390
- def default_logger=(_arg0); end
391
-
392
- # Broadcasts `eager_load` to all loaders. Those that have not been setup
393
- # are skipped.
394
- #
395
- # source://zeitwerk//lib/zeitwerk/loader.rb#326
396
- def eager_load_all; end
397
-
398
- # Broadcasts `eager_load_namespace` to all loaders. Those that have not
399
- # been setup are skipped.
400
- #
401
- # source://zeitwerk//lib/zeitwerk/loader.rb#340
402
- def eager_load_namespace(mod); end
403
-
404
- # This is a shortcut for
405
- #
406
- # require "zeitwerk"
407
- #
408
- # loader = Zeitwerk::Loader.new
409
- # loader.tag = File.basename(__FILE__, ".rb")
410
- # loader.inflector = Zeitwerk::GemInflector.new(__FILE__)
411
- # loader.push_dir(__dir__)
412
- #
413
- # except that this method returns the same object in subsequent calls from
414
- # the same file, in the unlikely case the gem wants to be able to reload.
415
- #
416
- # This method returns a subclass of Zeitwerk::Loader, but the exact type
417
- # is private, client code can only rely on the interface.
418
- #
419
- # source://zeitwerk//lib/zeitwerk/loader.rb#288
420
- def for_gem(warn_on_extra_files: T.unsafe(nil)); end
421
-
422
- # This is a shortcut for
423
- #
424
- # require "zeitwerk"
425
- #
426
- # loader = Zeitwerk::Loader.new
427
- # loader.tag = namespace.name + "-" + File.basename(__FILE__, ".rb")
428
- # loader.inflector = Zeitwerk::GemInflector.new(__FILE__)
429
- # loader.push_dir(__dir__, namespace: namespace)
430
- #
431
- # except that this method returns the same object in subsequent calls from
432
- # the same file, in the unlikely case the gem wants to be able to reload.
433
- #
434
- # This method returns a subclass of Zeitwerk::Loader, but the exact type
435
- # is private, client code can only rely on the interface.
436
- #
437
- # source://zeitwerk//lib/zeitwerk/loader.rb#309
438
- def for_gem_extension(namespace); end
439
- end
440
- end
441
-
442
- # source://zeitwerk//lib/zeitwerk/loader/callbacks.rb#3
443
- module Zeitwerk::Loader::Callbacks
444
- include ::Zeitwerk::RealModName
445
-
446
- # Invoked from our decorated Kernel#require when a managed directory is
447
- # autoloaded.
448
- #
449
- # @private
450
- #
451
- # source://zeitwerk//lib/zeitwerk/loader/callbacks.rb#34
452
- def on_dir_autoloaded(dir); end
453
-
454
- # Invoked from our decorated Kernel#require when a managed file is autoloaded.
455
- #
456
- # @private
457
- #
458
- # source://zeitwerk//lib/zeitwerk/loader/callbacks.rb#10
459
- def on_file_autoloaded(file); end
460
-
461
- # Invoked when a class or module is created or reopened, either from the
462
- # tracer or from module autovivification. If the namespace has matching
463
- # subdirectories, we descend into them now.
464
- #
465
- # @private
466
- #
467
- # source://zeitwerk//lib/zeitwerk/loader/callbacks.rb#73
468
- def on_namespace_loaded(namespace); end
469
-
470
- private
471
-
472
- # source://zeitwerk//lib/zeitwerk/loader/callbacks.rb#84
473
- def run_on_load_callbacks(cpath, value, abspath); end
474
- end
475
-
476
- # source://zeitwerk//lib/zeitwerk/loader/config.rb#6
477
- module Zeitwerk::Loader::Config
478
- include ::Zeitwerk::RealModName
479
- extend ::Zeitwerk::Internal
480
-
481
- # source://zeitwerk//lib/zeitwerk/loader/config.rb#86
482
- def initialize; end
483
-
484
- # source://zeitwerk//lib/zeitwerk/loader/config.rb#296
485
- def __ignores?(abspath); end
486
-
487
- def __roots; end
488
-
489
- # Configure directories or glob patterns to be collapsed.
490
- #
491
- # source://zeitwerk//lib/zeitwerk/loader/config.rb#216
492
- def collapse(*glob_patterns); end
493
-
494
- # If `namespaces` is falsey (default), returns an array with the absolute
495
- # paths of the root directories as strings. If truthy, returns a hash table
496
- # instead. Keys are the absolute paths of the root directories as strings,
497
- # values are their corresponding namespaces, class or module objects.
498
- #
499
- # If `ignored` is falsey (default), ignored root directories are filtered out.
500
- #
501
- # These are read-only collections, please add to them with `push_dir`.
502
- #
503
- # source://zeitwerk//lib/zeitwerk/loader/config.rb#156
504
- def dirs(namespaces: T.unsafe(nil), ignored: T.unsafe(nil)); end
505
-
506
- # Let eager load ignore the given files or directories. The constants defined
507
- # in those files are still autoloadable.
508
- #
509
- # source://zeitwerk//lib/zeitwerk/loader/config.rb#198
510
- def do_not_eager_load(*paths); end
511
-
512
- # You need to call this method before setup in order to be able to reload.
513
- # There is no way to undo this, either you want to reload or you don't.
514
- #
515
- # @raise [Zeitwerk::Error]
516
- #
517
- # source://zeitwerk//lib/zeitwerk/loader/config.rb#177
518
- def enable_reloading; end
519
-
520
- # Configure files, directories, or glob patterns to be totally ignored.
521
- #
522
- # source://zeitwerk//lib/zeitwerk/loader/config.rb#205
523
- def ignore(*glob_patterns); end
524
-
525
- # Returns the value of attribute inflector.
526
- #
527
- # source://zeitwerk//lib/zeitwerk/loader/config.rb#11
528
- def inflector; end
529
-
530
- # Sets the attribute inflector
531
- #
532
- # @param value the value to set the attribute inflector to.
533
- #
534
- # source://zeitwerk//lib/zeitwerk/loader/config.rb#11
535
- def inflector=(_arg0); end
536
-
537
- # Logs to `$stdout`, handy shortcut for debugging.
538
- #
539
- # source://zeitwerk//lib/zeitwerk/loader/config.rb#288
540
- def log!; end
541
-
542
- # Returns the value of attribute logger.
543
- #
544
- # source://zeitwerk//lib/zeitwerk/loader/config.rb#14
545
- def logger; end
546
-
547
- # Sets the attribute logger
548
- #
549
- # @param value the value to set the attribute logger to.
550
- #
551
- # source://zeitwerk//lib/zeitwerk/loader/config.rb#14
552
- def logger=(_arg0); end
553
-
554
- # Configure a block to be invoked once a certain constant path is loaded.
555
- # Supports multiple callbacks, and if there are many, they are executed in
556
- # the order in which they were defined.
557
- #
558
- # loader.on_load("SomeApiClient") do |klass, _abspath|
559
- # klass.endpoint = "https://api.dev"
560
- # end
561
- #
562
- # Can also be configured for any constant loaded:
563
- #
564
- # loader.on_load do |cpath, value, abspath|
565
- # # ...
566
- # end
567
- #
568
- # @raise [TypeError]
569
- #
570
- # source://zeitwerk//lib/zeitwerk/loader/config.rb#252
571
- def on_load(cpath = T.unsafe(nil), &block); end
572
-
573
- # Configure a block to be called after setup and on each reload.
574
- # If setup was already done, the block runs immediately.
575
- #
576
- # source://zeitwerk//lib/zeitwerk/loader/config.rb#228
577
- def on_setup(&block); end
578
-
579
- # Configure a block to be invoked right before a certain constant is removed.
580
- # Supports multiple callbacks, and if there are many, they are executed in the
581
- # order in which they were defined.
582
- #
583
- # loader.on_unload("Country") do |klass, _abspath|
584
- # klass.clear_cache
585
- # end
586
- #
587
- # Can also be configured for any removed constant:
588
- #
589
- # loader.on_unload do |cpath, value, abspath|
590
- # # ...
591
- # end
592
- #
593
- # @raise [TypeError]
594
- #
595
- # source://zeitwerk//lib/zeitwerk/loader/config.rb#277
596
- def on_unload(cpath = T.unsafe(nil), &block); end
597
-
598
- # Pushes `path` to the list of root directories.
599
- #
600
- # Raises `Zeitwerk::Error` if `path` does not exist, or if another loader in
601
- # the same process already manages that directory or one of its ascendants or
602
- # descendants.
603
- #
604
- # @raise [Zeitwerk::Error]
605
- #
606
- # source://zeitwerk//lib/zeitwerk/loader/config.rb#111
607
- def push_dir(path, namespace: T.unsafe(nil)); end
608
-
609
- # @return [Boolean]
610
- #
611
- # source://zeitwerk//lib/zeitwerk/loader/config.rb#190
612
- def reloading_enabled?; end
613
-
614
- # Returns the loader's tag.
615
- #
616
- # Implemented as a method instead of via attr_reader for symmetry with the
617
- # writer below.
618
- #
619
- # source://zeitwerk//lib/zeitwerk/loader/config.rb#135
620
- def tag; end
621
-
622
- # Sets a tag for the loader, useful for logging.
623
- #
624
- # source://zeitwerk//lib/zeitwerk/loader/config.rb#142
625
- def tag=(tag); end
626
-
627
- private
628
-
629
- # source://zeitwerk//lib/zeitwerk/loader/config.rb#314
630
- def actual_roots; end
631
-
632
- # @return [Boolean]
633
- #
634
- # source://zeitwerk//lib/zeitwerk/loader/config.rb#339
635
- def collapse?(dir); end
636
-
637
- # The actual collection of absolute directory names at the time the collapse
638
- # glob patterns were expanded. Computed on setup, and recomputed on reload.
639
- #
640
- # source://zeitwerk//lib/zeitwerk/loader/config.rb#57
641
- def collapse_dirs; end
642
-
643
- # Absolute paths of directories or glob patterns to be collapsed.
644
- #
645
- # source://zeitwerk//lib/zeitwerk/loader/config.rb#50
646
- def collapse_glob_patterns; end
647
-
648
- # Absolute paths of files or directories not to be eager loaded.
649
- #
650
- # source://zeitwerk//lib/zeitwerk/loader/config.rb#63
651
- def eager_load_exclusions; end
652
-
653
- # @return [Boolean]
654
- #
655
- # source://zeitwerk//lib/zeitwerk/loader/config.rb#326
656
- def excluded_from_eager_load?(abspath); end
657
-
658
- # source://zeitwerk//lib/zeitwerk/loader/config.rb#349
659
- def expand_glob_patterns(glob_patterns); end
660
-
661
- # source://zeitwerk//lib/zeitwerk/loader/config.rb#344
662
- def expand_paths(paths); end
663
-
664
- # Absolute paths of files, directories, or glob patterns to be totally
665
- # ignored.
666
- #
667
- # source://zeitwerk//lib/zeitwerk/loader/config.rb#36
668
- def ignored_glob_patterns; end
669
-
670
- # @return [Boolean]
671
- #
672
- # source://zeitwerk//lib/zeitwerk/loader/config.rb#309
673
- def ignored_path?(abspath); end
674
-
675
- # The actual collection of absolute file and directory names at the time the
676
- # ignored glob patterns were expanded. Computed on setup, and recomputed on
677
- # reload.
678
- #
679
- # source://zeitwerk//lib/zeitwerk/loader/config.rb#44
680
- def ignored_paths; end
681
-
682
- # source://zeitwerk//lib/zeitwerk/loader/config.rb#296
683
- def ignores?(abspath); end
684
-
685
- # User-oriented callbacks to be fired when a constant is loaded.
686
- #
687
- # source://zeitwerk//lib/zeitwerk/loader/config.rb#76
688
- def on_load_callbacks; end
689
-
690
- # User-oriented callbacks to be fired on setup and on reload.
691
- #
692
- # source://zeitwerk//lib/zeitwerk/loader/config.rb#69
693
- def on_setup_callbacks; end
694
-
695
- # User-oriented callbacks to be fired before constants are removed.
696
- #
697
- # source://zeitwerk//lib/zeitwerk/loader/config.rb#83
698
- def on_unload_callbacks; end
699
-
700
- # source://zeitwerk//lib/zeitwerk/loader/config.rb#361
701
- def recompute_collapse_dirs; end
702
-
703
- # source://zeitwerk//lib/zeitwerk/loader/config.rb#356
704
- def recompute_ignored_paths; end
705
-
706
- # @return [Boolean]
707
- #
708
- # source://zeitwerk//lib/zeitwerk/loader/config.rb#321
709
- def root_dir?(dir); end
710
-
711
- # Absolute paths of the root directories, mapped to their respective root namespaces:
712
- #
713
- # "/Users/fxn/blog/app/channels" => Object,
714
- # "/Users/fxn/blog/app/adapters" => ActiveJob::QueueAdapters,
715
- # ...
716
- #
717
- # Stored in a hash to preserve order, easily handle duplicates, and have a
718
- # fast lookup by directory.
719
- #
720
- # This is a private collection maintained by the loader. The public
721
- # interface for it is `push_dir` and `dirs`.
722
- #
723
- # source://zeitwerk//lib/zeitwerk/loader/config.rb#29
724
- def roots; end
725
- end
726
-
727
- # source://zeitwerk//lib/zeitwerk/loader/eager_load.rb#1
728
- module Zeitwerk::Loader::EagerLoad
729
- # Eager loads all files in the root directories, recursively. Files do not
730
- # need to be in `$LOAD_PATH`, absolute file names are used. Ignored and
731
- # shadowed files are not eager loaded. You can opt-out specifically in
732
- # specific files and directories with `do_not_eager_load`, and that can be
733
- # overridden passing `force: true`.
734
- #
735
- # source://zeitwerk//lib/zeitwerk/loader/eager_load.rb#9
736
- def eager_load(force: T.unsafe(nil)); end
737
-
738
- # @raise [Zeitwerk::SetupRequired]
739
- #
740
- # source://zeitwerk//lib/zeitwerk/loader/eager_load.rb#32
741
- def eager_load_dir(path); end
742
-
743
- # @raise [Zeitwerk::SetupRequired]
744
- #
745
- # source://zeitwerk//lib/zeitwerk/loader/eager_load.rb#72
746
- def eager_load_namespace(mod); end
747
-
748
- # Loads the given Ruby file.
749
- #
750
- # Raises if the argument is ignored, shadowed, or not managed by the receiver.
751
- #
752
- # The method is implemented as `constantize` for files, in a sense, to be able
753
- # to descend orderly and make sure the file is loadable.
754
- #
755
- # @raise [Zeitwerk::Error]
756
- #
757
- # source://zeitwerk//lib/zeitwerk/loader/eager_load.rb#114
758
- def load_file(path); end
759
-
760
- private
761
-
762
- # The caller is responsible for making sure `namespace` is the namespace that
763
- # corresponds to `dir`.
764
- #
765
- # source://zeitwerk//lib/zeitwerk/loader/eager_load.rb#154
766
- def actual_eager_load_dir(dir, namespace, force: T.unsafe(nil)); end
767
-
768
- # In order to invoke this method, the caller has to ensure `child` is a
769
- # strict namespace descendant of `root_namespace`.
770
- #
771
- # source://zeitwerk//lib/zeitwerk/loader/eager_load.rb#189
772
- def eager_load_child_namespace(child, child_name, root_dir, root_namespace); end
773
- end
774
-
775
- # source://zeitwerk//lib/zeitwerk/loader/helpers.rb#3
776
- module Zeitwerk::Loader::Helpers
777
- private
778
-
779
- # @return [Boolean]
780
- #
781
- # source://zeitwerk//lib/zeitwerk/loader/helpers.rb#128
782
- def cdef?(parent, cname); end
783
-
784
- # @raise [NameError]
785
- #
786
- # source://zeitwerk//lib/zeitwerk/loader/helpers.rb#134
787
- def cget(parent, cname); end
788
-
789
- # Symbol#name was introduced in Ruby 3.0. It returns always the same
790
- # frozen object, so we may save a few string allocations.
791
- #
792
- # source://zeitwerk//lib/zeitwerk/loader/helpers.rb#118
793
- def cpath(parent, cname); end
794
-
795
- # @raise [NameError]
796
- #
797
- # source://zeitwerk//lib/zeitwerk/loader/helpers.rb#140
798
- def crem(parent, cname); end
799
-
800
- # @return [Boolean]
801
- #
802
- # source://zeitwerk//lib/zeitwerk/loader/helpers.rb#67
803
- def dir?(path); end
804
-
805
- # @return [Boolean]
806
- #
807
- # source://zeitwerk//lib/zeitwerk/loader/helpers.rb#45
808
- def has_at_least_one_ruby_file?(dir); end
809
-
810
- # @return [Boolean]
811
- #
812
- # source://zeitwerk//lib/zeitwerk/loader/helpers.rb#72
813
- def hidden?(basename); end
814
-
815
- # source://zeitwerk//lib/zeitwerk/loader/helpers.rb#7
816
- def log(message); end
817
-
818
- # source://zeitwerk//lib/zeitwerk/loader/helpers.rb#15
819
- def ls(dir); end
820
-
821
- # @return [Boolean]
822
- #
823
- # source://zeitwerk//lib/zeitwerk/loader/helpers.rb#62
824
- def ruby?(path); end
825
-
826
- # source://zeitwerk//lib/zeitwerk/loader/helpers.rb#109
827
- def strict_autoload_path(parent, cname); end
828
-
829
- # source://zeitwerk//lib/zeitwerk/loader/helpers.rb#77
830
- def walk_up(abspath); end
831
- end
832
-
833
- # source://zeitwerk//lib/zeitwerk/loader.rb#20
834
- Zeitwerk::Loader::MUTEX = T.let(T.unsafe(nil), Thread::Mutex)
835
-
836
- # source://zeitwerk//lib/zeitwerk/error.rb#13
837
- class Zeitwerk::NameError < ::NameError; end
838
-
839
- # source://zeitwerk//lib/zeitwerk/real_mod_name.rb#3
840
- module Zeitwerk::RealModName
841
- # source://zeitwerk//lib/zeitwerk/real_mod_name.rb#14
842
- def real_mod_name(mod); end
843
- end
844
-
845
- # source://zeitwerk//lib/zeitwerk/real_mod_name.rb#4
846
- Zeitwerk::RealModName::UNBOUND_METHOD_MODULE_NAME = T.let(T.unsafe(nil), UnboundMethod)
847
-
848
- # source://zeitwerk//lib/zeitwerk/registry.rb#4
849
- module Zeitwerk::Registry
850
- class << self
851
- # Maps absolute paths to the loaders responsible for them.
852
- #
853
- # This information is used by our decorated `Kernel#require` to be able to
854
- # invoke callbacks and autovivify modules.
855
- #
856
- # @private
857
- #
858
- # source://zeitwerk//lib/zeitwerk/registry.rb#26
859
- def autoloads; end
860
-
861
- # Registers gem loaders to let `for_gem` be idempotent in case of reload.
862
- #
863
- # @private
864
- #
865
- # source://zeitwerk//lib/zeitwerk/registry.rb#17
866
- def gem_loaders_by_root_file; end
867
-
868
- # @private
869
- # @return [Boolean]
870
- #
871
- # source://zeitwerk//lib/zeitwerk/registry.rb#113
872
- def inception?(cpath); end
873
-
874
- # This hash table addresses an edge case in which an autoload is ignored.
875
- #
876
- # For example, let's suppose we want to autoload in a gem like this:
877
- #
878
- # # lib/my_gem.rb
879
- # loader = Zeitwerk::Loader.new
880
- # loader.push_dir(__dir__)
881
- # loader.setup
882
- #
883
- # module MyGem
884
- # end
885
- #
886
- # if you require "my_gem", as Bundler would do, this happens while setting
887
- # up autoloads:
888
- #
889
- # 1. Object.autoload?(:MyGem) returns `nil` because the autoload for
890
- # the constant is issued by Zeitwerk while the same file is being
891
- # required.
892
- # 2. The constant `MyGem` is undefined while setup runs.
893
- #
894
- # Therefore, a directory `lib/my_gem` would autovivify a module according to
895
- # the existing information. But that would be wrong.
896
- #
897
- # To overcome this fundamental limitation, we keep track of the constant
898
- # paths that are in this situation ---in the example above, "MyGem"--- and
899
- # take this collection into account for the autovivification logic.
900
- #
901
- # Note that you cannot generally address this by moving the setup code
902
- # below the constant definition, because we want libraries to be able to
903
- # use managed constants in the module body:
904
- #
905
- # module MyGem
906
- # include MyConcern
907
- # end
908
- #
909
- # @private
910
- #
911
- # source://zeitwerk//lib/zeitwerk/registry.rb#65
912
- def inceptions; end
913
-
914
- # @private
915
- #
916
- # source://zeitwerk//lib/zeitwerk/registry.rb#121
917
- def loader_for(path); end
918
-
919
- # This method returns always a loader, the same instance for the same root
920
- # file. That is how Zeitwerk::Loader.for_gem is idempotent.
921
- #
922
- # @private
923
- #
924
- # source://zeitwerk//lib/zeitwerk/registry.rb#89
925
- def loader_for_gem(root_file, namespace:, warn_on_extra_files:); end
926
-
927
- # Keeps track of all loaders. Useful to broadcast messages and to prevent
928
- # them from being garbage collected.
929
- #
930
- # @private
931
- #
932
- # source://zeitwerk//lib/zeitwerk/registry.rb#11
933
- def loaders; end
934
-
935
- # @private
936
- #
937
- # source://zeitwerk//lib/zeitwerk/registry.rb#127
938
- def on_unload(loader); end
939
-
940
- # @private
941
- #
942
- # source://zeitwerk//lib/zeitwerk/registry.rb#95
943
- def register_autoload(loader, abspath); end
944
-
945
- # @private
946
- #
947
- # source://zeitwerk//lib/zeitwerk/registry.rb#107
948
- def register_inception(cpath, abspath, loader); end
949
-
950
- # Registers a loader.
951
- #
952
- # @private
953
- #
954
- # source://zeitwerk//lib/zeitwerk/registry.rb#71
955
- def register_loader(loader); end
956
-
957
- # @private
958
- #
959
- # source://zeitwerk//lib/zeitwerk/registry.rb#101
960
- def unregister_autoload(abspath); end
961
-
962
- # @private
963
- #
964
- # source://zeitwerk//lib/zeitwerk/registry.rb#77
965
- def unregister_loader(loader); end
966
- end
967
- end
968
-
969
- # source://zeitwerk//lib/zeitwerk/error.rb#7
970
- class Zeitwerk::ReloadingDisabledError < ::Zeitwerk::Error
971
- # @return [ReloadingDisabledError] a new instance of ReloadingDisabledError
972
- #
973
- # source://zeitwerk//lib/zeitwerk/error.rb#8
974
- def initialize; end
975
- end
976
-
977
- # source://zeitwerk//lib/zeitwerk/error.rb#16
978
- class Zeitwerk::SetupRequired < ::Zeitwerk::Error
979
- # @return [SetupRequired] a new instance of SetupRequired
980
- #
981
- # source://zeitwerk//lib/zeitwerk/error.rb#17
982
- def initialize; end
983
- end
984
-
985
- # source://zeitwerk//lib/zeitwerk/version.rb#4
986
- Zeitwerk::VERSION = T.let(T.unsafe(nil), String)