visualize_packwerk 0.0.1

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.
Files changed (56) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +32 -0
  3. data/lib/visualize_packwerk/graph_interface.rb +17 -0
  4. data/lib/visualize_packwerk/node_interface.rb +29 -0
  5. data/lib/visualize_packwerk/package_graph.rb +48 -0
  6. data/lib/visualize_packwerk/package_node.rb +28 -0
  7. data/lib/visualize_packwerk/package_relationships.rb +158 -0
  8. data/lib/visualize_packwerk/railtie.rb +15 -0
  9. data/lib/visualize_packwerk/tasks/visualize_packwerk.rake +73 -0
  10. data/lib/visualize_packwerk/team_graph.rb +52 -0
  11. data/lib/visualize_packwerk/team_node.rb +27 -0
  12. data/lib/visualize_packwerk.rb +17 -0
  13. data/sorbet/config +2 -0
  14. data/sorbet/rbi/gems/activesupport@7.0.3.1.rbi +76 -0
  15. data/sorbet/rbi/gems/ast@2.4.2.rbi +522 -0
  16. data/sorbet/rbi/gems/code_ownership@1.28.0.rbi +411 -0
  17. data/sorbet/rbi/gems/code_teams@1.0.0.rbi +138 -0
  18. data/sorbet/rbi/gems/coderay@1.1.3.rbi +8 -0
  19. data/sorbet/rbi/gems/concurrent-ruby@1.1.10.rbi +8 -0
  20. data/sorbet/rbi/gems/diff-lcs@1.5.0.rbi +866 -0
  21. data/sorbet/rbi/gems/i18n@1.12.0.rbi +8 -0
  22. data/sorbet/rbi/gems/json@2.6.2.rbi +1423 -0
  23. data/sorbet/rbi/gems/method_source@1.0.0.rbi +8 -0
  24. data/sorbet/rbi/gems/minitest@5.16.2.rbi +9 -0
  25. data/sorbet/rbi/gems/package_protections@1.3.0.rbi +654 -0
  26. data/sorbet/rbi/gems/parallel@1.22.1.rbi +163 -0
  27. data/sorbet/rbi/gems/parse_packwerk@0.11.0.rbi +148 -0
  28. data/sorbet/rbi/gems/parser@3.1.2.0.rbi +4261 -0
  29. data/sorbet/rbi/gems/pry@0.14.1.rbi +8 -0
  30. data/sorbet/rbi/gems/rainbow@3.1.1.rbi +8 -0
  31. data/sorbet/rbi/gems/rake@13.0.6.rbi +1854 -0
  32. data/sorbet/rbi/gems/rbi@0.0.15.rbi +2340 -0
  33. data/sorbet/rbi/gems/regexp_parser@2.5.0.rbi +8 -0
  34. data/sorbet/rbi/gems/rexml@3.2.5.rbi +8 -0
  35. data/sorbet/rbi/gems/rspec-core@3.11.0.rbi +7698 -0
  36. data/sorbet/rbi/gems/rspec-expectations@3.11.0.rbi +6201 -0
  37. data/sorbet/rbi/gems/rspec-mocks@3.11.1.rbi +3625 -0
  38. data/sorbet/rbi/gems/rspec-support@3.11.0.rbi +1176 -0
  39. data/sorbet/rbi/gems/rspec@3.11.0.rbi +40 -0
  40. data/sorbet/rbi/gems/rubocop-ast@1.19.1.rbi +8 -0
  41. data/sorbet/rbi/gems/rubocop-sorbet@0.6.11.rbi +8 -0
  42. data/sorbet/rbi/gems/rubocop@1.33.0.rbi +8 -0
  43. data/sorbet/rbi/gems/ruby-graphviz@1.2.5.rbi +840 -0
  44. data/sorbet/rbi/gems/ruby-progressbar@1.11.0.rbi +8 -0
  45. data/sorbet/rbi/gems/spoom@1.1.11.rbi +1600 -0
  46. data/sorbet/rbi/gems/tapioca@0.8.3.rbi +1978 -0
  47. data/sorbet/rbi/gems/thor@1.2.1.rbi +2921 -0
  48. data/sorbet/rbi/gems/tzinfo@2.0.5.rbi +8 -0
  49. data/sorbet/rbi/gems/unicode-display_width@2.2.0.rbi +8 -0
  50. data/sorbet/rbi/gems/unparser@0.6.5.rbi +8 -0
  51. data/sorbet/rbi/gems/webrick@1.7.0.rbi +1802 -0
  52. data/sorbet/rbi/gems/yard-sorbet@0.6.1.rbi +288 -0
  53. data/sorbet/rbi/gems/yard@0.9.28.rbi +12863 -0
  54. data/sorbet/tapioca/config.yml +13 -0
  55. data/sorbet/tapioca/require.rb +7 -0
  56. metadata +241 -0
