solargraph 0.56.2 → 0.58.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (147) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/linting.yml +127 -0
  3. data/.github/workflows/plugins.yml +183 -7
  4. data/.github/workflows/rspec.yml +55 -5
  5. data/.github/workflows/typecheck.yml +6 -3
  6. data/.gitignore +5 -0
  7. data/.overcommit.yml +72 -0
  8. data/.rspec +1 -0
  9. data/.rubocop.yml +66 -0
  10. data/.rubocop_todo.yml +1279 -0
  11. data/.yardopts +1 -0
  12. data/CHANGELOG.md +69 -0
  13. data/README.md +8 -4
  14. data/Rakefile +125 -13
  15. data/bin/solargraph +8 -5
  16. data/lib/solargraph/api_map/cache.rb +3 -2
  17. data/lib/solargraph/api_map/constants.rb +279 -0
  18. data/lib/solargraph/api_map/index.rb +49 -31
  19. data/lib/solargraph/api_map/source_to_yard.rb +13 -4
  20. data/lib/solargraph/api_map/store.rb +144 -26
  21. data/lib/solargraph/api_map.rb +217 -245
  22. data/lib/solargraph/bench.rb +1 -0
  23. data/lib/solargraph/complex_type/type_methods.rb +6 -0
  24. data/lib/solargraph/complex_type/unique_type.rb +19 -12
  25. data/lib/solargraph/complex_type.rb +24 -3
  26. data/lib/solargraph/convention/active_support_concern.rb +111 -0
  27. data/lib/solargraph/convention/base.rb +17 -0
  28. data/lib/solargraph/convention/data_definition/data_assignment_node.rb +1 -0
  29. data/lib/solargraph/convention/data_definition/data_definition_node.rb +4 -2
  30. data/lib/solargraph/convention/data_definition.rb +2 -1
  31. data/lib/solargraph/convention/gemspec.rb +1 -1
  32. data/lib/solargraph/convention/struct_definition/struct_assignment_node.rb +1 -0
  33. data/lib/solargraph/convention/struct_definition/struct_definition_node.rb +3 -1
  34. data/lib/solargraph/convention/struct_definition.rb +36 -13
  35. data/lib/solargraph/convention.rb +31 -2
  36. data/lib/solargraph/diagnostics/rubocop.rb +6 -1
  37. data/lib/solargraph/diagnostics/rubocop_helpers.rb +5 -3
  38. data/lib/solargraph/doc_map.rb +44 -13
  39. data/lib/solargraph/environ.rb +9 -2
  40. data/lib/solargraph/equality.rb +1 -0
  41. data/lib/solargraph/gem_pins.rb +21 -11
  42. data/lib/solargraph/language_server/host/dispatch.rb +2 -0
  43. data/lib/solargraph/language_server/host/message_worker.rb +3 -0
  44. data/lib/solargraph/language_server/host.rb +12 -5
  45. data/lib/solargraph/language_server/message/base.rb +2 -1
  46. data/lib/solargraph/language_server/message/extended/check_gem_version.rb +1 -1
  47. data/lib/solargraph/language_server/message/text_document/definition.rb +2 -0
  48. data/lib/solargraph/language_server/message/text_document/formatting.rb +19 -2
  49. data/lib/solargraph/language_server/message/text_document/type_definition.rb +1 -0
  50. data/lib/solargraph/language_server/message/workspace/did_change_workspace_folders.rb +2 -0
  51. data/lib/solargraph/language_server/progress.rb +8 -0
  52. data/lib/solargraph/language_server/request.rb +4 -1
  53. data/lib/solargraph/library.rb +11 -18
  54. data/lib/solargraph/location.rb +3 -0
  55. data/lib/solargraph/logging.rb +11 -2
  56. data/lib/solargraph/page.rb +3 -0
  57. data/lib/solargraph/parser/comment_ripper.rb +8 -1
  58. data/lib/solargraph/parser/flow_sensitive_typing.rb +33 -5
  59. data/lib/solargraph/parser/node_processor/base.rb +1 -1
  60. data/lib/solargraph/parser/node_processor.rb +6 -2
  61. data/lib/solargraph/parser/parser_gem/class_methods.rb +3 -13
  62. data/lib/solargraph/parser/parser_gem/flawed_builder.rb +1 -0
  63. data/lib/solargraph/parser/parser_gem/node_chainer.rb +3 -1
  64. data/lib/solargraph/parser/parser_gem/node_methods.rb +5 -16
  65. data/lib/solargraph/parser/parser_gem/node_processors/and_node.rb +1 -0
  66. data/lib/solargraph/parser/parser_gem/node_processors/block_node.rb +3 -2
  67. data/lib/solargraph/parser/parser_gem/node_processors/if_node.rb +2 -0
  68. data/lib/solargraph/parser/parser_gem/node_processors/masgn_node.rb +3 -0
  69. data/lib/solargraph/parser/parser_gem/node_processors/opasgn_node.rb +64 -8
  70. data/lib/solargraph/parser/parser_gem/node_processors/sclass_node.rb +12 -3
  71. data/lib/solargraph/parser/parser_gem/node_processors/send_node.rb +36 -16
  72. data/lib/solargraph/parser/region.rb +3 -0
  73. data/lib/solargraph/parser/snippet.rb +2 -0
  74. data/lib/solargraph/pin/base.rb +77 -14
  75. data/lib/solargraph/pin/base_variable.rb +6 -5
  76. data/lib/solargraph/pin/block.rb +3 -2
  77. data/lib/solargraph/pin/callable.rb +14 -1
  78. data/lib/solargraph/pin/closure.rb +5 -7
  79. data/lib/solargraph/pin/common.rb +6 -2
  80. data/lib/solargraph/pin/constant.rb +2 -0
  81. data/lib/solargraph/pin/local_variable.rb +1 -2
  82. data/lib/solargraph/pin/method.rb +28 -9
  83. data/lib/solargraph/pin/method_alias.rb +3 -0
  84. data/lib/solargraph/pin/parameter.rb +24 -10
  85. data/lib/solargraph/pin/proxy_type.rb +5 -1
  86. data/lib/solargraph/pin/reference/override.rb +15 -1
  87. data/lib/solargraph/pin/reference/superclass.rb +5 -0
  88. data/lib/solargraph/pin/reference.rb +17 -0
  89. data/lib/solargraph/pin/search.rb +6 -1
  90. data/lib/solargraph/pin/signature.rb +2 -0
  91. data/lib/solargraph/pin/symbol.rb +5 -0
  92. data/lib/solargraph/pin_cache.rb +64 -4
  93. data/lib/solargraph/position.rb +3 -0
  94. data/lib/solargraph/range.rb +5 -0
  95. data/lib/solargraph/rbs_map/conversions.rb +29 -6
  96. data/lib/solargraph/rbs_map/core_fills.rb +18 -0
  97. data/lib/solargraph/rbs_map/core_map.rb +14 -7
  98. data/lib/solargraph/rbs_map.rb +14 -1
  99. data/lib/solargraph/shell.rb +85 -1
  100. data/lib/solargraph/source/chain/call.rb +7 -3
  101. data/lib/solargraph/source/chain/constant.rb +3 -66
  102. data/lib/solargraph/source/chain/if.rb +1 -1
  103. data/lib/solargraph/source/chain/link.rb +11 -2
  104. data/lib/solargraph/source/chain/or.rb +1 -1
  105. data/lib/solargraph/source/chain.rb +11 -2
  106. data/lib/solargraph/source/change.rb +2 -2
  107. data/lib/solargraph/source/cursor.rb +2 -3
  108. data/lib/solargraph/source/source_chainer.rb +1 -1
  109. data/lib/solargraph/source.rb +6 -3
  110. data/lib/solargraph/source_map/clip.rb +18 -26
  111. data/lib/solargraph/source_map/data.rb +4 -0
  112. data/lib/solargraph/source_map/mapper.rb +2 -2
  113. data/lib/solargraph/source_map.rb +28 -16
  114. data/lib/solargraph/type_checker/param_def.rb +2 -0
  115. data/lib/solargraph/type_checker/rules.rb +30 -8
  116. data/lib/solargraph/type_checker.rb +301 -186
  117. data/lib/solargraph/version.rb +1 -1
  118. data/lib/solargraph/workspace/config.rb +21 -5
  119. data/lib/solargraph/workspace/require_paths.rb +97 -0
  120. data/lib/solargraph/workspace.rb +30 -67
  121. data/lib/solargraph/yard_map/mapper/to_method.rb +4 -3
  122. data/lib/solargraph/yard_map/mapper/to_namespace.rb +1 -0
  123. data/lib/solargraph/yard_map/to_method.rb +2 -1
  124. data/lib/solargraph/yardoc.rb +39 -3
  125. data/lib/solargraph.rb +2 -0
  126. data/rbs/fills/bundler/0/bundler.rbs +4271 -0
  127. data/rbs/fills/open3/0/open3.rbs +172 -0
  128. data/rbs/fills/rubygems/0/basic_specification.rbs +326 -0
  129. data/rbs/fills/rubygems/0/errors.rbs +364 -0
  130. data/rbs/fills/rubygems/0/spec_fetcher.rbs +107 -0
  131. data/rbs/fills/rubygems/0/specification.rbs +1753 -0
  132. data/rbs/fills/{tuple.rbs → tuple/tuple.rbs} +2 -3
  133. data/rbs_collection.yaml +4 -4
  134. data/sig/shims/ast/0/node.rbs +5 -0
  135. data/sig/shims/ast/2.4/.rbs_meta.yaml +9 -0
  136. data/sig/shims/ast/2.4/ast.rbs +73 -0
  137. data/sig/shims/parser/3.2.0.1/builders/default.rbs +195 -0
  138. data/sig/shims/parser/3.2.0.1/manifest.yaml +7 -0
  139. data/sig/shims/parser/3.2.0.1/parser.rbs +201 -0
  140. data/sig/shims/parser/3.2.0.1/polyfill.rbs +4 -0
  141. data/sig/shims/thor/1.2.0.1/.rbs_meta.yaml +9 -0
  142. data/sig/shims/thor/1.2.0.1/manifest.yaml +7 -0
  143. data/sig/shims/thor/1.2.0.1/thor.rbs +17 -0
  144. data/solargraph.gemspec +26 -5
  145. metadata +181 -13
  146. data/lib/.rubocop.yml +0 -22
  147. data/lib/solargraph/parser/node_methods.rb +0 -97
