solargraph 0.57.0 → 0.58.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.
- checksums.yaml +4 -4
- data/.gitattributes +2 -0
- data/.github/workflows/linting.yml +4 -2
- data/.github/workflows/plugins.yml +61 -27
- data/.github/workflows/rspec.yml +19 -4
- data/.github/workflows/typecheck.yml +2 -2
- data/.rubocop.yml +1 -1
- data/.rubocop_todo.yml +90 -1438
- data/CHANGELOG.md +30 -0
- data/Rakefile +1 -1
- data/bin/solargraph +3 -0
- data/lib/solargraph/api_map/constants.rb +107 -46
- data/lib/solargraph/api_map/index.rb +32 -8
- data/lib/solargraph/api_map/source_to_yard.rb +5 -2
- data/lib/solargraph/api_map/store.rb +22 -12
- data/lib/solargraph/api_map.rb +27 -33
- data/lib/solargraph/complex_type/type_methods.rb +5 -0
- data/lib/solargraph/complex_type/unique_type.rb +12 -5
- data/lib/solargraph/complex_type.rb +19 -2
- data/lib/solargraph/convention/active_support_concern.rb +1 -1
- data/lib/solargraph/convention/data_definition/data_definition_node.rb +1 -1
- data/lib/solargraph/diagnostics/rubocop_helpers.rb +4 -2
- data/lib/solargraph/doc_map.rb +9 -6
- data/lib/solargraph/environ.rb +1 -1
- data/lib/solargraph/equality.rb +1 -0
- data/lib/solargraph/gem_pins.rb +4 -0
- data/lib/solargraph/language_server/host.rb +10 -4
- data/lib/solargraph/language_server/message/text_document/definition.rb +2 -2
- data/lib/solargraph/language_server/message/text_document/formatting.rb +4 -1
- data/lib/solargraph/language_server/message/text_document/type_definition.rb +1 -1
- data/lib/solargraph/language_server/progress.rb +1 -1
- data/lib/solargraph/language_server/request.rb +3 -1
- data/lib/solargraph/library.rb +3 -3
- data/lib/solargraph/location.rb +1 -0
- data/lib/solargraph/page.rb +0 -1
- data/lib/solargraph/parser/flow_sensitive_typing.rb +1 -1
- data/lib/solargraph/parser/parser_gem/class_methods.rb +2 -12
- data/lib/solargraph/parser/parser_gem/node_methods.rb +1 -14
- data/lib/solargraph/parser/parser_gem/node_processors/and_node.rb +1 -0
- data/lib/solargraph/parser/parser_gem/node_processors/opasgn_node.rb +64 -8
- data/lib/solargraph/parser/parser_gem/node_processors/sclass_node.rb +12 -3
- data/lib/solargraph/parser/parser_gem/node_processors/send_node.rb +4 -5
- data/lib/solargraph/pin/base.rb +29 -8
- data/lib/solargraph/pin/base_variable.rb +5 -3
- data/lib/solargraph/pin/block.rb +3 -2
- data/lib/solargraph/pin/callable.rb +6 -2
- data/lib/solargraph/pin/closure.rb +3 -7
- data/lib/solargraph/pin/delegated_method.rb +0 -1
- data/lib/solargraph/pin/local_variable.rb +0 -4
- data/lib/solargraph/pin/method.rb +20 -4
- data/lib/solargraph/pin/parameter.rb +6 -2
- data/lib/solargraph/pin/proxy_type.rb +4 -1
- data/lib/solargraph/pin/reference.rb +2 -11
- data/lib/solargraph/pin/search.rb +3 -0
- data/lib/solargraph/pin_cache.rb +5 -5
- data/lib/solargraph/position.rb +1 -0
- data/lib/solargraph/range.rb +4 -0
- data/lib/solargraph/rbs_map/conversions.rb +22 -1
- data/lib/solargraph/rbs_map/core_fills.rb +18 -0
- data/lib/solargraph/rbs_map/core_map.rb +11 -7
- data/lib/solargraph/rbs_map.rb +2 -2
- data/lib/solargraph/shell.rb +82 -1
- data/lib/solargraph/source/chain/call.rb +7 -3
- data/lib/solargraph/source/chain/constant.rb +3 -66
- data/lib/solargraph/source/chain/if.rb +1 -1
- data/lib/solargraph/source/chain/link.rb +1 -1
- data/lib/solargraph/source/chain/or.rb +1 -1
- data/lib/solargraph/source/chain.rb +2 -0
- data/lib/solargraph/source/encoding_fixes.rb +23 -23
- data/lib/solargraph/source.rb +1 -1
- data/lib/solargraph/source_map/clip.rb +17 -25
- data/lib/solargraph/source_map/mapper.rb +0 -2
- data/lib/solargraph/source_map.rb +8 -3
- data/lib/solargraph/type_checker/rules.rb +23 -9
- data/lib/solargraph/type_checker.rb +133 -71
- data/lib/solargraph/version.rb +5 -5
- data/lib/solargraph/workspace/config.rb +21 -3
- data/lib/solargraph/workspace/require_paths.rb +0 -1
- data/lib/solargraph/workspace.rb +14 -19
- data/lib/solargraph/yard_map/mapper/to_method.rb +2 -1
- data/lib/solargraph/yard_map/mapper/to_namespace.rb +1 -0
- data/lib/solargraph/yard_map/to_method.rb +2 -1
- data/lib/solargraph/yardoc.rb +27 -4
- data/rbs/fills/bundler/0/bundler.rbs +4271 -0
- data/rbs/fills/open3/0/open3.rbs +172 -0
- data/rbs/fills/rubygems/0/basic_specification.rbs +326 -0
- data/rbs/fills/rubygems/0/errors.rbs +364 -0
- data/rbs/fills/rubygems/0/spec_fetcher.rbs +107 -0
- data/rbs/fills/rubygems/0/specification.rbs +1753 -0
- data/rbs_collection.yaml +4 -4
- data/sig/shims/ast/0/node.rbs +5 -0
- data/sig/shims/ast/2.4/.rbs_meta.yaml +9 -0
- data/sig/shims/ast/2.4/ast.rbs +73 -0
- data/sig/shims/parser/3.2.0.1/manifest.yaml +7 -0
- data/sig/shims/parser/3.2.0.1/parser.rbs +201 -0
- data/sig/shims/parser/3.2.0.1/polyfill.rbs +4 -0
- data/solargraph.gemspec +15 -4
- metadata +67 -12
- data/lib/solargraph/parser/node_methods.rb +0 -97
- /data/rbs/fills/{tuple.rbs → tuple/tuple.rbs} +0 -0
|
@@ -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
|