@@ -0,0 +1,1978 @@
1
+ # typed: false
2
+
3
+ # DO NOT EDIT MANUALLY
4
+ # This is an autogenerated file for types exported from the `tapioca` gem.
5
+ # Please instead update this file by running `bin/tapioca gem tapioca`.
6
+
7
+ # We need to do the alias-method-chain dance since Bootsnap does the same,
8
+ # and prepended modules and alias-method-chain don't play well together.
9
+ #
10
+ # So, why does Bootsnap do alias-method-chain and not prepend? Glad you asked!
11
+ # That's because RubyGems does alias-method-chain for Kernel#require and such,
12
+ # so, if Bootsnap were to do prepend, it might end up breaking RubyGems.
13
+ class Module
14
+ def append_features(constant); end
15
+ def autoload(const_name, path); end
16
+ def extend_object(obj); end
17
+ def prepend_features(constant); end
18
+ end
19
+
20
+ module RBI; end
21
+
22
+ class RBI::Tree < ::RBI::NodeWithComments
23
+ sig do
24
+ params(
25
+ loc: T.nilable(::RBI::Loc),
26
+ comments: T::Array[::RBI::Comment],
27
+ block: T.nilable(T.proc.params(node: ::RBI::Tree).void)
28
+ ).void
29
+ end
30
+ def initialize(loc: T.unsafe(nil), comments: T.unsafe(nil), &block); end
31
+
32
+ sig { params(node: ::RBI::Node).void }
33
+ def <<(node); end
34
+
35
+ sig { override.params(v: ::RBI::Printer).void }
36
+ def accept_printer(v); end
37
+
38
+ sig { params(with_todo_comment: T::Boolean).void }
39
+ def add_sig_templates!(with_todo_comment: T.unsafe(nil)); end
40
+
41
+ sig { params(annotation: ::String, annotate_scopes: T::Boolean, annotate_properties: T::Boolean).void }
42
+ def annotate!(annotation, annotate_scopes: T.unsafe(nil), annotate_properties: T.unsafe(nil)); end
43
+
44
+ sig do
45
+ params(
46
+ name: ::String,
47
+ superclass_name: T.nilable(::String),
48
+ block: T.nilable(T.proc.params(scope: ::RBI::Scope).void)
49
+ ).returns(::RBI::Scope)
50
+ end
51
+ def create_class(name, superclass_name: T.unsafe(nil), &block); end
52
+
53
+ sig { params(name: ::String, value: ::String).void }
54
+ def create_constant(name, value:); end
55
+
56
+ sig { params(name: ::String).void }
57
+ def create_extend(name); end
58
+
59
+ sig { params(name: ::String).void }
60
+ def create_include(name); end
61
+
62
+ sig do
63
+ params(
64
+ name: ::String,
65
+ parameters: T::Array[::RBI::TypedParam],
66
+ return_type: ::String,
67
+ class_method: T::Boolean,
68
+ visibility: ::RBI::Visibility
69
+ ).void
70
+ end
71
+ def create_method(name, parameters: T.unsafe(nil), return_type: T.unsafe(nil), class_method: T.unsafe(nil), visibility: T.unsafe(nil)); end
72
+
73
+ sig { params(name: ::String).void }
74
+ def create_mixes_in_class_methods(name); end
75
+
76
+ sig { params(name: ::String, block: T.nilable(T.proc.params(scope: ::RBI::Scope).void)).returns(::RBI::Scope) }
77
+ def create_module(name, &block); end
78
+
79
+ sig { params(constant: ::Module, block: T.nilable(T.proc.params(scope: ::RBI::Scope).void)).void }
80
+ def create_path(constant, &block); end
81
+
82
+ sig do
83
+ params(
84
+ name: ::String,
85
+ type: ::String,
86
+ variance: ::Symbol,
87
+ fixed: T.nilable(::String),
88
+ upper: T.nilable(::String),
89
+ lower: T.nilable(::String)
90
+ ).void
91
+ end
92
+ def create_type_variable(name, type:, variance: T.unsafe(nil), fixed: T.unsafe(nil), upper: T.unsafe(nil), lower: T.unsafe(nil)); end
93
+
94
+ sig { params(annotation: ::String).void }
95
+ def deannotate!(annotation); end
96
+
97
+ sig { returns(T::Boolean) }
98
+ def empty?; end
99
+
100
+ sig { void }
101
+ def group_nodes!; end
102
+
103
+ sig { returns(::RBI::Index) }
104
+ def index; end
105
+
106
+ sig do
107
+ params(
108
+ other: ::RBI::Tree,
109
+ left_name: ::String,
110
+ right_name: ::String,
111
+ keep: ::RBI::Rewriters::Merge::Keep
112
+ ).returns(::RBI::MergeTree)
113
+ end
114
+ def merge(other, left_name: T.unsafe(nil), right_name: T.unsafe(nil), keep: T.unsafe(nil)); end
115
+
116
+ sig { void }
117
+ def nest_non_public_methods!; end
118
+
119
+ sig { void }
120
+ def nest_singleton_methods!; end
121
+
122
+ sig { returns(T::Array[::RBI::Node]) }
123
+ def nodes; end
124
+
125
+ sig { override.returns(T::Boolean) }
126
+ def oneline?; end
127
+
128
+ sig { void }
129
+ def sort_nodes!; end
130
+
131
+ private
132
+
133
+ sig { params(node: ::RBI::Node).returns(::RBI::Node) }
134
+ def create_node(node); end
135
+
136
+ sig { returns(T::Hash[::String, ::RBI::Node]) }
137
+ def nodes_cache; end
138
+
139
+ sig { params(name: ::String).returns(T::Boolean) }
140
+ def valid_method_name?(name); end
141
+ end
142
+
143
+ RBI::Tree::SPECIAL_METHOD_NAMES = T.let(T.unsafe(nil), Array)
144
+
145
+ class RBI::TypedParam < ::T::Struct
146
+ const :param, ::RBI::Param
147
+ const :type, ::String
148
+
149
+ class << self
150
+ def inherited(s); end
151
+ end
152
+ end
153
+
154
+ RBI::VERSION = T.let(T.unsafe(nil), String)
155
+
156
+ module T::Generic
157
+ def [](*types); end
158
+ def type_member(variance = T.unsafe(nil), fixed: T.unsafe(nil), lower: T.unsafe(nil), upper: T.unsafe(nil), &bounds_proc); end
159
+ def type_template(variance = T.unsafe(nil), fixed: T.unsafe(nil), lower: T.unsafe(nil), upper: T.unsafe(nil), &bounds_proc); end
160
+ end
161
+
162
+ # This module intercepts calls to generic type instantiations and type variable definitions.
163
+ # Tapioca stores the data from those calls in a `GenericTypeRegistry` which can then be used
164
+ # to look up the original call details when we are trying to do code generation.
165
+ #
166
+ # We are interested in the data of the `[]`, `type_member` and `type_template` calls which
167
+ # are all needed to generate good generic information at runtime.
168
+ module T::Generic::TypeStoragePatch
169
+ def [](*types); end
170
+ def type_member(variance = T.unsafe(nil), fixed: T.unsafe(nil), lower: T.unsafe(nil), upper: T.unsafe(nil), &bounds_proc); end
171
+ def type_template(variance = T.unsafe(nil), fixed: T.unsafe(nil), lower: T.unsafe(nil), upper: T.unsafe(nil), &bounds_proc); end
172
+ end
173
+
174
+ class T::Types::Simple < ::T::Types::Base
175
+ def name; end
176
+ end
177
+
178
+ module T::Types::Simple::GenericPatch
179
+ # This method intercepts calls to the `name` method for simple types, so that
180
+ # it can ask the name to the type if the type is generic, since, by this point,
181
+ # we've created a clone of that type with the `name` method returning the
182
+ # appropriate name for that specific concrete type.
183
+ def name; end
184
+ end
185
+
186
+ module T::Types::Simple::NamePatch
187
+ def name; end
188
+ end
189
+
190
+ module T::Types::Simple::Private; end
191
+
192
+ module T::Types::Simple::Private::Pool
193
+ class << self
194
+ def type_for_module(mod); end
195
+ end
196
+ end
197
+
198
+ module T::Utils
199
+ class << self
200
+ def coerce(val); end
201
+ end
202
+ end
203
+
204
+ module T::Utils::CoercePatch
205
+ def coerce(val); end
206
+ end
207
+
208
+ module Tapioca
209
+ class << self
210
+ sig do
211
+ type_parameters(:Result)
212
+ .params(
213
+ blk: T.proc.returns(T.type_parameter(:Result))
214
+ ).returns(T.type_parameter(:Result))
215
+ end
216
+ def silence_warnings(&blk); end
217
+ end
218
+ end
219
+
220
+ Tapioca::BINARY_FILE = T.let(T.unsafe(nil), String)
221
+ Tapioca::CENTRAL_REPO_ANNOTATIONS_DIR = T.let(T.unsafe(nil), String)
222
+ Tapioca::CENTRAL_REPO_INDEX_PATH = T.let(T.unsafe(nil), String)
223
+ Tapioca::CENTRAL_REPO_ROOT_URI = T.let(T.unsafe(nil), String)
224
+
225
+ class Tapioca::Cli < ::Thor
226
+ include ::Tapioca::CliHelper
227
+ include ::Tapioca::ConfigHelper
228
+ include ::Tapioca::SorbetHelper
229
+ include ::Tapioca::ShimsHelper
230
+
231
+ def __print_version; end
232
+ def annotations; end
233
+ def check_shims; end
234
+ def dsl(*constants); end
235
+ def gem(*gems); end
236
+ def init; end
237
+ def require; end
238
+ def todo; end
239
+
240
+ class << self
241
+ def exit_on_failure?; end
242
+ end
243
+ end
244
+
245
+ Tapioca::Cli::FILE_HEADER_OPTION_DESC = T.let(T.unsafe(nil), String)
246
+
247
+ module Tapioca::CliHelper
248
+ requires_ancestor { Thor::Shell }
249
+
250
+ sig { params(options: T::Hash[::Symbol, T.untyped]).returns(::Tapioca::RBIFormatter) }
251
+ def rbi_formatter(options); end
252
+
253
+ sig { params(message: ::String, color: T.any(::Symbol, T::Array[::Symbol])).void }
254
+ def say_error(message = T.unsafe(nil), *color); end
255
+ end
256
+
257
+ module Tapioca::Commands; end
258
+
259
+ class Tapioca::Commands::Annotations < ::Tapioca::Commands::Command
260
+ sig { params(central_repo_root_uri: ::String, central_repo_index_path: ::String).void }
261
+ def initialize(central_repo_root_uri:, central_repo_index_path: T.unsafe(nil)); end
262
+
263
+ sig { override.void }
264
+ def execute; end
265
+
266
+ private
267
+
268
+ sig { params(name: ::String, content: ::String).returns(::String) }
269
+ def add_header(name, content); end
270
+
271
+ sig { params(gem_name: ::String).void }
272
+ def fetch_annotation(gem_name); end
273
+
274
+ sig { params(gem_names: T::Array[::String]).returns(T::Array[::String]) }
275
+ def fetch_annotations(gem_names); end
276
+
277
+ sig { params(path: ::String).returns(T.nilable(::String)) }
278
+ def fetch_file(path); end
279
+
280
+ sig { params(path: ::String).returns(T.nilable(::String)) }
281
+ def fetch_http_file(path); end
282
+
283
+ sig { returns(Tapioca::RepoIndex) }
284
+ def fetch_index; end
285
+
286
+ sig { params(path: ::String).returns(T.nilable(::String)) }
287
+ def fetch_local_file(path); end
288
+
289
+ sig { returns(T::Array[::String]) }
290
+ def list_gemfile_gems; end
291
+
292
+ sig { params(project_gems: T::Array[::String]).void }
293
+ def remove_expired_annotations(project_gems); end
294
+ end
295
+
296
+ # @abstract It cannont be directly instantiated. Subclasses must implement the `abstract` methods below.
297
+ class Tapioca::Commands::Command
298
+ include ::Thor::Base
299
+ include ::Thor::Invocation
300
+ include ::Thor::Shell
301
+ include ::Tapioca::CliHelper
302
+ extend ::Thor::Base::ClassMethods
303
+ extend ::Thor::Invocation::ClassMethods
304
+
305
+ abstract!
306
+
307
+ sig { void }
308
+ def initialize; end
309
+
310
+ # @abstract
311
+ sig { abstract.void }
312
+ def execute; end
313
+
314
+ sig { returns(::Thor::Actions) }
315
+ def file_writer; end
316
+
317
+ private
318
+
319
+ sig do
320
+ params(
321
+ path: T.any(::Pathname, ::String),
322
+ content: ::String,
323
+ force: T::Boolean,
324
+ skip: T::Boolean,
325
+ verbose: T::Boolean
326
+ ).void
327
+ end
328
+ def create_file(path, content, force: T.unsafe(nil), skip: T.unsafe(nil), verbose: T.unsafe(nil)); end
329
+
330
+ sig { params(command: ::Symbol, args: ::String).returns(::String) }
331
+ def default_command(command, *args); end
332
+
333
+ sig { params(path: T.any(::Pathname, ::String), verbose: T::Boolean).void }
334
+ def remove_file(path, verbose: T.unsafe(nil)); end
335
+ end
336
+
337
+ class Tapioca::Commands::Command::FileWriter < ::Thor
338
+ include ::Thor::Actions
339
+ extend ::Thor::Actions::ClassMethods
340
+ end
341
+
342
+ class Tapioca::Commands::Dsl < ::Tapioca::Commands::Command
343
+ include ::Tapioca::SorbetHelper
344
+ include ::Tapioca::RBIHelper
345
+
346
+ sig do
347
+ params(
348
+ requested_constants: T::Array[::String],
349
+ outpath: ::Pathname,
350
+ only: T::Array[::String],
351
+ exclude: T::Array[::String],
352
+ file_header: T::Boolean,
353
+ compiler_path: ::String,
354
+ tapioca_path: ::String,
355
+ should_verify: T::Boolean,
356
+ quiet: T::Boolean,
357
+ verbose: T::Boolean,
358
+ number_of_workers: T.nilable(::Integer),
359
+ auto_strictness: T::Boolean,
360
+ gem_dir: ::String,
361
+ rbi_formatter: ::Tapioca::RBIFormatter
362
+ ).void
363
+ end
364
+ def initialize(requested_constants:, outpath:, only:, exclude:, file_header:, compiler_path:, tapioca_path:, should_verify: T.unsafe(nil), quiet: T.unsafe(nil), verbose: T.unsafe(nil), number_of_workers: T.unsafe(nil), auto_strictness: T.unsafe(nil), gem_dir: T.unsafe(nil), rbi_formatter: T.unsafe(nil)); end
365
+
366
+ sig { override.void }
367
+ def execute; end
368
+
369
+ private
370
+
371
+ sig { void }
372
+ def abort_if_pending_migrations!; end
373
+
374
+ sig { params(cause: ::Symbol, files: T::Array[::String]).returns(::String) }
375
+ def build_error_for_files(cause, files); end
376
+
377
+ sig do
378
+ params(
379
+ constant_name: ::String,
380
+ rbi: ::RBI::File,
381
+ outpath: ::Pathname,
382
+ quiet: T::Boolean
383
+ ).returns(T.nilable(::Pathname))
384
+ end
385
+ def compile_dsl_rbi(constant_name, rbi, outpath: T.unsafe(nil), quiet: T.unsafe(nil)); end
386
+
387
+ sig { params(constant_names: T::Array[::String]).returns(T::Array[::Module]) }
388
+ def constantize(constant_names); end
389
+
390
+ sig { params(compiler_names: T::Array[::String]).returns(T::Array[T.class_of(Tapioca::Dsl::Compiler)]) }
391
+ def constantize_compilers(compiler_names); end
392
+
393
+ sig { params(constant_name: ::String).returns(::Pathname) }
394
+ def dsl_rbi_filename(constant_name); end
395
+
396
+ sig { params(requested_constants: T::Array[::String], path: ::Pathname).returns(T::Set[::Pathname]) }
397
+ def existing_rbi_filenames(requested_constants, path: T.unsafe(nil)); end
398
+
399
+ sig { params(constant: ::String).returns(::String) }
400
+ def generate_command_for(constant); end
401
+
402
+ sig { params(eager_load: T::Boolean).void }
403
+ def load_application(eager_load:); end
404
+
405
+ sig { void }
406
+ def load_dsl_compilers; end
407
+
408
+ sig { void }
409
+ def load_dsl_extensions; end
410
+
411
+ sig { returns(::Tapioca::Runtime::Loader) }
412
+ def loader; end
413
+
414
+ sig { params(dir: ::Pathname).void }
415
+ def perform_dsl_verification(dir); end
416
+
417
+ sig { params(files: T::Set[::Pathname]).void }
418
+ def purge_stale_dsl_rbi_files(files); end
419
+
420
+ sig { params(constant: ::String).returns(::String) }
421
+ def rbi_filename_for(constant); end
422
+
423
+ sig { params(path: ::Pathname).returns(T::Array[::Pathname]) }
424
+ def rbi_files_in(path); end
425
+
426
+ sig { params(diff: T::Hash[::String, ::Symbol], command: ::Symbol).void }
427
+ def report_diff_and_exit_if_out_of_date(diff, command); end
428
+
429
+ sig { params(name: ::String).returns(T.nilable(T.class_of(Tapioca::Dsl::Compiler))) }
430
+ def resolve(name); end
431
+
432
+ sig { params(class_name: ::String).returns(::String) }
433
+ def underscore(class_name); end
434
+
435
+ sig { params(tmp_dir: ::Pathname).returns(T::Hash[::String, ::Symbol]) }
436
+ def verify_dsl_rbi(tmp_dir:); end
437
+ end
438
+
439
+ class Tapioca::Commands::Gem < ::Tapioca::Commands::Command
440
+ include ::Tapioca::SorbetHelper
441
+ include ::Tapioca::RBIHelper
442
+
443
+ sig do
444
+ params(
445
+ gem_names: T::Array[::String],
446
+ exclude: T::Array[::String],
447
+ prerequire: T.nilable(::String),
448
+ postrequire: ::String,
449
+ typed_overrides: T::Hash[::String, ::String],
450
+ outpath: ::Pathname,
451
+ file_header: T::Boolean,
452
+ doc: T::Boolean,
453
+ include_exported_rbis: T::Boolean,
454
+ number_of_workers: T.nilable(::Integer),
455
+ auto_strictness: T::Boolean,
456
+ dsl_dir: ::String,
457
+ rbi_formatter: ::Tapioca::RBIFormatter
458
+ ).void
459
+ end
460
+ def initialize(gem_names:, exclude:, prerequire:, postrequire:, typed_overrides:, outpath:, file_header:, doc:, include_exported_rbis:, number_of_workers: T.unsafe(nil), auto_strictness: T.unsafe(nil), dsl_dir: T.unsafe(nil), rbi_formatter: T.unsafe(nil)); end
461
+
462
+ sig { override.void }
463
+ def execute; end
464
+
465
+ sig { params(should_verify: T::Boolean).void }
466
+ def sync(should_verify: T.unsafe(nil)); end
467
+
468
+ private
469
+
470
+ sig { returns(T::Array[::String]) }
471
+ def added_rbis; end
472
+
473
+ sig { params(cause: ::Symbol, files: T::Array[::String]).returns(::String) }
474
+ def build_error_for_files(cause, files); end
475
+
476
+ sig { returns(::Tapioca::Gemfile) }
477
+ def bundle; end
478
+
479
+ sig { params(gem: ::Tapioca::Gemfile::GemSpec).void }
480
+ def compile_gem_rbi(gem); end
481
+
482
+ sig { params(gem_name: ::String).returns(::Pathname) }
483
+ def existing_rbi(gem_name); end
484
+
485
+ sig { returns(T::Hash[::String, ::String]) }
486
+ def existing_rbis; end
487
+
488
+ sig { params(gem_name: ::String).returns(::Pathname) }
489
+ def expected_rbi(gem_name); end
490
+
491
+ sig { returns(T::Hash[::String, ::String]) }
492
+ def expected_rbis; end
493
+
494
+ sig { params(file: ::String, error: ::LoadError).void }
495
+ def explain_failed_require(file, error); end
496
+
497
+ sig { params(gem_name: ::String).returns(T::Boolean) }
498
+ def gem_rbi_exists?(gem_name); end
499
+
500
+ sig { params(gem_name: ::String, version: ::String).returns(::Pathname) }
501
+ def gem_rbi_filename(gem_name, version); end
502
+
503
+ sig { params(gem_names: T::Array[::String]).returns(T::Array[::Tapioca::Gemfile::GemSpec]) }
504
+ def gems_to_generate(gem_names); end
505
+
506
+ sig { returns(::Tapioca::Runtime::Loader) }
507
+ def loader; end
508
+
509
+ sig { params(gem: ::Tapioca::Gemfile::GemSpec, file: ::RBI::File).void }
510
+ def merge_with_exported_rbi(gem, file); end
511
+
512
+ sig { params(old_filename: ::Pathname, new_filename: ::Pathname).void }
513
+ def move(old_filename, new_filename); end
514
+
515
+ sig { void }
516
+ def perform_additions; end
517
+
518
+ sig { void }
519
+ def perform_removals; end
520
+
521
+ sig { void }
522
+ def perform_sync_verification; end
523
+
524
+ sig { returns(T::Array[::String]) }
525
+ def removed_rbis; end
526
+
527
+ sig { params(diff: T::Hash[::String, ::Symbol], command: ::Symbol).void }
528
+ def report_diff_and_exit_if_out_of_date(diff, command); end
529
+
530
+ sig { void }
531
+ def require_gem_file; end
532
+ end
533
+
534
+ class Tapioca::Commands::Init < ::Tapioca::Commands::Command
535
+ sig { params(sorbet_config: ::String, tapioca_config: ::String, default_postrequire: ::String).void }
536
+ def initialize(sorbet_config:, tapioca_config:, default_postrequire:); end
537
+
538
+ sig { override.void }
539
+ def execute; end
540
+
541
+ private
542
+
543
+ sig { void }
544
+ def create_binstub; end
545
+
546
+ sig { void }
547
+ def create_post_require; end
548
+
549
+ sig { void }
550
+ def create_sorbet_config; end
551
+
552
+ sig { void }
553
+ def create_tapioca_config; end
554
+
555
+ sig { returns(::Bundler::Installer) }
556
+ def installer; end
557
+
558
+ sig { returns(::Bundler::StubSpecification) }
559
+ def spec; end
560
+ end
561
+
562
+ class Tapioca::Commands::Require < ::Tapioca::Commands::Command
563
+ sig { params(requires_path: ::String, sorbet_config_path: ::String).void }
564
+ def initialize(requires_path:, sorbet_config_path:); end
565
+
566
+ sig { override.void }
567
+ def execute; end
568
+ end
569
+
570
+ class Tapioca::Commands::Todo < ::Tapioca::Commands::Command
571
+ include ::Tapioca::SorbetHelper
572
+
573
+ sig { params(todo_file: ::String, file_header: T::Boolean).void }
574
+ def initialize(todo_file:, file_header:); end
575
+
576
+ sig { override.void }
577
+ def execute; end
578
+
579
+ private
580
+
581
+ sig { params(constants: T::Array[::String], command: ::String).returns(::RBI::File) }
582
+ def rbi(constants, command:); end
583
+
584
+ sig { returns(T::Array[::String]) }
585
+ def unresolved_constants; end
586
+ end
587
+
588
+ module Tapioca::ConfigHelper
589
+ requires_ancestor { Thor }
590
+
591
+ sig { params(args: T.untyped, local_options: T.untyped, config: T.untyped).void }
592
+ def initialize(args = T.unsafe(nil), local_options = T.unsafe(nil), config = T.unsafe(nil)); end
593
+
594
+ sig { returns(::String) }
595
+ def command_name; end
596
+
597
+ sig { returns(::Thor::CoreExt::HashWithIndifferentAccess) }
598
+ def defaults; end
599
+
600
+ sig { returns(::Thor::CoreExt::HashWithIndifferentAccess) }
601
+ def options; end
602
+
603
+ private
604
+
605
+ sig { params(msg: ::String).returns(::Tapioca::ConfigHelper::ConfigError) }
606
+ def build_error(msg); end
607
+
608
+ sig do
609
+ params(
610
+ options: ::Thor::CoreExt::HashWithIndifferentAccess
611
+ ).returns(::Thor::CoreExt::HashWithIndifferentAccess)
612
+ end
613
+ def config_options(options); end
614
+
615
+ sig { params(options: T::Hash[::Symbol, ::Thor::Option]).void }
616
+ def filter_defaults(options); end
617
+
618
+ sig do
619
+ params(
620
+ options: T.nilable(::Thor::CoreExt::HashWithIndifferentAccess)
621
+ ).returns(::Thor::CoreExt::HashWithIndifferentAccess)
622
+ end
623
+ def merge_options(*options); end
624
+
625
+ sig { params(config_file: ::String, errors: T::Array[::Tapioca::ConfigHelper::ConfigError]).void }
626
+ def print_errors(config_file, errors); end
627
+
628
+ sig { params(config_file: ::String, config: T::Hash[T.untyped, T.untyped]).void }
629
+ def validate_config!(config_file, config); end
630
+
631
+ sig do
632
+ params(
633
+ command_options: T::Hash[::Symbol, ::Thor::Option],
634
+ config_key: ::String,
635
+ config_options: T::Hash[T.untyped, T.untyped]
636
+ ).returns(T::Array[::Tapioca::ConfigHelper::ConfigError])
637
+ end
638
+ def validate_config_options(command_options, config_key, config_options); end
639
+ end
640
+
641
+ class Tapioca::ConfigHelper::ConfigError < ::T::Struct
642
+ const :message_parts, T::Array[::Tapioca::ConfigHelper::ConfigErrorMessagePart]
643
+
644
+ class << self
645
+ def inherited(s); end
646
+ end
647
+ end
648
+
649
+ class Tapioca::ConfigHelper::ConfigErrorMessagePart < ::T::Struct
650
+ const :colors, T::Array[::Symbol]
651
+ const :message, ::String
652
+
653
+ class << self
654
+ def inherited(s); end
655
+ end
656
+ end
657
+
658
+ Tapioca::DEFAULT_ANNOTATIONS_DIR = T.let(T.unsafe(nil), String)
659
+ Tapioca::DEFAULT_DSL_DIR = T.let(T.unsafe(nil), String)
660
+ Tapioca::DEFAULT_GEM_DIR = T.let(T.unsafe(nil), String)
661
+ Tapioca::DEFAULT_OVERRIDES = T.let(T.unsafe(nil), Hash)
662
+ Tapioca::DEFAULT_POSTREQUIRE_FILE = T.let(T.unsafe(nil), String)
663
+ Tapioca::DEFAULT_RBI_DIR = T.let(T.unsafe(nil), String)
664
+ Tapioca::DEFAULT_RBI_FORMATTER = T.let(T.unsafe(nil), Tapioca::RBIFormatter)
665
+ Tapioca::DEFAULT_SHIM_DIR = T.let(T.unsafe(nil), String)
666
+ Tapioca::DEFAULT_TODO_FILE = T.let(T.unsafe(nil), String)
667
+ module Tapioca::Dsl; end
668
+
669
+ # @abstract It cannont be directly instantiated. Subclasses must implement the `abstract` methods below.
670
+ class Tapioca::Dsl::Compiler
671
+ extend T::Generic
672
+ include ::Tapioca::Runtime::Reflection
673
+ include ::Tapioca::SignaturesHelper
674
+ include ::Tapioca::Dsl::Helpers::ParamHelper
675
+ extend ::Tapioca::Runtime::Reflection
676
+
677
+ abstract!
678
+
679
+ ConstantType = type_member { { upper: Module } }
680
+
681
+ sig { params(pipeline: ::Tapioca::Dsl::Pipeline, root: ::RBI::Tree, constant: ConstantType).void }
682
+ def initialize(pipeline, root, constant); end
683
+
684
+ # NOTE: This should eventually accept an `Error` object or `Exception` rather than simply a `String`.
685
+ sig { params(error: ::String).void }
686
+ def add_error(error); end
687
+
688
+ sig { params(compiler_name: ::String).returns(T::Boolean) }
689
+ def compiler_enabled?(compiler_name); end
690
+
691
+ sig { returns(ConstantType) }
692
+ def constant; end
693
+
694
+ # @abstract
695
+ sig { abstract.void }
696
+ def decorate; end
697
+
698
+ sig { returns(::RBI::Tree) }
699
+ def root; end
700
+
701
+ private
702
+
703
+ sig { params(type: ::String).returns(::String) }
704
+ def as_nilable_type(type); end
705
+
706
+ sig { params(method_def: T.any(::Method, ::UnboundMethod)).returns(T::Array[::RBI::TypedParam]) }
707
+ def compile_method_parameters_to_rbi(method_def); end
708
+
709
+ sig { params(method_def: T.any(::Method, ::UnboundMethod)).returns(::String) }
710
+ def compile_method_return_type_to_rbi(method_def); end
711
+
712
+ sig { params(scope: ::RBI::Scope, method_def: T.any(::Method, ::UnboundMethod), class_method: T::Boolean).void }
713
+ def create_method_from_def(scope, method_def, class_method: T.unsafe(nil)); end
714
+
715
+ # Get the types of each parameter from a method signature
716
+ sig { params(method_def: T.any(::Method, ::UnboundMethod), signature: T.untyped).returns(T::Array[::String]) }
717
+ def parameters_types_from_signature(method_def, signature); end
718
+
719
+ sig { params(name: ::String).returns(T::Boolean) }
720
+ def valid_parameter_name?(name); end
721
+
722
+ class << self
723
+ # @abstract
724
+ sig { abstract.returns(T::Enumerable[::Module]) }
725
+ def gather_constants; end
726
+
727
+ sig { params(constant: ::Module).returns(T::Boolean) }
728
+ def handles?(constant); end
729
+
730
+ sig { returns(T::Set[::Module]) }
731
+ def processable_constants; end
732
+
733
+ private
734
+
735
+ sig { returns(T::Enumerable[::Class]) }
736
+ def all_classes; end
737
+
738
+ sig { returns(T::Enumerable[::Module]) }
739
+ def all_modules; end
740
+ end
741
+ end
742
+
743
+ module Tapioca::Dsl::Compilers; end
744
+ Tapioca::Dsl::Compilers::DIRECTORY = T.let(T.unsafe(nil), String)
745
+
746
+ # DSL compilers are either built-in to Tapioca and live under the
747
+ # `Tapioca::Dsl::Compilers` namespace (i.e. this namespace), and
748
+ # can be referred to by just using the class name, or they live in
749
+ # a different namespace and can only be referred to using their fully
750
+ # qualified name. This constant encapsulates that dual lookup when
751
+ # a compiler needs to be resolved by name.
752
+ Tapioca::Dsl::Compilers::NAMESPACES = T.let(T.unsafe(nil), Array)
753
+
754
+ module Tapioca::Dsl::Helpers; end
755
+
756
+ module Tapioca::Dsl::Helpers::ParamHelper
757
+ include ::Tapioca::SignaturesHelper
758
+
759
+ sig { params(name: ::String, type: ::String).returns(::RBI::TypedParam) }
760
+ def create_block_param(name, type:); end
761
+
762
+ sig { params(name: ::String, type: ::String, default: ::String).returns(::RBI::TypedParam) }
763
+ def create_kw_opt_param(name, type:, default:); end
764
+
765
+ sig { params(name: ::String, type: ::String).returns(::RBI::TypedParam) }
766
+ def create_kw_param(name, type:); end
767
+
768
+ sig { params(name: ::String, type: ::String).returns(::RBI::TypedParam) }
769
+ def create_kw_rest_param(name, type:); end
770
+
771
+ sig { params(name: ::String, type: ::String, default: ::String).returns(::RBI::TypedParam) }
772
+ def create_opt_param(name, type:, default:); end
773
+
774
+ sig { params(name: ::String, type: ::String).returns(::RBI::TypedParam) }
775
+ def create_param(name, type:); end
776
+
777
+ sig { params(name: ::String, type: ::String).returns(::RBI::TypedParam) }
778
+ def create_rest_param(name, type:); end
779
+
780
+ sig { params(param: ::RBI::Param, type: ::String).returns(::RBI::TypedParam) }
781
+ def create_typed_param(param, type); end
782
+ end
783
+
784
+ class Tapioca::Dsl::Pipeline
785
+ sig do
786
+ params(
787
+ requested_constants: T::Array[::Module],
788
+ requested_compilers: T::Array[T.class_of(Tapioca::Dsl::Compiler)],
789
+ excluded_compilers: T::Array[T.class_of(Tapioca::Dsl::Compiler)],
790
+ error_handler: T.proc.params(error: ::String).void,
791
+ number_of_workers: T.nilable(::Integer)
792
+ ).void
793
+ end
794
+ def initialize(requested_constants:, requested_compilers: T.unsafe(nil), excluded_compilers: T.unsafe(nil), error_handler: T.unsafe(nil), number_of_workers: T.unsafe(nil)); end
795
+
796
+ sig { params(error: ::String).void }
797
+ def add_error(error); end
798
+
799
+ sig { params(compiler_name: ::String).returns(T::Boolean) }
800
+ def compiler_enabled?(compiler_name); end
801
+
802
+ sig { returns(T::Enumerable[T.class_of(Tapioca::Dsl::Compiler)]) }
803
+ def compilers; end
804
+
805
+ sig { returns(T.proc.params(error: ::String).void) }
806
+ def error_handler; end
807
+
808
+ sig { returns(T::Array[::String]) }
809
+ def errors; end
810
+
811
+ sig { returns(T::Array[::Module]) }
812
+ def requested_constants; end
813
+
814
+ sig do
815
+ type_parameters(:T)
816
+ .params(
817
+ blk: T.proc.params(constant: ::Module, rbi: ::RBI::File).returns(T.type_parameter(:T))
818
+ ).returns(T::Array[T.type_parameter(:T)])
819
+ end
820
+ def run(&blk); end
821
+
822
+ private
823
+
824
+ sig { params(constants: T::Set[::Module]).returns(T::Set[::Module]) }
825
+ def filter_anonymous_and_reloaded_constants(constants); end
826
+
827
+ sig do
828
+ params(
829
+ requested_compilers: T::Array[T.class_of(Tapioca::Dsl::Compiler)],
830
+ excluded_compilers: T::Array[T.class_of(Tapioca::Dsl::Compiler)]
831
+ ).returns(T::Enumerable[T.class_of(Tapioca::Dsl::Compiler)])
832
+ end
833
+ def gather_compilers(requested_compilers, excluded_compilers); end
834
+
835
+ sig { params(requested_constants: T::Array[::Module]).returns(T::Set[::Module]) }
836
+ def gather_constants(requested_constants); end
837
+
838
+ sig { params(constant: ::Module).returns(T.nilable(::RBI::File)) }
839
+ def rbi_for_constant(constant); end
840
+
841
+ sig { params(error: ::String).returns(T.noreturn) }
842
+ def report_error(error); end
843
+ end
844
+
845
+ class Tapioca::Error < ::StandardError; end
846
+
847
+ class Tapioca::Executor
848
+ sig { params(queue: T::Array[T.untyped], number_of_workers: T.nilable(::Integer)).void }
849
+ def initialize(queue, number_of_workers: T.unsafe(nil)); end
850
+
851
+ sig do
852
+ type_parameters(:T)
853
+ .params(
854
+ block: T.proc.params(item: T.untyped).returns(T.type_parameter(:T))
855
+ ).returns(T::Array[T.type_parameter(:T)])
856
+ end
857
+ def run_in_parallel(&block); end
858
+ end
859
+
860
+ Tapioca::Executor::MINIMUM_ITEMS_PER_WORKER = T.let(T.unsafe(nil), Integer)
861
+ module Tapioca::Gem; end
862
+
863
+ class Tapioca::Gem::ConstNodeAdded < ::Tapioca::Gem::NodeAdded
864
+ sig { params(symbol: ::String, constant: ::Module, node: ::RBI::Const).void }
865
+ def initialize(symbol, constant, node); end
866
+
867
+ sig { returns(::RBI::Const) }
868
+ def node; end
869
+ end
870
+
871
+ class Tapioca::Gem::ConstantFound < ::Tapioca::Gem::Event
872
+ sig { params(symbol: ::String, constant: ::BasicObject).void }
873
+ def initialize(symbol, constant); end
874
+
875
+ sig { returns(::BasicObject) }
876
+ def constant; end
877
+
878
+ sig { returns(::String) }
879
+ def symbol; end
880
+ end
881
+
882
+ # @abstract It cannont be directly instantiated. Subclasses must implement the `abstract` methods below.
883
+ class Tapioca::Gem::Event
884
+ abstract!
885
+
886
+ def initialize(*args, &blk); end
887
+ end
888
+
889
+ module Tapioca::Gem::Listeners; end
890
+
891
+ # @abstract It cannont be directly instantiated. Subclasses must implement the `abstract` methods below.
892
+ class Tapioca::Gem::Listeners::Base
893
+ abstract!
894
+
895
+ sig { params(pipeline: ::Tapioca::Gem::Pipeline).void }
896
+ def initialize(pipeline); end
897
+
898
+ sig { params(event: ::Tapioca::Gem::NodeAdded).void }
899
+ def dispatch(event); end
900
+
901
+ private
902
+
903
+ sig { params(event: ::Tapioca::Gem::ConstNodeAdded).void }
904
+ def on_const(event); end
905
+
906
+ sig { params(event: ::Tapioca::Gem::MethodNodeAdded).void }
907
+ def on_method(event); end
908
+
909
+ sig { params(event: ::Tapioca::Gem::ScopeNodeAdded).void }
910
+ def on_scope(event); end
911
+ end
912
+
913
+ class Tapioca::Gem::Listeners::DynamicMixins < ::Tapioca::Gem::Listeners::Base
914
+ include ::Tapioca::Runtime::Reflection
915
+
916
+ private
917
+
918
+ sig { override.params(event: ::Tapioca::Gem::ScopeNodeAdded).void }
919
+ def on_scope(event); end
920
+ end
921
+
922
+ class Tapioca::Gem::Listeners::Methods < ::Tapioca::Gem::Listeners::Base
923
+ include ::Tapioca::Runtime::Reflection
924
+
925
+ private
926
+
927
+ sig { params(tree: ::RBI::Tree, module_name: ::String, mod: ::Module, for_visibility: T::Array[::Symbol]).void }
928
+ def compile_directly_owned_methods(tree, module_name, mod, for_visibility = T.unsafe(nil)); end
929
+
930
+ sig do
931
+ params(
932
+ tree: ::RBI::Tree,
933
+ symbol_name: ::String,
934
+ constant: ::Module,
935
+ method: T.nilable(::UnboundMethod),
936
+ visibility: ::RBI::Visibility
937
+ ).void
938
+ end
939
+ def compile_method(tree, symbol_name, constant, method, visibility = T.unsafe(nil)); end
940
+
941
+ sig { params(constant: ::Module).returns(T.nilable(::UnboundMethod)) }
942
+ def initialize_method_for(constant); end
943
+
944
+ sig { params(mod: ::Module).returns(T::Hash[::Symbol, T::Array[::Symbol]]) }
945
+ def method_names_by_visibility(mod); end
946
+
947
+ # Check whether the method is defined by the constant.
948
+ #
949
+ # In most cases, it works to check that the constant is the method owner. However,
950
+ # in the case that a method is also defined in a module prepended to the constant, it
951
+ # will be owned by the prepended module, not the constant.
952
+ #
953
+ # This method implements a better way of checking whether a constant defines a method.
954
+ # It walks up the ancestor tree via the `super_method` method; if any of the super
955
+ # methods are owned by the constant, it means that the constant declares the method.
956
+ sig { params(method: ::UnboundMethod, constant: ::Module).returns(T::Boolean) }
957
+ def method_owned_by_constant?(method, constant); end
958
+
959
+ sig { override.params(event: ::Tapioca::Gem::ScopeNodeAdded).void }
960
+ def on_scope(event); end
961
+
962
+ sig { params(constant: ::Module, method_name: ::String).returns(T::Boolean) }
963
+ def struct_method?(constant, method_name); end
964
+
965
+ sig { params(name: ::String).returns(T::Boolean) }
966
+ def valid_method_name?(name); end
967
+
968
+ sig { params(name: ::String).returns(T::Boolean) }
969
+ def valid_parameter_name?(name); end
970
+ end
971
+
972
+ Tapioca::Gem::Listeners::Methods::SPECIAL_METHOD_NAMES = T.let(T.unsafe(nil), Array)
973
+
974
+ class Tapioca::Gem::Listeners::Mixins < ::Tapioca::Gem::Listeners::Base
975
+ include ::Tapioca::Runtime::Reflection
976
+
977
+ private
978
+
979
+ sig do
980
+ params(
981
+ tree: ::RBI::Tree,
982
+ mods: T::Array[::Module],
983
+ mixin_type: ::Tapioca::Runtime::Trackers::Mixin::Type
984
+ ).void
985
+ end
986
+ def add_mixins(tree, mods, mixin_type); end
987
+
988
+ sig { params(mixin_name: ::String).returns(T::Boolean) }
989
+ def filtered_mixin?(mixin_name); end
990
+
991
+ sig { params(constant: ::Module).returns(T::Array[::Module]) }
992
+ def interesting_ancestors_of(constant); end
993
+
994
+ sig { override.params(event: ::Tapioca::Gem::ScopeNodeAdded).void }
995
+ def on_scope(event); end
996
+ end
997
+
998
+ class Tapioca::Gem::Listeners::RemoveEmptyPayloadScopes < ::Tapioca::Gem::Listeners::Base
999
+ include ::Tapioca::Runtime::Reflection
1000
+
1001
+ private
1002
+
1003
+ sig { override.params(event: ::Tapioca::Gem::ScopeNodeAdded).void }
1004
+ def on_scope(event); end
1005
+ end
1006
+
1007
+ class Tapioca::Gem::Listeners::SorbetEnums < ::Tapioca::Gem::Listeners::Base
1008
+ private
1009
+
1010
+ sig { override.params(event: ::Tapioca::Gem::ScopeNodeAdded).void }
1011
+ def on_scope(event); end
1012
+ end
1013
+
1014
+ class Tapioca::Gem::Listeners::SorbetHelpers < ::Tapioca::Gem::Listeners::Base
1015
+ include ::Tapioca::Runtime::Reflection
1016
+
1017
+ private
1018
+
1019
+ sig { override.params(event: ::Tapioca::Gem::ScopeNodeAdded).void }
1020
+ def on_scope(event); end
1021
+ end
1022
+
1023
+ class Tapioca::Gem::Listeners::SorbetProps < ::Tapioca::Gem::Listeners::Base
1024
+ private
1025
+
1026
+ sig { override.params(event: ::Tapioca::Gem::ScopeNodeAdded).void }
1027
+ def on_scope(event); end
1028
+ end
1029
+
1030
+ class Tapioca::Gem::Listeners::SorbetRequiredAncestors < ::Tapioca::Gem::Listeners::Base
1031
+ private
1032
+
1033
+ sig { override.params(event: ::Tapioca::Gem::ScopeNodeAdded).void }
1034
+ def on_scope(event); end
1035
+ end
1036
+
1037
+ class Tapioca::Gem::Listeners::SorbetSignatures < ::Tapioca::Gem::Listeners::Base
1038
+ include ::Tapioca::Runtime::Reflection
1039
+ include ::Tapioca::SignaturesHelper
1040
+
1041
+ private
1042
+
1043
+ sig { params(signature: T.untyped, parameters: T::Array[[::Symbol, ::String]]).returns(::RBI::Sig) }
1044
+ def compile_signature(signature, parameters); end
1045
+
1046
+ sig { override.params(event: ::Tapioca::Gem::MethodNodeAdded).void }
1047
+ def on_method(event); end
1048
+
1049
+ sig { params(signature: T.untyped).returns(T::Boolean) }
1050
+ def signature_final?(signature); end
1051
+ end
1052
+
1053
+ Tapioca::Gem::Listeners::SorbetSignatures::TYPE_PARAMETER_MATCHER = T.let(T.unsafe(nil), Regexp)
1054
+
1055
+ class Tapioca::Gem::Listeners::SorbetTypeVariables < ::Tapioca::Gem::Listeners::Base
1056
+ include ::Tapioca::Runtime::Reflection
1057
+
1058
+ private
1059
+
1060
+ sig { params(tree: ::RBI::Tree, constant: ::Module).void }
1061
+ def compile_type_variable_declarations(tree, constant); end
1062
+
1063
+ sig { override.params(event: ::Tapioca::Gem::ScopeNodeAdded).void }
1064
+ def on_scope(event); end
1065
+ end
1066
+
1067
+ class Tapioca::Gem::Listeners::Subconstants < ::Tapioca::Gem::Listeners::Base
1068
+ include ::Tapioca::Runtime::Reflection
1069
+
1070
+ private
1071
+
1072
+ sig { override.params(event: ::Tapioca::Gem::ScopeNodeAdded).void }
1073
+ def on_scope(event); end
1074
+ end
1075
+
1076
+ class Tapioca::Gem::Listeners::YardDoc < ::Tapioca::Gem::Listeners::Base
1077
+ sig { params(pipeline: ::Tapioca::Gem::Pipeline).void }
1078
+ def initialize(pipeline); end
1079
+
1080
+ private
1081
+
1082
+ sig { params(name: ::String, sigs: T::Array[::RBI::Sig]).returns(T::Array[::RBI::Comment]) }
1083
+ def documentation_comments(name, sigs: T.unsafe(nil)); end
1084
+
1085
+ sig { override.params(event: ::Tapioca::Gem::ConstNodeAdded).void }
1086
+ def on_const(event); end
1087
+
1088
+ sig { override.params(event: ::Tapioca::Gem::MethodNodeAdded).void }
1089
+ def on_method(event); end
1090
+
1091
+ sig { override.params(event: ::Tapioca::Gem::ScopeNodeAdded).void }
1092
+ def on_scope(event); end
1093
+ end
1094
+
1095
+ Tapioca::Gem::Listeners::YardDoc::IGNORED_COMMENTS = T.let(T.unsafe(nil), Array)
1096
+ Tapioca::Gem::Listeners::YardDoc::IGNORED_SIG_TAGS = T.let(T.unsafe(nil), Array)
1097
+
1098
+ class Tapioca::Gem::MethodNodeAdded < ::Tapioca::Gem::NodeAdded
1099
+ sig do
1100
+ params(
1101
+ symbol: ::String,
1102
+ constant: ::Module,
1103
+ node: ::RBI::Method,
1104
+ signature: T.untyped,
1105
+ parameters: T::Array[[::Symbol, ::String]]
1106
+ ).void
1107
+ end
1108
+ def initialize(symbol, constant, node, signature, parameters); end
1109
+
1110
+ sig { returns(::RBI::Method) }
1111
+ def node; end
1112
+
1113
+ sig { returns(T::Array[[::Symbol, ::String]]) }
1114
+ def parameters; end
1115
+
1116
+ sig { returns(T.untyped) }
1117
+ def signature; end
1118
+ end
1119
+
1120
+ # @abstract It cannont be directly instantiated. Subclasses must implement the `abstract` methods below.
1121
+ class Tapioca::Gem::NodeAdded < ::Tapioca::Gem::Event
1122
+ abstract!
1123
+
1124
+ sig { params(symbol: ::String, constant: ::Module).void }
1125
+ def initialize(symbol, constant); end
1126
+
1127
+ sig { returns(::Module) }
1128
+ def constant; end
1129
+
1130
+ sig { returns(::String) }
1131
+ def symbol; end
1132
+ end
1133
+
1134
+ class Tapioca::Gem::Pipeline
1135
+ include ::Tapioca::Runtime::Reflection
1136
+ include ::Tapioca::SignaturesHelper
1137
+
1138
+ sig { params(gem: ::Tapioca::Gemfile::GemSpec, include_doc: T::Boolean).void }
1139
+ def initialize(gem, include_doc: T.unsafe(nil)); end
1140
+
1141
+ sig { returns(::RBI::Tree) }
1142
+ def compile; end
1143
+
1144
+ sig { returns(::Tapioca::Gemfile::GemSpec) }
1145
+ def gem; end
1146
+
1147
+ sig { params(method: ::UnboundMethod).returns(T::Boolean) }
1148
+ def method_in_gem?(method); end
1149
+
1150
+ sig { params(constant: ::Module).returns(T.nilable(::String)) }
1151
+ def name_of(constant); end
1152
+
1153
+ sig { params(symbol: ::String, constant: ::Module, node: ::RBI::Const).void }
1154
+ def push_const(symbol, constant, node); end
1155
+
1156
+ sig { params(symbol: ::String, constant: ::BasicObject).void }
1157
+ def push_constant(symbol, constant); end
1158
+
1159
+ sig do
1160
+ params(
1161
+ symbol: ::String,
1162
+ constant: ::Module,
1163
+ node: ::RBI::Method,
1164
+ signature: T.untyped,
1165
+ parameters: T::Array[[::Symbol, ::String]]
1166
+ ).void
1167
+ end
1168
+ def push_method(symbol, constant, node, signature, parameters); end
1169
+
1170
+ sig { params(symbol: ::String, constant: ::Module, node: ::RBI::Scope).void }
1171
+ def push_scope(symbol, constant, node); end
1172
+
1173
+ sig { params(symbol: ::String).void }
1174
+ def push_symbol(symbol); end
1175
+
1176
+ sig { params(symbol_name: ::String).returns(T::Boolean) }
1177
+ def symbol_in_payload?(symbol_name); end
1178
+
1179
+ private
1180
+
1181
+ sig { params(name: ::String).void }
1182
+ def add_to_alias_namespace(name); end
1183
+
1184
+ sig { params(name: ::String).returns(T::Boolean) }
1185
+ def alias_namespaced?(name); end
1186
+
1187
+ sig { params(name: ::String, constant: ::Module).void }
1188
+ def compile_alias(name, constant); end
1189
+
1190
+ # Compile
1191
+ sig { params(symbol: ::String, constant: ::BasicObject).void }
1192
+ def compile_constant(symbol, constant); end
1193
+
1194
+ sig { params(name: ::String, constant: ::Module).void }
1195
+ def compile_module(name, constant); end
1196
+
1197
+ sig { params(name: ::String, value: ::BasicObject).void }
1198
+ def compile_object(name, value); end
1199
+
1200
+ sig { params(constant: ::Class).returns(T.nilable(::String)) }
1201
+ def compile_superclass(constant); end
1202
+
1203
+ sig { params(constant: ::Module, strict: T::Boolean).returns(T::Boolean) }
1204
+ def defined_in_gem?(constant, strict: T.unsafe(nil)); end
1205
+
1206
+ sig { params(event: ::Tapioca::Gem::Event).void }
1207
+ def dispatch(event); end
1208
+
1209
+ sig { params(constant: T.all(::Module, ::T::Generic)).returns(::String) }
1210
+ def generic_name_of(constant); end
1211
+
1212
+ sig { params(constant: ::Module).returns(T::Array[::String]) }
1213
+ def get_file_candidates(constant); end
1214
+
1215
+ sig { params(name: ::String).void }
1216
+ def mark_seen(name); end
1217
+
1218
+ sig { params(constant: ::Module, class_name: T.nilable(::String)).returns(T.nilable(::String)) }
1219
+ def name_of_proxy_target(constant, class_name); end
1220
+
1221
+ sig { returns(::Tapioca::Gem::Event) }
1222
+ def next_event; end
1223
+
1224
+ sig { params(event: ::Tapioca::Gem::ConstantFound).void }
1225
+ def on_constant(event); end
1226
+
1227
+ sig { params(event: ::Tapioca::Gem::NodeAdded).void }
1228
+ def on_node(event); end
1229
+
1230
+ sig { params(event: ::Tapioca::Gem::SymbolFound).void }
1231
+ def on_symbol(event); end
1232
+
1233
+ sig { params(name: ::String).returns(T::Boolean) }
1234
+ def seen?(name); end
1235
+ end
1236
+
1237
+ Tapioca::Gem::Pipeline::IGNORED_SYMBOLS = T.let(T.unsafe(nil), Array)
1238
+
1239
+ class Tapioca::Gem::ScopeNodeAdded < ::Tapioca::Gem::NodeAdded
1240
+ sig { params(symbol: ::String, constant: ::Module, node: ::RBI::Scope).void }
1241
+ def initialize(symbol, constant, node); end
1242
+
1243
+ sig { returns(::RBI::Scope) }
1244
+ def node; end
1245
+ end
1246
+
1247
+ class Tapioca::Gem::SymbolFound < ::Tapioca::Gem::Event
1248
+ sig { params(symbol: ::String).void }
1249
+ def initialize(symbol); end
1250
+
1251
+ sig { returns(::String) }
1252
+ def symbol; end
1253
+ end
1254
+
1255
+ module Tapioca::GemHelper
1256
+ sig { params(gemfile_dir: ::String, full_gem_path: ::String).returns(T::Boolean) }
1257
+ def gem_in_app_dir?(gemfile_dir, full_gem_path); end
1258
+
1259
+ sig { params(full_gem_path: ::String).returns(T::Boolean) }
1260
+ def gem_in_bundle_path?(full_gem_path); end
1261
+
1262
+ sig { params(path: T.any(::Pathname, ::String)).returns(::String) }
1263
+ def to_realpath(path); end
1264
+ end
1265
+
1266
+ class Tapioca::Gemfile
1267
+ sig { params(exclude: T::Array[::String]).void }
1268
+ def initialize(exclude); end
1269
+
1270
+ sig { returns(::Bundler::Definition) }
1271
+ def definition; end
1272
+
1273
+ sig { returns(T::Array[::Tapioca::Gemfile::GemSpec]) }
1274
+ def dependencies; end
1275
+
1276
+ sig { params(gem_name: ::String).returns(T.nilable(::Tapioca::Gemfile::GemSpec)) }
1277
+ def gem(gem_name); end
1278
+
1279
+ sig { returns(T::Array[::String]) }
1280
+ def missing_specs; end
1281
+
1282
+ sig { void }
1283
+ def require_bundle; end
1284
+
1285
+ private
1286
+
1287
+ sig { returns(::String) }
1288
+ def dir; end
1289
+
1290
+ sig { returns(::File) }
1291
+ def gemfile; end
1292
+
1293
+ sig { returns(T::Array[::Symbol]) }
1294
+ def groups; end
1295
+
1296
+ sig { returns([T::Array[::Tapioca::Gemfile::GemSpec], T::Array[::String]]) }
1297
+ def load_dependencies; end
1298
+
1299
+ # @return [File]
1300
+ def lockfile; end
1301
+
1302
+ sig { returns([T::Enumerable[T.any(::Bundler::StubSpecification, ::Gem::Specification)], T::Array[::String]]) }
1303
+ def materialize_deps; end
1304
+
1305
+ sig { returns(::Bundler::Runtime) }
1306
+ def runtime; end
1307
+ end
1308
+
1309
+ # This is a module that gets prepended to `Bundler::Dependency` and
1310
+ # makes sure even gems marked as `require: false` are required during
1311
+ # `Bundler.require`.
1312
+ module Tapioca::Gemfile::AutoRequireHook
1313
+ requires_ancestor { Bundler::Dependency }
1314
+
1315
+ sig { returns(T.untyped) }
1316
+ def autorequire; end
1317
+
1318
+ class << self
1319
+ sig { params(exclude: T::Array[::String]).returns(T::Array[::String]) }
1320
+ def exclude=(exclude); end
1321
+
1322
+ sig { params(name: T.untyped).returns(T::Boolean) }
1323
+ def excluded?(name); end
1324
+ end
1325
+ end
1326
+
1327
+ class Tapioca::Gemfile::GemSpec
1328
+ include ::Tapioca::GemHelper
1329
+
1330
+ sig { params(spec: T.any(::Bundler::StubSpecification, ::Gem::Specification)).void }
1331
+ def initialize(spec); end
1332
+
1333
+ sig { params(path: ::String).returns(T::Boolean) }
1334
+ def contains_path?(path); end
1335
+
1336
+ sig { returns(T::Boolean) }
1337
+ def export_rbi_files?; end
1338
+
1339
+ sig { returns(T::Array[::String]) }
1340
+ def exported_rbi_files; end
1341
+
1342
+ sig { returns(::RBI::MergeTree) }
1343
+ def exported_rbi_tree; end
1344
+
1345
+ sig { returns(T::Array[::Pathname]) }
1346
+ def files; end
1347
+
1348
+ sig { returns(::String) }
1349
+ def full_gem_path; end
1350
+
1351
+ sig { params(gemfile_dir: ::String).returns(T::Boolean) }
1352
+ def ignore?(gemfile_dir); end
1353
+
1354
+ sig { returns(::String) }
1355
+ def name; end
1356
+
1357
+ sig { void }
1358
+ def parse_yard_docs; end
1359
+
1360
+ sig { returns(::String) }
1361
+ def rbi_file_name; end
1362
+
1363
+ # @return [String]
1364
+ def version; end
1365
+
1366
+ private
1367
+
1368
+ sig { returns(T::Array[::Pathname]) }
1369
+ def collect_files; end
1370
+
1371
+ sig { returns(T.nilable(T::Boolean)) }
1372
+ def default_gem?; end
1373
+
1374
+ sig { returns(T::Boolean) }
1375
+ def gem_ignored?; end
1376
+
1377
+ sig { params(path: ::String).returns(T::Boolean) }
1378
+ def has_parent_gemspec?(path); end
1379
+
1380
+ sig { returns(::Regexp) }
1381
+ def require_paths_prefix_matcher; end
1382
+
1383
+ sig { params(file: ::String).returns(::Pathname) }
1384
+ def resolve_to_ruby_lib_dir(file); end
1385
+
1386
+ sig { returns(::String) }
1387
+ def version_string; end
1388
+ end
1389
+
1390
+ Tapioca::Gemfile::GemSpec::IGNORED_GEMS = T.let(T.unsafe(nil), Array)
1391
+ Tapioca::Gemfile::Spec = T.type_alias { T.any(::Bundler::StubSpecification, ::Gem::Specification) }
1392
+
1393
+ class Tapioca::RBIFormatter < ::RBI::Formatter
1394
+ sig { params(file: ::RBI::File).void }
1395
+ def write_empty_body_comment!(file); end
1396
+
1397
+ sig { params(file: ::RBI::File, command: ::String, reason: T.nilable(::String)).void }
1398
+ def write_header!(file, command, reason: T.unsafe(nil)); end
1399
+ end
1400
+
1401
+ module Tapioca::RBIHelper
1402
+ requires_ancestor { Tapioca::SorbetHelper }
1403
+ requires_ancestor { Thor::Shell }
1404
+
1405
+ sig do
1406
+ params(
1407
+ command: ::String,
1408
+ gem_dir: ::String,
1409
+ dsl_dir: ::String,
1410
+ auto_strictness: T::Boolean,
1411
+ gems: T::Array[::Tapioca::Gemfile::GemSpec],
1412
+ compilers: T::Enumerable[::Class]
1413
+ ).void
1414
+ end
1415
+ def validate_rbi_files(command:, gem_dir:, dsl_dir:, auto_strictness:, gems: T.unsafe(nil), compilers: T.unsafe(nil)); end
1416
+
1417
+ private
1418
+
1419
+ sig { params(path: ::String).returns(::String) }
1420
+ def gem_name_from_rbi_path(path); end
1421
+
1422
+ sig { params(errors: T::Array[::Spoom::Sorbet::Errors::Error], gem_dir: ::String).void }
1423
+ def update_gem_rbis_strictnesses(errors, gem_dir); end
1424
+ end
1425
+
1426
+ class Tapioca::RepoIndex
1427
+ sig { void }
1428
+ def initialize; end
1429
+
1430
+ sig { params(gem_name: ::String).void }
1431
+ def <<(gem_name); end
1432
+
1433
+ sig { returns(T::Enumerable[::String]) }
1434
+ def gems; end
1435
+
1436
+ sig { params(gem_name: ::String).returns(T::Boolean) }
1437
+ def has_gem?(gem_name); end
1438
+
1439
+ class << self
1440
+ sig { params(hash: T::Hash[::String, T::Hash[T.untyped, T.untyped]]).returns(Tapioca::RepoIndex) }
1441
+ def from_hash(hash); end
1442
+
1443
+ sig { params(json: ::String).returns(Tapioca::RepoIndex) }
1444
+ def from_json(json); end
1445
+ end
1446
+ end
1447
+
1448
+ module Tapioca::Runtime; end
1449
+
1450
+ class Tapioca::Runtime::DynamicMixinCompiler
1451
+ include ::Tapioca::Runtime::Reflection
1452
+
1453
+ sig { params(constant: ::Module).void }
1454
+ def initialize(constant); end
1455
+
1456
+ # @return [Array<Symbol>]
1457
+ def class_attribute_predicates; end
1458
+
1459
+ sig { returns(T::Array[::Symbol]) }
1460
+ def class_attribute_readers; end
1461
+
1462
+ # @return [Array<Symbol>]
1463
+ def class_attribute_writers; end
1464
+
1465
+ sig { params(tree: ::RBI::Tree).void }
1466
+ def compile_class_attributes(tree); end
1467
+
1468
+ sig { params(tree: ::RBI::Tree).returns([T::Array[::Module], T::Array[::Module]]) }
1469
+ def compile_mixes_in_class_methods(tree); end
1470
+
1471
+ sig { returns(T::Array[::Module]) }
1472
+ def dynamic_extends; end
1473
+
1474
+ # @return [Array<Module>]
1475
+ def dynamic_includes; end
1476
+
1477
+ sig { returns(T::Boolean) }
1478
+ def empty_attributes?; end
1479
+
1480
+ sig { params(qualified_mixin_name: ::String).returns(T::Boolean) }
1481
+ def filtered_mixin?(qualified_mixin_name); end
1482
+
1483
+ # @return [Array<Symbol>]
1484
+ def instance_attribute_predicates; end
1485
+
1486
+ sig { returns(T::Array[::Symbol]) }
1487
+ def instance_attribute_readers; end
1488
+
1489
+ # @return [Array<Symbol>]
1490
+ def instance_attribute_writers; end
1491
+
1492
+ sig { params(mod: ::Module, dynamic_extends: T::Array[::Module]).returns(T::Boolean) }
1493
+ def module_included_by_another_dynamic_extend?(mod, dynamic_extends); end
1494
+ end
1495
+
1496
+ # This class is responsible for storing and looking up information related to generic types.
1497
+ #
1498
+ # The class stores 2 different kinds of data, in two separate lookup tables:
1499
+ # 1. a lookup of generic type instances by name: `@generic_instances`
1500
+ # 2. a lookup of type variable serializer by constant and type variable
1501
+ # instance: `@type_variables`
1502
+ #
1503
+ # By storing the above data, we can cheaply query each constant against this registry
1504
+ # to see if it declares any generic type variables. This becomes a simple lookup in the
1505
+ # `@type_variables` hash table with the given constant.
1506
+ #
1507
+ # If there is no entry, then we can cheaply know that we can skip generic type
1508
+ # information generation for this type.
1509
+ #
1510
+ # On the other hand, if we get a result, then the result will be a hash of type
1511
+ # variable to type variable serializers. This allows us to associate type variables
1512
+ # to the constant names that represent them, easily.
1513
+ module Tapioca::Runtime::GenericTypeRegistry
1514
+ class << self
1515
+ sig { params(instance: ::Object).returns(T::Boolean) }
1516
+ def generic_type_instance?(instance); end
1517
+
1518
+ sig { params(constant: ::Module).returns(T.nilable(T::Array[::Tapioca::TypeVariableModule])) }
1519
+ def lookup_type_variables(constant); end
1520
+
1521
+ # This method is responsible for building the name of the instantiated concrete type
1522
+ # and cloning the given constant so that we can return a type that is the same
1523
+ # as the current type but is a different instance and has a different name method.
1524
+ #
1525
+ # We cache those cloned instances by their name in `@generic_instances`, so that
1526
+ # we don't keep instantiating a new type every single time it is referenced.
1527
+ # For example, `[Foo[Integer], Foo[Integer], Foo[Integer], Foo[String]]` will only
1528
+ # result in 2 clones (1 for `Foo[Integer]` and another for `Foo[String]`) and
1529
+ # 2 hash lookups (for the other two `Foo[Integer]`s).
1530
+ #
1531
+ # This method returns the created or cached clone of the constant.
1532
+ sig { params(constant: T.untyped, types: T.untyped).returns(::Module) }
1533
+ def register_type(constant, types); end
1534
+
1535
+ # This method is called from intercepted calls to `type_member` and `type_template`.
1536
+ # We get passed all the arguments to those methods, as well as the `T::Types::TypeVariable`
1537
+ # instance generated by the Sorbet defined `type_member`/`type_template` call on `T::Generic`.
1538
+ #
1539
+ # This method creates a `String` with that data and stores it in the
1540
+ # `@type_variables` lookup table, keyed by the `constant` and `type_variable`.
1541
+ #
1542
+ # Finally, the original `type_variable` is returned from this method, so that the caller
1543
+ # can return it from the original methods as well.
1544
+ sig { params(constant: T.untyped, type_variable: ::Tapioca::TypeVariableModule).void }
1545
+ def register_type_variable(constant, type_variable); end
1546
+
1547
+ private
1548
+
1549
+ sig { params(constant: ::Module, name: ::String).returns(::Module) }
1550
+ def create_generic_type(constant, name); end
1551
+
1552
+ sig { params(constant: ::Class).returns(::Class) }
1553
+ def create_safe_subclass(constant); end
1554
+
1555
+ sig { params(constant: ::Module).returns(T::Array[::Tapioca::TypeVariableModule]) }
1556
+ def lookup_or_initialize_type_variables(constant); end
1557
+ end
1558
+ end
1559
+
1560
+ class Tapioca::Runtime::Loader
1561
+ include ::Tapioca::GemHelper
1562
+
1563
+ sig do
1564
+ params(
1565
+ gemfile: ::Tapioca::Gemfile,
1566
+ initialize_file: T.nilable(::String),
1567
+ require_file: T.nilable(::String)
1568
+ ).void
1569
+ end
1570
+ def load_bundle(gemfile, initialize_file, require_file); end
1571
+
1572
+ sig { params(environment_load: T::Boolean, eager_load: T::Boolean).void }
1573
+ def load_rails_application(environment_load: T.unsafe(nil), eager_load: T.unsafe(nil)); end
1574
+
1575
+ private
1576
+
1577
+ sig { void }
1578
+ def eager_load_rails_app; end
1579
+
1580
+ sig { void }
1581
+ def load_rails_engines; end
1582
+
1583
+ sig { returns(T::Array[T.untyped]) }
1584
+ def rails_engines; end
1585
+
1586
+ sig { params(file: T.nilable(::String)).void }
1587
+ def require_helper(file); end
1588
+
1589
+ sig { params(path: ::String).void }
1590
+ def safe_require(path); end
1591
+
1592
+ sig { void }
1593
+ def silence_deprecations; end
1594
+ end
1595
+
1596
+ module Tapioca::Runtime::Reflection
1597
+ extend ::Tapioca::Runtime::Reflection
1598
+
1599
+ sig { params(constant: ::Module).returns(T::Array[::Module]) }
1600
+ def ancestors_of(constant); end
1601
+
1602
+ sig { params(object: ::BasicObject, other: ::BasicObject).returns(T::Boolean) }
1603
+ def are_equal?(object, other); end
1604
+
1605
+ sig { params(object: ::BasicObject).returns(::Class) }
1606
+ def class_of(object); end
1607
+
1608
+ sig { params(symbol: ::String, inherit: T::Boolean, namespace: ::Module).returns(::BasicObject) }
1609
+ def constantize(symbol, inherit: T.unsafe(nil), namespace: T.unsafe(nil)); end
1610
+
1611
+ sig { params(constant: ::Module).returns(T::Array[::Symbol]) }
1612
+ def constants_of(constant); end
1613
+
1614
+ # Returns an array with all classes that are < than the supplied class.
1615
+ #
1616
+ # class C; end
1617
+ # descendants_of(C) # => []
1618
+ #
1619
+ # class B < C; end
1620
+ # descendants_of(C) # => [B]
1621
+ #
1622
+ # class A < B; end
1623
+ # descendants_of(C) # => [B, A]
1624
+ #
1625
+ # class D < C; end
1626
+ # descendants_of(C) # => [B, A, D]
1627
+ sig do
1628
+ type_parameters(:U)
1629
+ .params(
1630
+ klass: T.all(::Class, T.type_parameter(:U))
1631
+ ).returns(T::Array[T.type_parameter(:U)])
1632
+ end
1633
+ def descendants_of(klass); end
1634
+
1635
+ sig { params(constant: ::Module).returns(T::Array[::Module]) }
1636
+ def inherited_ancestors_of(constant); end
1637
+
1638
+ sig { params(constant: ::Module, method: ::Symbol).returns(::Method) }
1639
+ def method_of(constant, method); end
1640
+
1641
+ sig { params(constant: ::Module).returns(T.nilable(::String)) }
1642
+ def name_of(constant); end
1643
+
1644
+ sig { params(type: ::T::Types::Base).returns(::String) }
1645
+ def name_of_type(type); end
1646
+
1647
+ sig { params(object: ::BasicObject).returns(::Integer) }
1648
+ def object_id_of(object); end
1649
+
1650
+ sig { params(constant: ::Module).returns(T::Array[::Symbol]) }
1651
+ def private_instance_methods_of(constant); end
1652
+
1653
+ sig { params(constant: ::Module).returns(T::Array[::Symbol]) }
1654
+ def protected_instance_methods_of(constant); end
1655
+
1656
+ sig { params(constant: ::Module).returns(T::Array[::Symbol]) }
1657
+ def public_instance_methods_of(constant); end
1658
+
1659
+ sig { params(constant: ::Module).returns(T.nilable(::String)) }
1660
+ def qualified_name_of(constant); end
1661
+
1662
+ sig { params(method: T.any(::Method, ::UnboundMethod)).returns(T.untyped) }
1663
+ def signature_of(method); end
1664
+
1665
+ sig { params(constant: ::Module).returns(::Class) }
1666
+ def singleton_class_of(constant); end
1667
+
1668
+ sig { params(constant: ::Class).returns(T.nilable(::Class)) }
1669
+ def superclass_of(constant); end
1670
+ end
1671
+
1672
+ Tapioca::Runtime::Reflection::ANCESTORS_METHOD = T.let(T.unsafe(nil), UnboundMethod)
1673
+ Tapioca::Runtime::Reflection::CLASS_METHOD = T.let(T.unsafe(nil), UnboundMethod)
1674
+ Tapioca::Runtime::Reflection::CONSTANTS_METHOD = T.let(T.unsafe(nil), UnboundMethod)
1675
+ Tapioca::Runtime::Reflection::EQUAL_METHOD = T.let(T.unsafe(nil), UnboundMethod)
1676
+ Tapioca::Runtime::Reflection::METHOD_METHOD = T.let(T.unsafe(nil), UnboundMethod)
1677
+ Tapioca::Runtime::Reflection::NAME_METHOD = T.let(T.unsafe(nil), UnboundMethod)
1678
+ Tapioca::Runtime::Reflection::OBJECT_ID_METHOD = T.let(T.unsafe(nil), UnboundMethod)
1679
+ Tapioca::Runtime::Reflection::PRIVATE_INSTANCE_METHODS_METHOD = T.let(T.unsafe(nil), UnboundMethod)
1680
+ Tapioca::Runtime::Reflection::PROTECTED_INSTANCE_METHODS_METHOD = T.let(T.unsafe(nil), UnboundMethod)
1681
+ Tapioca::Runtime::Reflection::PUBLIC_INSTANCE_METHODS_METHOD = T.let(T.unsafe(nil), UnboundMethod)
1682
+ Tapioca::Runtime::Reflection::SINGLETON_CLASS_METHOD = T.let(T.unsafe(nil), UnboundMethod)
1683
+ Tapioca::Runtime::Reflection::SUPERCLASS_METHOD = T.let(T.unsafe(nil), UnboundMethod)
1684
+ module Tapioca::Runtime::Trackers; end
1685
+
1686
+ module Tapioca::Runtime::Trackers::Autoload
1687
+ class << self
1688
+ sig { void }
1689
+ def eager_load_all!; end
1690
+
1691
+ sig { params(constant_name: ::String).void }
1692
+ def register(constant_name); end
1693
+
1694
+ sig do
1695
+ type_parameters(:Result)
1696
+ .params(
1697
+ block: T.proc.returns(T.type_parameter(:Result))
1698
+ ).returns(T.type_parameter(:Result))
1699
+ end
1700
+ def with_disabled_exits(&block); end
1701
+ end
1702
+ end
1703
+
1704
+ Tapioca::Runtime::Trackers::Autoload::NOOP_METHOD = T.let(T.unsafe(nil), Proc)
1705
+
1706
+ # Registers a TracePoint immediately upon load to track points at which
1707
+ # classes and modules are opened for definition. This is used to track
1708
+ # correspondence between classes/modules and files, as this information isn't
1709
+ # available in the ruby runtime without extra accounting.
1710
+ module Tapioca::Runtime::Trackers::ConstantDefinition
1711
+ extend ::Tapioca::Runtime::Reflection
1712
+
1713
+ class << self
1714
+ # Returns the files in which this class or module was opened. Doesn't know
1715
+ # about situations where the class was opened prior to +require+ing,
1716
+ # or where metaprogramming was used via +eval+, etc.
1717
+ def files_for(klass); end
1718
+ end
1719
+ end
1720
+
1721
+ module Tapioca::Runtime::Trackers::Mixin
1722
+ class << self
1723
+ sig do
1724
+ params(
1725
+ constant: ::Module
1726
+ ).returns(T::Hash[::Tapioca::Runtime::Trackers::Mixin::Type, T::Hash[::Module, T::Array[::String]]])
1727
+ end
1728
+ def mixin_locations_for(constant); end
1729
+
1730
+ sig do
1731
+ params(
1732
+ constant: ::Module,
1733
+ mod: ::Module,
1734
+ mixin_type: ::Tapioca::Runtime::Trackers::Mixin::Type,
1735
+ locations: T.nilable(T::Array[::Thread::Backtrace::Location])
1736
+ ).void
1737
+ end
1738
+ def register(constant, mod, mixin_type, locations); end
1739
+ end
1740
+ end
1741
+
1742
+ class Tapioca::Runtime::Trackers::Mixin::Type < ::T::Enum
1743
+ enums do
1744
+ Prepend = new
1745
+ Include = new
1746
+ Extend = new
1747
+ end
1748
+ end
1749
+
1750
+ module Tapioca::Runtime::Trackers::RequiredAncestor
1751
+ class << self
1752
+ sig { params(requiring: ::T::Helpers, block: T.proc.returns(::Module)).void }
1753
+ def register(requiring, block); end
1754
+
1755
+ sig { params(mod: ::Module).returns(T::Array[T.proc.returns(::Module)]) }
1756
+ def required_ancestors_blocks_by(mod); end
1757
+
1758
+ sig { params(mod: ::Module).returns(T::Array[T.nilable(::Module)]) }
1759
+ def required_ancestors_by(mod); end
1760
+ end
1761
+ end
1762
+
1763
+ Tapioca::SORBET_CONFIG_FILE = T.let(T.unsafe(nil), String)
1764
+ Tapioca::SORBET_DIR = T.let(T.unsafe(nil), String)
1765
+
1766
+ module Tapioca::ShimsHelper
1767
+ requires_ancestor { Thor::Shell }
1768
+
1769
+ sig { params(index: ::RBI::Index, shim_rbi_dir: ::String).returns(T::Hash[::String, T::Array[::RBI::Node]]) }
1770
+ def duplicated_nodes_from_index(index, shim_rbi_dir); end
1771
+
1772
+ sig { params(index: ::RBI::Index, dir: ::String).void }
1773
+ def index_payload(index, dir); end
1774
+
1775
+ sig { params(index: ::RBI::Index, kind: ::String, dir: ::String).void }
1776
+ def index_rbis(index, kind, dir); end
1777
+
1778
+ sig { params(loc: ::RBI::Loc, path_prefix: T.nilable(::String)).returns(::String) }
1779
+ def location_to_payload_url(loc, path_prefix:); end
1780
+
1781
+ private
1782
+
1783
+ sig { params(nodes: T::Array[::RBI::Node]).returns(T::Array[T.any(::RBI::Attr, ::RBI::Method)]) }
1784
+ def extract_methods_and_attrs(nodes); end
1785
+
1786
+ sig do
1787
+ params(
1788
+ nodes: T::Array[T.any(::RBI::Attr, ::RBI::Method)]
1789
+ ).returns(T::Array[T.any(::RBI::Attr, ::RBI::Method)])
1790
+ end
1791
+ def extract_nodes_with_sigs(nodes); end
1792
+
1793
+ sig { params(nodes: T::Array[::RBI::Node], shim_rbi_dir: ::String).returns(T::Array[::RBI::Node]) }
1794
+ def extract_shims(nodes, shim_rbi_dir); end
1795
+
1796
+ sig { params(index: ::RBI::Index, files: T::Array[::String]).void }
1797
+ def parse_and_index_files(index, files); end
1798
+
1799
+ sig { params(nodes: T::Array[::RBI::Node], shim_rbi_dir: ::String).returns(T::Boolean) }
1800
+ def shims_have_duplicates?(nodes, shim_rbi_dir); end
1801
+ end
1802
+
1803
+ Tapioca::ShimsHelper::SORBET_PAYLOAD_URL = T.let(T.unsafe(nil), String)
1804
+
1805
+ module Tapioca::SignaturesHelper
1806
+ sig { params(sig_string: ::String).returns(::String) }
1807
+ def sanitize_signature_types(sig_string); end
1808
+ end
1809
+
1810
+ module Tapioca::SorbetHelper
1811
+ sig { params(sorbet_args: ::String).returns(::Spoom::ExecResult) }
1812
+ def sorbet(*sorbet_args); end
1813
+
1814
+ sig { returns(::String) }
1815
+ def sorbet_path; end
1816
+
1817
+ sig { params(feature: ::Symbol, version: T.nilable(::Gem::Version)).returns(T::Boolean) }
1818
+ def sorbet_supports?(feature, version: T.unsafe(nil)); end
1819
+ end
1820
+
1821
+ Tapioca::SorbetHelper::FEATURE_REQUIREMENTS = T.let(T.unsafe(nil), Hash)
1822
+ Tapioca::SorbetHelper::SORBET_BIN = T.let(T.unsafe(nil), Pathname)
1823
+ Tapioca::SorbetHelper::SORBET_EXE_PATH_ENV_VAR = T.let(T.unsafe(nil), String)
1824
+ Tapioca::SorbetHelper::SORBET_GEM_SPEC = T.let(T.unsafe(nil), Gem::Specification)
1825
+ module Tapioca::Static; end
1826
+
1827
+ class Tapioca::Static::RequiresCompiler
1828
+ sig { params(sorbet_path: ::String).void }
1829
+ def initialize(sorbet_path); end
1830
+
1831
+ sig { returns(::String) }
1832
+ def compile; end
1833
+
1834
+ private
1835
+
1836
+ sig { params(config: ::Spoom::Sorbet::Config).returns(T::Array[::String]) }
1837
+ def collect_files(config); end
1838
+
1839
+ sig { params(file_path: ::String).returns(T::Enumerable[::String]) }
1840
+ def collect_requires(file_path); end
1841
+
1842
+ sig { params(config: ::Spoom::Sorbet::Config, file_path: ::Pathname).returns(T::Boolean) }
1843
+ def file_ignored_by_sorbet?(config, file_path); end
1844
+
1845
+ sig { params(path: ::Pathname).returns(T::Array[::String]) }
1846
+ def path_parts(path); end
1847
+ end
1848
+
1849
+ module Tapioca::Static::SymbolLoader
1850
+ extend ::Tapioca::SorbetHelper
1851
+ extend ::Tapioca::Runtime::Reflection
1852
+
1853
+ class << self
1854
+ sig { returns(T::Set[::String]) }
1855
+ def engine_symbols; end
1856
+
1857
+ sig { params(gem: ::Tapioca::Gemfile::GemSpec).returns(T::Set[::String]) }
1858
+ def gem_symbols(gem); end
1859
+
1860
+ sig { returns(T::Set[::String]) }
1861
+ def payload_symbols; end
1862
+
1863
+ private
1864
+
1865
+ sig { returns(T::Set[::String]) }
1866
+ def load_engine_symbols; end
1867
+
1868
+ sig { params(input: ::String, table_type: ::String).returns(::String) }
1869
+ def symbol_table_json_from(input, table_type: T.unsafe(nil)); end
1870
+
1871
+ sig { params(paths: T::Array[::Pathname]).returns(T::Set[::String]) }
1872
+ def symbols_from_paths(paths); end
1873
+ end
1874
+ end
1875
+
1876
+ class Tapioca::Static::SymbolTableParser
1877
+ sig { void }
1878
+ def initialize; end
1879
+
1880
+ sig { params(name: ::String).returns(::String) }
1881
+ def fully_qualified_name(name); end
1882
+
1883
+ sig { params(object: T::Hash[::String, T.untyped]).void }
1884
+ def parse_object(object); end
1885
+
1886
+ sig { returns(T::Set[::String]) }
1887
+ def symbols; end
1888
+
1889
+ class << self
1890
+ sig { params(json_string: ::String).returns(T::Set[::String]) }
1891
+ def parse_json(json_string); end
1892
+ end
1893
+ end
1894
+
1895
+ Tapioca::TAPIOCA_CONFIG_FILE = T.let(T.unsafe(nil), String)
1896
+ Tapioca::TAPIOCA_DIR = T.let(T.unsafe(nil), String)
1897
+
1898
+ class Tapioca::TypeVariable < ::T::Types::TypeVariable
1899
+ # @return [TypeVariable] a new instance of TypeVariable
1900
+ def initialize(name, variance); end
1901
+
1902
+ # Returns the value of attribute name.
1903
+ def name; end
1904
+ end
1905
+
1906
+ module Tapioca::TypeVariableHelper
1907
+ extend ::Tapioca::SorbetHelper
1908
+
1909
+ class << self
1910
+ sig do
1911
+ params(
1912
+ type: ::String,
1913
+ variance: ::Symbol,
1914
+ fixed: T.nilable(::String),
1915
+ upper: T.nilable(::String),
1916
+ lower: T.nilable(::String)
1917
+ ).returns(::String)
1918
+ end
1919
+ def serialize_type_variable(type, variance, fixed, upper, lower); end
1920
+ end
1921
+ end
1922
+
1923
+ # This is subclassing from `Module` so that instances of this type will be modules.
1924
+ # The reason why we want that is because that means those instances will automatically
1925
+ # get bound to the constant names they are assigned to by Ruby. As a result, we don't
1926
+ # need to do any matching of constants to type variables to bind their names, Ruby will
1927
+ # do that automatically for us and we get the `name` method for free from `Module`.
1928
+ class Tapioca::TypeVariableModule < ::Module
1929
+ sig do
1930
+ params(
1931
+ context: ::Module,
1932
+ type: ::Tapioca::TypeVariableModule::Type,
1933
+ variance: ::Symbol,
1934
+ fixed: T.untyped,
1935
+ lower: T.untyped,
1936
+ upper: T.untyped,
1937
+ bounds_proc: T.nilable(T.proc.returns(T::Hash[::Symbol, T.untyped]))
1938
+ ).void
1939
+ end
1940
+ def initialize(context, type, variance, fixed, lower, upper, bounds_proc); end
1941
+
1942
+ sig { returns(::Tapioca::TypeVariable) }
1943
+ def coerce_to_type_variable; end
1944
+
1945
+ sig { returns(T.nilable(::String)) }
1946
+ def name; end
1947
+
1948
+ sig { returns(::String) }
1949
+ def serialize; end
1950
+
1951
+ private
1952
+
1953
+ sig do
1954
+ params(
1955
+ fixed: T.untyped,
1956
+ lower: T.untyped,
1957
+ upper: T.untyped
1958
+ ).returns(T.proc.returns(T::Hash[::Symbol, T.untyped]))
1959
+ end
1960
+ def build_bounds_proc(fixed, lower, upper); end
1961
+
1962
+ sig do
1963
+ type_parameters(:Result)
1964
+ .params(
1965
+ block: T.proc.returns(T.type_parameter(:Result))
1966
+ ).returns(T.type_parameter(:Result))
1967
+ end
1968
+ def with_bound_name_pre_3_0(&block); end
1969
+ end
1970
+
1971
+ class Tapioca::TypeVariableModule::Type < ::T::Enum
1972
+ enums do
1973
+ Member = new
1974
+ Template = new
1975
+ end
1976
+ end
1977
+
1978
+ Tapioca::VERSION = T.let(T.unsafe(nil), String)