@@ -0,0 +1,364 @@
1
+ # <!-- rdoc-file=lib/rubygems.rb -->
2
+ # RubyGems is the Ruby standard for publishing and managing third party
3
+ # libraries.
4
+ #
5
+ # For user documentation, see:
6
+ #
7
+ # * `gem help` and `gem help [command]`
8
+ # * [RubyGems User Guide](https://guides.rubygems.org/)
9
+ # * [Frequently Asked Questions](https://guides.rubygems.org/faqs)
10
+ #
11
+ # For gem developer documentation see:
12
+ #
13
+ # * [Creating Gems](https://guides.rubygems.org/make-your-own-gem)
14
+ # * Gem::Specification
15
+ # * Gem::Version for version dependency notes
16
+ #
17
+ # Further RubyGems documentation can be found at:
18
+ #
19
+ # * [RubyGems Guides](https://guides.rubygems.org)
20
+ # * [RubyGems API](https://www.rubydoc.info/github/rubygems/rubygems) (also
21
+ # available from `gem server`)
22
+ #
23
+ # ## RubyGems Plugins
24
+ #
25
+ # RubyGems will load plugins in the latest version of each installed gem or
26
+ # $LOAD_PATH. Plugins must be named 'rubygems_plugin' (.rb, .so, etc) and
27
+ # placed at the root of your gem's #require_path. Plugins are installed at a
28
+ # special location and loaded on boot.
29
+ #
30
+ # For an example plugin, see the [Graph gem](https://github.com/seattlerb/graph)
31
+ # which adds a `gem graph` command.
32
+ #
33
+ # ## RubyGems Defaults, Packaging
34
+ #
35
+ # RubyGems defaults are stored in lib/rubygems/defaults.rb. If you're packaging
36
+ # RubyGems or implementing Ruby you can change RubyGems' defaults.
37
+ #
38
+ # For RubyGems packagers, provide lib/rubygems/defaults/operating_system.rb and
39
+ # override any defaults from lib/rubygems/defaults.rb.
40
+ #
41
+ # For Ruby implementers, provide lib/rubygems/defaults/#{RUBY_ENGINE}.rb and
42
+ # override any defaults from lib/rubygems/defaults.rb.
43
+ #
44
+ # If you need RubyGems to perform extra work on install or uninstall, your
45
+ # defaults override file can set pre/post install and uninstall hooks. See
46
+ # Gem::pre_install, Gem::pre_uninstall, Gem::post_install, Gem::post_uninstall.
47
+ #
48
+ # ## Bugs
49
+ #
50
+ # You can submit bugs to the [RubyGems bug
51
+ # tracker](https://github.com/rubygems/rubygems/issues) on GitHub
52
+ #
53
+ # ## Credits
54
+ #
55
+ # RubyGems is currently maintained by Eric Hodel.
56
+ #
57
+ # RubyGems was originally developed at RubyConf 2003 by:
58
+ #
59
+ # * Rich Kilmer -- rich(at)infoether.com
60
+ # * Chad Fowler -- chad(at)chadfowler.com
61
+ # * David Black -- dblack(at)wobblini.net
62
+ # * Paul Brannan -- paul(at)atdesk.com
63
+ # * Jim Weirich -- jim(at)weirichhouse.org
64
+ #
65
+ # Contributors:
66
+ #
67
+ # * Gavin Sinclair -- gsinclair(at)soyabean.com.au
68
+ # * George Marrows -- george.marrows(at)ntlworld.com
69
+ # * Dick Davies -- rasputnik(at)hellooperator.net
70
+ # * Mauricio Fernandez -- batsman.geo(at)yahoo.com
71
+ # * Simon Strandgaard -- neoneye(at)adslhome.dk
72
+ # * Dave Glasser -- glasser(at)mit.edu
73
+ # * Paul Duncan -- pabs(at)pablotron.org
74
+ # * Ville Aine -- vaine(at)cs.helsinki.fi
75
+ # * Eric Hodel -- drbrain(at)segment7.net
76
+ # * Daniel Berger -- djberg96(at)gmail.com
77
+ # * Phil Hagelberg -- technomancy(at)gmail.com
78
+ # * Ryan Davis -- ryand-ruby(at)zenspider.com
79
+ # * Evan Phoenix -- evan(at)fallingsnow.net
80
+ # * Steve Klabnik -- steve(at)steveklabnik.com
81
+ #
82
+ # (If your name is missing, PLEASE let us know!)
83
+ #
84
+ # ## License
85
+ #
86
+ # See
87
+ # [LICENSE.txt](https://github.com/rubygems/rubygems/blob/master/LICENSE.txt)
88
+ # for permissions.
89
+ #
90
+ # Thanks!
91
+ #
92
+ # -The RubyGems Team
93
+ #
94
+ # <!-- rdoc-file=lib/rubygems/deprecate.rb -->
95
+ # Provides 3 methods for declaring when something is going away.
96
+ #
97
+ # +deprecate(name, repl, year, month)+:
98
+ # Indicate something may be removed on/after a certain date.
99
+ #
100
+ # +rubygems_deprecate(name, replacement=:none)+:
101
+ # Indicate something will be removed in the next major RubyGems version,
102
+ # and (optionally) a replacement for it.
103
+ #
104
+ # `rubygems_deprecate_command`:
105
+ # Indicate a RubyGems command (in +lib/rubygems/commands/*.rb+) will be
106
+ # removed in the next RubyGems version.
107
+ #
108
+ # Also provides `skip_during` for temporarily turning off deprecation warnings.
109
+ # This is intended to be used in the test suite, so deprecation warnings don't
110
+ # cause test failures if you need to make sure stderr is otherwise empty.
111
+ #
112
+ # Example usage of `deprecate` and `rubygems_deprecate`:
113
+ #
114
+ # class Legacy
115
+ # def self.some_class_method
116
+ # # ...
117
+ # end
118
+ #
119
+ # def some_instance_method
120
+ # # ...
121
+ # end
122
+ #
123
+ # def some_old_method
124
+ # # ...
125
+ # end
126
+ #
127
+ # extend Gem::Deprecate
128
+ # deprecate :some_instance_method, "X.z", 2011, 4
129
+ # rubygems_deprecate :some_old_method, "Modern#some_new_method"
130
+ #
131
+ # class << self
132
+ # extend Gem::Deprecate
133
+ # deprecate :some_class_method, :none, 2011, 4
134
+ # end
135
+ # end
136
+ #
137
+ # Example usage of `rubygems_deprecate_command`:
138
+ #
139
+ # class Gem::Commands::QueryCommand < Gem::Command
140
+ # extend Gem::Deprecate
141
+ # rubygems_deprecate_command
142
+ #
143
+ # # ...
144
+ # end
145
+ #
146
+ # Example usage of `skip_during`:
147
+ #
148
+ # class TestSomething < Gem::Testcase
149
+ # def test_some_thing_with_deprecations
150
+ # Gem::Deprecate.skip_during do
151
+ # actual_stdout, actual_stderr = capture_output do
152
+ # Gem.something_deprecated
153
+ # end
154
+ # assert_empty actual_stdout
155
+ # assert_equal(expected, actual_stderr)
156
+ # end
157
+ # end
158
+ # end
159
+ #
160
+ module Gem
161
+ # <!-- rdoc-file=lib/rubygems/errors.rb -->
162
+ # Raised when RubyGems is unable to load or activate a gem. Contains the name
163
+ # and version requirements of the gem that either conflicts with already
164
+ # activated gems or that RubyGems is otherwise unable to activate.
165
+ #
166
+ class LoadError < ::LoadError
167
+ # <!-- rdoc-file=lib/rubygems/errors.rb -->
168
+ # Name of gem
169
+ #
170
+ attr_accessor name: untyped
171
+
172
+ # <!-- rdoc-file=lib/rubygems/errors.rb -->
173
+ # Version requirement of gem
174
+ #
175
+ attr_accessor requirement: untyped
176
+ end
177
+
178
+ # <!-- rdoc-file=lib/rubygems/errors.rb -->
179
+ # Raised when trying to activate a gem, and that gem does not exist on the
180
+ # system. Instead of rescuing from this class, make sure to rescue from the
181
+ # superclass Gem::LoadError to catch all types of load errors.
182
+ #
183
+ class MissingSpecError < Gem::LoadError
184
+ @name: untyped
185
+
186
+ @requirement: untyped
187
+
188
+ @extra_message: untyped
189
+
190
+ # <!--
191
+ # rdoc-file=lib/rubygems/errors.rb
192
+ # - new(name, requirement, extra_message=nil)
193
+ # -->
194
+ #
195
+ def initialize: (untyped name, untyped requirement, ?untyped? extra_message) -> void
196
+
197
+ def message: () -> untyped
198
+
199
+ private
200
+
201
+ # <!--
202
+ # rdoc-file=lib/rubygems/errors.rb
203
+ # - build_message()
204
+ # -->
205
+ #
206
+ def build_message: () -> ::String
207
+ end
208
+
209
+ # <!-- rdoc-file=lib/rubygems/errors.rb -->
210
+ # Raised when trying to activate a gem, and the gem exists on the system, but
211
+ # not the requested version. Instead of rescuing from this class, make sure to
212
+ # rescue from the superclass Gem::LoadError to catch all types of load errors.
213
+ #
214
+ class MissingSpecVersionError < MissingSpecError
215
+ @specs: untyped
216
+
217
+ attr_reader specs: untyped
218
+
219
+ # <!--
220
+ # rdoc-file=lib/rubygems/errors.rb
221
+ # - new(name, requirement, specs)
222
+ # -->
223
+ #
224
+ def initialize: (untyped name, untyped requirement, untyped specs) -> void
225
+
226
+ private
227
+
228
+ # <!--
229
+ # rdoc-file=lib/rubygems/errors.rb
230
+ # - build_message()
231
+ # -->
232
+ #
233
+ def build_message: () -> ::String
234
+ end
235
+
236
+ # <!-- rdoc-file=lib/rubygems/errors.rb -->
237
+ # Raised when there are conflicting gem specs loaded
238
+ #
239
+ class ConflictError < LoadError
240
+ @target: untyped
241
+
242
+ @conflicts: untyped
243
+
244
+ @name: untyped
245
+
246
+ # <!-- rdoc-file=lib/rubygems/errors.rb -->
247
+ # A Hash mapping conflicting specifications to the dependencies that caused the
248
+ # conflict
249
+ #
250
+ attr_reader conflicts: untyped
251
+
252
+ # <!-- rdoc-file=lib/rubygems/errors.rb -->
253
+ # The specification that had the conflict
254
+ #
255
+ attr_reader target: untyped
256
+
257
+ # <!--
258
+ # rdoc-file=lib/rubygems/errors.rb
259
+ # - new(target, conflicts)
260
+ # -->
261
+ #
262
+ def initialize: (untyped target, untyped conflicts) -> void
263
+ end
264
+
265
+ class ErrorReason
266
+ end
267
+
268
+ # <!-- rdoc-file=lib/rubygems/errors.rb -->
269
+ # Generated when trying to lookup a gem to indicate that the gem was found, but
270
+ # that it isn't usable on the current platform.
271
+ #
272
+ # fetch and install read these and report them to the user to aid in figuring
273
+ # out why a gem couldn't be installed.
274
+ #
275
+ class PlatformMismatch < ErrorReason
276
+ @name: untyped
277
+
278
+ @version: untyped
279
+
280
+ @platforms: untyped
281
+
282
+ # <!-- rdoc-file=lib/rubygems/errors.rb -->
283
+ # the name of the gem
284
+ #
285
+ attr_reader name: untyped
286
+
287
+ # <!-- rdoc-file=lib/rubygems/errors.rb -->
288
+ # the version
289
+ #
290
+ attr_reader version: untyped
291
+
292
+ # <!-- rdoc-file=lib/rubygems/errors.rb -->
293
+ # The platforms that are mismatched
294
+ #
295
+ attr_reader platforms: untyped
296
+
297
+ # <!--
298
+ # rdoc-file=lib/rubygems/errors.rb
299
+ # - new(name, version)
300
+ # -->
301
+ #
302
+ def initialize: (untyped name, untyped version) -> void
303
+
304
+ # <!--
305
+ # rdoc-file=lib/rubygems/errors.rb
306
+ # - add_platform(platform)
307
+ # -->
308
+ # append a platform to the list of mismatched platforms.
309
+ #
310
+ # Platforms are added via this instead of injected via the constructor so that
311
+ # we can loop over a list of mismatches and just add them rather than perform
312
+ # some kind of calculation mismatch summary before creation.
313
+ #
314
+ def add_platform: (untyped platform) -> untyped
315
+
316
+ # <!--
317
+ # rdoc-file=lib/rubygems/errors.rb
318
+ # - wordy()
319
+ # -->
320
+ # A wordy description of the error.
321
+ #
322
+ def wordy: () -> untyped
323
+ end
324
+
325
+ # <!-- rdoc-file=lib/rubygems/errors.rb -->
326
+ # An error that indicates we weren't able to fetch some data from a source
327
+ #
328
+ class SourceFetchProblem < ErrorReason
329
+ @source: untyped
330
+
331
+ @error: untyped
332
+
333
+ # <!--
334
+ # rdoc-file=lib/rubygems/errors.rb
335
+ # - new(source, error)
336
+ # -->
337
+ # Creates a new SourceFetchProblem for the given `source` and `error`.
338
+ #
339
+ def initialize: (untyped source, untyped error) -> void
340
+
341
+ # <!-- rdoc-file=lib/rubygems/errors.rb -->
342
+ # The source that had the fetch problem.
343
+ #
344
+ attr_reader source: untyped
345
+
346
+ # <!-- rdoc-file=lib/rubygems/errors.rb -->
347
+ # The fetch error which is an Exception subclass.
348
+ #
349
+ attr_reader error: untyped
350
+
351
+ # <!--
352
+ # rdoc-file=lib/rubygems/errors.rb
353
+ # - wordy()
354
+ # -->
355
+ # An English description of the error.
356
+ #
357
+ def wordy: () -> ::String
358
+
359
+ # <!-- rdoc-file=lib/rubygems/errors.rb -->
360
+ # The fetch error which is an Exception subclass.
361
+ #
362
+ alias exception error
363
+ end
364
+ end
@@ -0,0 +1,107 @@
1
+ # <!-- rdoc-file=lib/rubygems/spec_fetcher.rb -->
2
+ # SpecFetcher handles metadata updates from remote gem repositories.
3
+ #
4
+ class Gem::SpecFetcher
5
+ self.@fetcher: untyped
6
+
7
+ @sources: untyped
8
+
9
+ @update_cache: untyped
10
+
11
+ @specs: untyped
12
+
13
+ @latest_specs: untyped
14
+
15
+ @prerelease_specs: untyped
16
+
17
+ @caches: untyped
18
+
19
+ @fetcher: untyped
20
+
21
+ include Gem::UserInteraction
22
+
23
+ include Gem::Text
24
+
25
+ attr_reader latest_specs: untyped
26
+
27
+ attr_reader sources: untyped
28
+
29
+ attr_reader specs: untyped
30
+
31
+ attr_reader prerelease_specs: untyped
32
+
33
+ # <!--
34
+ # rdoc-file=lib/rubygems/spec_fetcher.rb
35
+ # - fetcher()
36
+ # -->
37
+ # Default fetcher instance. Use this instead of ::new to reduce object
38
+ # allocation.
39
+ #
40
+ def self.fetcher: () -> untyped
41
+
42
+ def self.fetcher=: (untyped fetcher) -> untyped
43
+
44
+ # <!--
45
+ # rdoc-file=lib/rubygems/spec_fetcher.rb
46
+ # - new(sources = nil)
47
+ # -->
48
+ # Creates a new SpecFetcher. Ordinarily you want to use the default fetcher
49
+ # from Gem::SpecFetcher::fetcher which uses the Gem.sources.
50
+ #
51
+ # If you need to retrieve specifications from a different `source`, you can send
52
+ # it as an argument.
53
+ #
54
+ def initialize: (?untyped? sources) -> void
55
+
56
+ # <!--
57
+ # rdoc-file=lib/rubygems/spec_fetcher.rb
58
+ # - search_for_dependency(dependency, matching_platform=true)
59
+ # -->
60
+ # Find and fetch gem name tuples that match `dependency`.
61
+ #
62
+ # If `matching_platform` is false, gems for all platforms are returned.
63
+ #
64
+ def search_for_dependency: (untyped dependency, ?bool matching_platform) -> ::Array[untyped]
65
+
66
+ # <!--
67
+ # rdoc-file=lib/rubygems/spec_fetcher.rb
68
+ # - detect(type=:complete) { |tup| ... }
69
+ # -->
70
+ # Return all gem name tuples who's names match `obj`
71
+ #
72
+ def detect: (?::Symbol type) { (untyped) -> untyped } -> untyped
73
+
74
+ # <!--
75
+ # rdoc-file=lib/rubygems/spec_fetcher.rb
76
+ # - spec_for_dependency(dependency, matching_platform=true)
77
+ # -->
78
+ # Find and fetch specs that match `dependency`.
79
+ #
80
+ # If `matching_platform` is false, gems for all platforms are returned.
81
+ #
82
+ def spec_for_dependency: (untyped dependency, ?bool matching_platform) -> ::Array[untyped]
83
+
84
+ # <!--
85
+ # rdoc-file=lib/rubygems/spec_fetcher.rb
86
+ # - suggest_gems_from_name(gem_name, type = :latest, num_results = 5)
87
+ # -->
88
+ # Suggests gems based on the supplied `gem_name`. Returns an array of
89
+ # alternative gem names.
90
+ #
91
+ def suggest_gems_from_name: (untyped gem_name, ?::Symbol type, ?::Integer num_results) -> (::Array[untyped] | untyped)
92
+
93
+ # <!--
94
+ # rdoc-file=lib/rubygems/spec_fetcher.rb
95
+ # - available_specs(type)
96
+ # -->
97
+ # Returns a list of gems available for each source in Gem::sources.
98
+ #
99
+ # `type` can be one of 3 values: :released => Return the list of all released
100
+ # specs :complete => Return the list of all specs :latest => Return the
101
+ # list of only the highest version of each gem :prerelease => Return the list of
102
+ # all prerelease only specs
103
+ #
104
+ def available_specs: (untyped type) -> ::Array[untyped]
105
+
106
+ def tuples_for: (untyped source, untyped type, ?bool gracefully_ignore) -> untyped
107
+ end