rbs 2.0.0 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +5 -0
- data/CHANGELOG.md +23 -0
- data/README.md +6 -1
- data/core/array.rbs +2866 -1086
- data/core/basic_object.rbs +150 -30
- data/core/binding.rbs +33 -0
- data/core/builtin.rbs +4 -4
- data/core/class.rbs +43 -5
- data/core/comparable.rbs +57 -0
- data/core/complex.rbs +170 -4
- data/core/constants.rbs +51 -0
- data/core/deprecated.rbs +7 -0
- data/core/dir.rbs +305 -20
- data/core/encoding.rbs +472 -77
- data/core/enumerable.rbs +2173 -234
- data/core/enumerator.rbs +448 -182
- data/core/env.rbs +448 -1
- data/core/errno.rbs +1 -10
- data/core/errors.rbs +152 -2
- data/core/exception.rbs +201 -127
- data/core/false_class.rbs +27 -0
- data/core/fiber.rbs +118 -37
- data/core/fiber_error.rbs +8 -9
- data/core/file.rbs +1059 -139
- data/core/file_test.rbs +287 -32
- data/core/float.rbs +776 -300
- data/core/gc.rbs +185 -34
- data/core/global_variables.rbs +5 -1
- data/core/hash.rbs +1582 -649
- data/core/integer.rbs +974 -204
- data/core/io/buffer.rbs +710 -0
- data/core/io/wait.rbs +29 -8
- data/core/io.rbs +2438 -417
- data/core/kernel.rbs +2315 -316
- data/core/marshal.rbs +37 -2
- data/core/match_data.rbs +123 -6
- data/core/math.rbs +126 -6
- data/core/method.rbs +226 -102
- data/core/module.rbs +421 -45
- data/core/nil_class.rbs +64 -0
- data/core/numeric.rbs +620 -142
- data/core/object.rbs +453 -81
- data/core/object_space.rbs +92 -2
- data/core/proc.rbs +482 -285
- data/core/process.rbs +443 -34
- data/core/ractor.rbs +232 -9
- data/core/random.rbs +151 -52
- data/core/range.rbs +885 -160
- data/core/rational.rbs +122 -6
- data/core/rb_config.rbs +14 -4
- data/core/refinement.rbs +44 -0
- data/core/regexp.rbs +156 -14
- data/core/ruby_vm.rbs +42 -3
- data/core/signal.rbs +78 -39
- data/core/string.rbs +2123 -567
- data/core/string_io.rbs +204 -0
- data/core/struct.rbs +283 -28
- data/core/symbol.rbs +304 -30
- data/core/thread.rbs +1288 -688
- data/core/thread_group.rbs +66 -10
- data/core/time.rbs +643 -217
- data/core/trace_point.rbs +100 -12
- data/core/true_class.rbs +24 -0
- data/core/unbound_method.rbs +73 -7
- data/core/warning.rbs +37 -12
- data/docs/CONTRIBUTING.md +40 -34
- data/docs/stdlib.md +3 -102
- data/lib/rbs/annotate/annotations.rb +197 -0
- data/lib/rbs/annotate/formatter.rb +80 -0
- data/lib/rbs/annotate/rdoc_annotator.rb +398 -0
- data/lib/rbs/annotate/rdoc_source.rb +120 -0
- data/lib/rbs/annotate.rb +6 -0
- data/lib/rbs/cli.rb +45 -1
- data/lib/rbs/definition_builder.rb +5 -1
- data/lib/rbs/location_aux.rb +12 -0
- data/lib/rbs/prototype/rb.rb +12 -0
- data/lib/rbs/version.rb +1 -1
- data/sig/annotate/annotations.rbs +102 -0
- data/sig/annotate/formatter.rbs +24 -0
- data/sig/annotate/rdoc_annotater.rbs +82 -0
- data/sig/annotate/rdoc_source.rbs +30 -0
- data/sig/cli.rbs +2 -0
- data/sig/collection/{collections.rbs → sources.rbs} +0 -0
- data/sig/location.rbs +6 -0
- data/sig/method_types.rbs +5 -1
- data/sig/polyfill.rbs +78 -0
- data/stdlib/abbrev/0/abbrev.rbs +6 -0
- data/stdlib/abbrev/0/array.rbs +26 -0
- data/stdlib/base64/0/base64.rbs +31 -0
- data/stdlib/benchmark/0/benchmark.rbs +74 -3
- data/stdlib/bigdecimal/0/big_decimal.rbs +614 -165
- data/stdlib/bigdecimal-math/0/big_math.rbs +41 -64
- data/stdlib/cgi/0/core.rbs +59 -0
- data/stdlib/coverage/0/coverage.rbs +164 -2
- data/stdlib/csv/0/csv.rbs +2862 -398
- data/stdlib/date/0/date.rbs +483 -25
- data/stdlib/date/0/date_time.rbs +187 -12
- data/stdlib/dbm/0/dbm.rbs +152 -17
- data/stdlib/digest/0/digest.rbs +146 -0
- data/stdlib/erb/0/erb.rbs +65 -245
- data/stdlib/fiber/0/fiber.rbs +73 -91
- data/stdlib/fileutils/0/fileutils.rbs +301 -1
- data/stdlib/find/0/find.rbs +9 -0
- data/stdlib/forwardable/0/forwardable.rbs +65 -1
- data/stdlib/io-console/0/io-console.rbs +227 -15
- data/stdlib/ipaddr/0/ipaddr.rbs +161 -0
- data/stdlib/json/0/json.rbs +1146 -144
- data/stdlib/logger/0/formatter.rbs +24 -0
- data/stdlib/logger/0/log_device.rbs +64 -0
- data/stdlib/logger/0/logger.rbs +165 -13
- data/stdlib/logger/0/period.rbs +10 -0
- data/stdlib/logger/0/severity.rbs +26 -0
- data/stdlib/monitor/0/monitor.rbs +163 -0
- data/stdlib/mutex_m/0/mutex_m.rbs +35 -6
- data/stdlib/net-http/0/net-http.rbs +1492 -683
- data/stdlib/nkf/0/nkf.rbs +372 -0
- data/stdlib/objspace/0/objspace.rbs +149 -90
- data/stdlib/openssl/0/openssl.rbs +8108 -71
- data/stdlib/optparse/0/optparse.rbs +487 -19
- data/stdlib/pathname/0/pathname.rbs +425 -124
- data/stdlib/prettyprint/0/prettyprint.rbs +120 -99
- data/stdlib/prime/0/integer-extension.rbs +20 -2
- data/stdlib/prime/0/prime.rbs +88 -21
- data/stdlib/pstore/0/pstore.rbs +102 -0
- data/stdlib/pty/0/pty.rbs +64 -14
- data/stdlib/resolv/0/resolv.rbs +420 -31
- data/stdlib/rubygems/0/basic_specification.rbs +4 -1
- data/stdlib/rubygems/0/config_file.rbs +33 -1
- data/stdlib/rubygems/0/dependency_installer.rbs +4 -3
- data/stdlib/rubygems/0/installer.rbs +13 -1
- data/stdlib/rubygems/0/path_support.rbs +4 -1
- data/stdlib/rubygems/0/platform.rbs +5 -1
- data/stdlib/rubygems/0/request_set.rbs +44 -2
- data/stdlib/rubygems/0/requirement.rbs +65 -2
- data/stdlib/rubygems/0/rubygems.rbs +407 -0
- data/stdlib/rubygems/0/source_list.rbs +13 -0
- data/stdlib/rubygems/0/specification.rbs +21 -1
- data/stdlib/rubygems/0/stream_ui.rbs +3 -1
- data/stdlib/rubygems/0/uninstaller.rbs +8 -1
- data/stdlib/rubygems/0/version.rbs +60 -157
- data/stdlib/securerandom/0/securerandom.rbs +44 -0
- data/stdlib/set/0/set.rbs +420 -106
- data/stdlib/shellwords/0/shellwords.rbs +55 -77
- data/stdlib/singleton/0/singleton.rbs +20 -0
- data/stdlib/socket/0/addrinfo.rbs +210 -9
- data/stdlib/socket/0/basic_socket.rbs +103 -11
- data/stdlib/socket/0/ip_socket.rbs +31 -9
- data/stdlib/socket/0/socket.rbs +586 -38
- data/stdlib/socket/0/tcp_server.rbs +22 -2
- data/stdlib/socket/0/tcp_socket.rbs +12 -1
- data/stdlib/socket/0/udp_socket.rbs +25 -2
- data/stdlib/socket/0/unix_server.rbs +22 -2
- data/stdlib/socket/0/unix_socket.rbs +45 -5
- data/stdlib/strscan/0/string_scanner.rbs +210 -9
- data/stdlib/tempfile/0/tempfile.rbs +58 -10
- data/stdlib/time/0/time.rbs +208 -116
- data/stdlib/timeout/0/timeout.rbs +10 -0
- data/stdlib/tmpdir/0/tmpdir.rbs +13 -4
- data/stdlib/tsort/0/cyclic.rbs +1 -0
- data/stdlib/tsort/0/interfaces.rbs +1 -0
- data/stdlib/tsort/0/tsort.rbs +42 -0
- data/stdlib/uri/0/common.rbs +57 -8
- data/stdlib/uri/0/file.rbs +55 -109
- data/stdlib/uri/0/ftp.rbs +6 -3
- data/stdlib/uri/0/generic.rbs +556 -327
- data/stdlib/uri/0/http.rbs +26 -115
- data/stdlib/uri/0/https.rbs +8 -102
- data/stdlib/uri/0/ldap.rbs +143 -137
- data/stdlib/uri/0/ldaps.rbs +8 -102
- data/stdlib/uri/0/mailto.rbs +3 -0
- data/stdlib/uri/0/rfc2396_parser.rbs +66 -26
- data/stdlib/uri/0/ws.rbs +6 -3
- data/stdlib/uri/0/wss.rbs +5 -3
- data/stdlib/yaml/0/dbm.rbs +151 -87
- data/stdlib/yaml/0/store.rbs +6 -0
- data/stdlib/zlib/0/zlib.rbs +90 -31
- metadata +17 -5
- data/lib/rbs/location.rb +0 -221
@@ -1,3 +1,4 @@
|
|
1
|
+
# <!-- rdoc-file=lib/rubygems.rb -->
|
1
2
|
# RubyGems is the Ruby standard for publishing and managing third party
|
2
3
|
# libraries.
|
3
4
|
#
|
@@ -102,6 +103,7 @@ module Gem
|
|
102
103
|
|
103
104
|
GEM_DEP_FILES: Array[String]
|
104
105
|
|
106
|
+
# <!-- rdoc-file=lib/rubygems.rb -->
|
105
107
|
# When https://bugs.ruby-lang.org/issues/17259 is available, there is no need to
|
106
108
|
# override Kernel#warn
|
107
109
|
#
|
@@ -109,24 +111,29 @@ module Gem
|
|
109
111
|
|
110
112
|
LOADED_SPECS_MUTEX: Thread::Mutex
|
111
113
|
|
114
|
+
# <!-- rdoc-file=lib/rubygems.rb -->
|
112
115
|
# Location of Marshal quick gemspecs on remote repositories
|
113
116
|
#
|
114
117
|
MARSHAL_SPEC_DIR: String
|
115
118
|
|
119
|
+
# <!-- rdoc-file=lib/rubygems.rb -->
|
116
120
|
# Exception classes used in a Gem.read_binary `rescue` statement
|
117
121
|
#
|
118
122
|
READ_BINARY_ERRORS: Array[Class]
|
119
123
|
|
124
|
+
# <!-- rdoc-file=lib/rubygems.rb -->
|
120
125
|
# Subdirectories in a gem repository for default gems
|
121
126
|
#
|
122
127
|
REPOSITORY_DEFAULT_GEM_SUBDIRECTORIES: Array[String]
|
123
128
|
|
129
|
+
# <!-- rdoc-file=lib/rubygems.rb -->
|
124
130
|
# Subdirectories in a gem repository
|
125
131
|
#
|
126
132
|
REPOSITORY_SUBDIRECTORIES: Array[String]
|
127
133
|
|
128
134
|
RUBYGEMS_DIR: String
|
129
135
|
|
136
|
+
# <!-- rdoc-file=lib/rubygems.rb -->
|
130
137
|
# Taint support is deprecated in Ruby 2.7. This allows switching ".untaint" to
|
131
138
|
# ".tap(&Gem::UNTAINT)", to avoid deprecation warnings in Ruby 2.7.
|
132
139
|
#
|
@@ -134,94 +141,172 @@ module Gem
|
|
134
141
|
|
135
142
|
VERSION: String
|
136
143
|
|
144
|
+
# <!-- rdoc-file=lib/rubygems.rb -->
|
137
145
|
# An Array of Regexps that match windows Ruby platforms.
|
138
146
|
#
|
139
147
|
WIN_PATTERNS: Array[Regexp]
|
140
148
|
|
149
|
+
# <!-- rdoc-file=lib/rubygems.rb -->
|
141
150
|
# Exception classes used in Gem.write_binary `rescue` statement
|
142
151
|
#
|
143
152
|
WRITE_BINARY_ERRORS: Array[Class]
|
144
153
|
|
154
|
+
# <!--
|
155
|
+
# rdoc-file=lib/rubygems.rb
|
156
|
+
# - activated_gem_paths()
|
157
|
+
# -->
|
145
158
|
# The number of paths in the `$LOAD_PATH` from activated gems. Used to
|
146
159
|
# prioritize `-I` and `[ENV]('RUBYLIB`)` entries during `require`.
|
147
160
|
#
|
148
161
|
def self.activated_gem_paths: () -> Integer
|
149
162
|
|
163
|
+
# <!--
|
164
|
+
# rdoc-file=lib/rubygems.rb
|
165
|
+
# - add_to_load_path(*paths)
|
166
|
+
# -->
|
150
167
|
# Add a list of paths to the $LOAD_PATH at the proper place.
|
151
168
|
#
|
152
169
|
def self.add_to_load_path: (*String paths) -> Array[String]
|
153
170
|
|
171
|
+
# <!--
|
172
|
+
# rdoc-file=lib/rubygems.rb
|
173
|
+
# - bin_path(name, exec_name = nil, *requirements)
|
174
|
+
# -->
|
154
175
|
# Find the full path to the executable for gem `name`. If the `exec_name` is
|
155
176
|
# not given, an exception will be raised, otherwise the specified executable's
|
156
177
|
# path is returned. `requirements` allows you to specify specific gem versions.
|
157
178
|
#
|
158
179
|
def self.bin_path: (String name, String exec_name, ?Array[Requirement] requirements) -> String
|
159
180
|
|
181
|
+
# <!--
|
182
|
+
# rdoc-file=lib/rubygems.rb
|
183
|
+
# - binary_mode()
|
184
|
+
# -->
|
160
185
|
# The mode needed to read a file as straight binary.
|
161
186
|
#
|
162
187
|
def self.binary_mode: () -> String
|
163
188
|
|
189
|
+
# <!--
|
190
|
+
# rdoc-file=lib/rubygems.rb
|
191
|
+
# - bindir(install_dir=Gem.dir)
|
192
|
+
# -->
|
164
193
|
# The path where gem executables are to be installed.
|
165
194
|
#
|
166
195
|
def self.bindir: (?String install_dir) -> String
|
167
196
|
|
197
|
+
# <!--
|
198
|
+
# rdoc-file=lib/rubygems/defaults.rb
|
199
|
+
# - cache_home()
|
200
|
+
# -->
|
168
201
|
# The path to standard location of the user's cache directory.
|
169
202
|
#
|
170
203
|
def self.cache_home: () -> String
|
171
204
|
|
205
|
+
# <!--
|
206
|
+
# rdoc-file=lib/rubygems.rb
|
207
|
+
# - clear_default_specs()
|
208
|
+
# -->
|
172
209
|
# Clear default gem related variables. It is for test
|
173
210
|
#
|
174
211
|
def self.clear_default_specs: () -> void
|
175
212
|
|
213
|
+
# <!--
|
214
|
+
# rdoc-file=lib/rubygems.rb
|
215
|
+
# - clear_paths()
|
216
|
+
# -->
|
176
217
|
# Reset the `dir` and `path` values. The next time `dir` or `path` is
|
177
218
|
# requested, the values will be calculated from scratch. This is mainly used by
|
178
219
|
# the unit tests to provide test isolation.
|
179
220
|
#
|
180
221
|
def self.clear_paths: () -> void
|
181
222
|
|
223
|
+
# <!--
|
224
|
+
# rdoc-file=lib/rubygems/defaults.rb
|
225
|
+
# - config_file()
|
226
|
+
# -->
|
182
227
|
# The path to standard location of the user's .gemrc file.
|
183
228
|
#
|
184
229
|
def self.config_file: () -> String
|
185
230
|
|
231
|
+
# <!--
|
232
|
+
# rdoc-file=lib/rubygems/defaults.rb
|
233
|
+
# - config_home()
|
234
|
+
# -->
|
186
235
|
# The path to standard location of the user's configuration directory.
|
187
236
|
#
|
188
237
|
def self.config_home: () -> String
|
189
238
|
|
239
|
+
# <!--
|
240
|
+
# rdoc-file=lib/rubygems.rb
|
241
|
+
# - configuration()
|
242
|
+
# -->
|
190
243
|
# The standard configuration object for gems.
|
191
244
|
#
|
192
245
|
def self.configuration: () -> ConfigFile
|
193
246
|
|
247
|
+
# <!--
|
248
|
+
# rdoc-file=lib/rubygems.rb
|
249
|
+
# - configuration=(config)
|
250
|
+
# -->
|
194
251
|
# Use the given configuration object (which implements the ConfigFile protocol)
|
195
252
|
# as the standard configuration object.
|
196
253
|
#
|
197
254
|
def self.configuration=: (ConfigFile config) -> ConfigFile
|
198
255
|
|
256
|
+
# <!--
|
257
|
+
# rdoc-file=lib/rubygems/defaults.rb
|
258
|
+
# - data_home()
|
259
|
+
# -->
|
199
260
|
# The path to standard location of the user's data directory.
|
200
261
|
#
|
201
262
|
def self.data_home: () -> String
|
202
263
|
|
264
|
+
# <!--
|
265
|
+
# rdoc-file=lib/rubygems.rb
|
266
|
+
# - datadir(gem_name)
|
267
|
+
# -->
|
203
268
|
# The path to the data directory specified by the gem name. If the package is
|
204
269
|
# not available as a gem, return nil.
|
205
270
|
#
|
206
271
|
def self.datadir: (String gem_name) -> String?
|
207
272
|
|
273
|
+
# <!--
|
274
|
+
# rdoc-file=lib/rubygems/defaults.rb
|
275
|
+
# - default_bindir()
|
276
|
+
# -->
|
208
277
|
# The default directory for binaries
|
209
278
|
#
|
210
279
|
def self.default_bindir: () -> String
|
211
280
|
|
281
|
+
# <!--
|
282
|
+
# rdoc-file=lib/rubygems/defaults.rb
|
283
|
+
# - default_cert_path()
|
284
|
+
# -->
|
212
285
|
# The default signing certificate chain path
|
213
286
|
#
|
214
287
|
def self.default_cert_path: () -> String
|
215
288
|
|
289
|
+
# <!--
|
290
|
+
# rdoc-file=lib/rubygems/defaults.rb
|
291
|
+
# - default_dir()
|
292
|
+
# -->
|
216
293
|
# Default home directory path to be used if an alternate value is not specified
|
217
294
|
# in the environment
|
218
295
|
#
|
219
296
|
def self.default_dir: () -> String
|
220
297
|
|
298
|
+
# <!--
|
299
|
+
# rdoc-file=lib/rubygems/defaults.rb
|
300
|
+
# - default_exec_format()
|
301
|
+
# -->
|
221
302
|
# Deduce Ruby's --program-prefix and --program-suffix from its install name
|
222
303
|
#
|
223
304
|
def self.default_exec_format: () -> String
|
224
305
|
|
306
|
+
# <!--
|
307
|
+
# rdoc-file=lib/rubygems/defaults.rb
|
308
|
+
# - default_ext_dir_for(base_dir)
|
309
|
+
# -->
|
225
310
|
# Returns binary extensions dir for specified RubyGems base dir or nil if such
|
226
311
|
# directory cannot be determined.
|
227
312
|
#
|
@@ -230,58 +315,105 @@ module Gem
|
|
230
315
|
#
|
231
316
|
def self.default_ext_dir_for: (String base_dir) -> String?
|
232
317
|
|
318
|
+
# <!--
|
319
|
+
# rdoc-file=lib/rubygems/defaults.rb
|
320
|
+
# - default_key_path()
|
321
|
+
# -->
|
233
322
|
# The default signing key path
|
234
323
|
#
|
235
324
|
def self.default_key_path: () -> String
|
236
325
|
|
326
|
+
# <!--
|
327
|
+
# rdoc-file=lib/rubygems/defaults.rb
|
328
|
+
# - default_path()
|
329
|
+
# -->
|
237
330
|
# Default gem load path
|
238
331
|
#
|
239
332
|
def self.default_path: () -> Array[String]
|
240
333
|
|
334
|
+
# <!--
|
335
|
+
# rdoc-file=lib/rubygems/defaults.rb
|
336
|
+
# - default_rubygems_dirs()
|
337
|
+
# -->
|
241
338
|
# Paths where RubyGems' .rb files and bin files are installed
|
242
339
|
#
|
243
340
|
def self.default_rubygems_dirs: () -> Array[String]?
|
244
341
|
|
342
|
+
# <!--
|
343
|
+
# rdoc-file=lib/rubygems/defaults.rb
|
344
|
+
# - default_sources()
|
345
|
+
# -->
|
245
346
|
# An Array of the default sources that come with RubyGems
|
246
347
|
#
|
247
348
|
def self.default_sources: () -> Array[String]
|
248
349
|
|
350
|
+
# <!--
|
351
|
+
# rdoc-file=lib/rubygems/defaults.rb
|
352
|
+
# - default_spec_cache_dir()
|
353
|
+
# -->
|
249
354
|
# Default spec directory path to be used if an alternate value is not specified
|
250
355
|
# in the environment
|
251
356
|
#
|
252
357
|
def self.default_spec_cache_dir: () -> String
|
253
358
|
|
359
|
+
# <!--
|
360
|
+
# rdoc-file=lib/rubygems/defaults.rb
|
361
|
+
# - default_specifications_dir()
|
362
|
+
# -->
|
254
363
|
# Path to specification files of default gems.
|
255
364
|
#
|
256
365
|
def self.default_specifications_dir: () -> String
|
257
366
|
|
367
|
+
# <!--
|
368
|
+
# rdoc-file=lib/rubygems.rb
|
369
|
+
# - deflate(data)
|
370
|
+
# -->
|
258
371
|
# A Zlib::Deflate.deflate wrapper
|
259
372
|
#
|
260
373
|
def self.deflate: (String data) -> String
|
261
374
|
|
375
|
+
# <!--
|
376
|
+
# rdoc-file=lib/rubygems.rb
|
377
|
+
# - dir()
|
378
|
+
# -->
|
262
379
|
# The path where gems are to be installed.
|
263
380
|
#
|
264
381
|
def self.dir: () -> String
|
265
382
|
|
383
|
+
# <!-- rdoc-file=lib/rubygems.rb -->
|
266
384
|
# RubyGems distributors (like operating system package managers) can disable
|
267
385
|
# RubyGems update by setting this to error message printed to end-users on gem
|
268
386
|
# update --system instead of actual update.
|
269
387
|
#
|
270
388
|
def self.disable_system_update_message: () -> String?
|
271
389
|
|
390
|
+
# <!-- rdoc-file=lib/rubygems.rb -->
|
391
|
+
# RubyGems distributors (like operating system package managers) can disable
|
392
|
+
# RubyGems update by setting this to error message printed to end-users on gem
|
393
|
+
# update --system instead of actual update.
|
394
|
+
#
|
272
395
|
def self.disable_system_update_message=: (String?) -> String?
|
273
396
|
|
397
|
+
# <!--
|
398
|
+
# rdoc-file=lib/rubygems.rb
|
399
|
+
# - done_installing(&hook)
|
400
|
+
# -->
|
274
401
|
# Adds a post-installs hook that will be passed a Gem::DependencyInstaller and a
|
275
402
|
# list of installed specifications when Gem::DependencyInstaller#install is
|
276
403
|
# complete
|
277
404
|
#
|
278
405
|
def self.done_installing: () { (DependencyInstaller, Array[Specification]) -> untyped } -> Array[Proc]
|
279
406
|
|
407
|
+
# <!-- rdoc-file=lib/rubygems.rb -->
|
280
408
|
# The list of hooks to be run after Gem::DependencyInstaller installs a set of
|
281
409
|
# gems
|
282
410
|
#
|
283
411
|
def self.done_installing_hooks: () -> Array[Proc?]
|
284
412
|
|
413
|
+
# <!--
|
414
|
+
# rdoc-file=lib/rubygems.rb
|
415
|
+
# - ensure_default_gem_subdirectories(dir = Gem.dir, mode = nil)
|
416
|
+
# -->
|
285
417
|
# Quietly ensure the Gem directory `dir` contains all the proper subdirectories
|
286
418
|
# for handling default gems. If we can't create a directory due to a permission
|
287
419
|
# problem, then we will silently continue.
|
@@ -292,6 +424,10 @@ module Gem
|
|
292
424
|
#
|
293
425
|
def self.ensure_default_gem_subdirectories: (?String dir, ?Integer | String mode) -> Array[String]
|
294
426
|
|
427
|
+
# <!--
|
428
|
+
# rdoc-file=lib/rubygems.rb
|
429
|
+
# - ensure_gem_subdirectories(dir = Gem.dir, mode = nil)
|
430
|
+
# -->
|
295
431
|
# Quietly ensure the Gem directory `dir` contains all the proper subdirectories.
|
296
432
|
# If we can't create a directory due to a permission problem, then we will
|
297
433
|
# silently continue.
|
@@ -302,12 +438,25 @@ module Gem
|
|
302
438
|
#
|
303
439
|
def self.ensure_gem_subdirectories: (?String dir, ?Integer | String mode) -> Array[String]
|
304
440
|
|
441
|
+
# <!--
|
442
|
+
# rdoc-file=lib/rubygems.rb
|
443
|
+
# - env_requirement(gem_name)
|
444
|
+
# -->
|
445
|
+
#
|
305
446
|
def self.env_requirement: (String gem_name) -> Requirement
|
306
447
|
|
448
|
+
# <!--
|
449
|
+
# rdoc-file=lib/rubygems/defaults.rb
|
450
|
+
# - find_config_file()
|
451
|
+
# -->
|
307
452
|
# Finds the user's config file
|
308
453
|
#
|
309
454
|
def self.find_config_file: () -> String
|
310
455
|
|
456
|
+
# <!--
|
457
|
+
# rdoc-file=lib/rubygems.rb
|
458
|
+
# - find_files(glob, check_load_path=true)
|
459
|
+
# -->
|
311
460
|
# Returns a list of paths matching `glob` that can be used by a gem to pick up
|
312
461
|
# features from other gems. For example:
|
313
462
|
#
|
@@ -321,6 +470,10 @@ module Gem
|
|
321
470
|
#
|
322
471
|
def self.find_files: (String glob, ?boolish check_load_path) -> Array[String]
|
323
472
|
|
473
|
+
# <!--
|
474
|
+
# rdoc-file=lib/rubygems.rb
|
475
|
+
# - find_latest_files(glob, check_load_path=true)
|
476
|
+
# -->
|
324
477
|
# Returns a list of paths matching `glob` from the latest gems that can be used
|
325
478
|
# by a gem to pick up features from other gems. For example:
|
326
479
|
#
|
@@ -334,25 +487,47 @@ module Gem
|
|
334
487
|
#
|
335
488
|
def self.find_latest_files: (String glob, ?boolish check_load_path) -> Array[String]
|
336
489
|
|
490
|
+
# <!--
|
491
|
+
# rdoc-file=lib/rubygems.rb
|
492
|
+
# - find_unresolved_default_spec(path)
|
493
|
+
# -->
|
337
494
|
# Find a Gem::Specification of default gem from `path`
|
338
495
|
#
|
339
496
|
def self.find_unresolved_default_spec: (String path) -> Specification?
|
340
497
|
|
498
|
+
# <!--
|
499
|
+
# rdoc-file=lib/rubygems.rb
|
500
|
+
# - finish_resolve(request_set=Gem::RequestSet.new)
|
501
|
+
# -->
|
502
|
+
#
|
341
503
|
def self.finish_resolve: (?RequestSet request_set) -> void
|
342
504
|
|
505
|
+
# <!-- rdoc-file=lib/rubygems.rb -->
|
343
506
|
# GemDependencyAPI object, which is set when .use_gemdeps is called. This
|
344
507
|
# contains all the information from the Gemfile.
|
345
508
|
#
|
346
509
|
def self.gemdeps: () -> RequestSet::GemDependencyAPI?
|
347
510
|
|
511
|
+
# <!--
|
512
|
+
# rdoc-file=lib/rubygems.rb
|
513
|
+
# - host()
|
514
|
+
# -->
|
348
515
|
# Get the default RubyGems API host. This is normally `https://rubygems.org`.
|
349
516
|
#
|
350
517
|
def self.host: () -> String
|
351
518
|
|
519
|
+
# <!--
|
520
|
+
# rdoc-file=lib/rubygems.rb
|
521
|
+
# - host=(host)
|
522
|
+
# -->
|
352
523
|
# Set the default RubyGems API host.
|
353
524
|
#
|
354
525
|
def self.host=: (String host) -> String
|
355
526
|
|
527
|
+
# <!--
|
528
|
+
# rdoc-file=lib/rubygems.rb
|
529
|
+
# - install(name, version = Gem::Requirement.default, *options)
|
530
|
+
# -->
|
356
531
|
# Top level install helper method. Allows you to install gems interactively:
|
357
532
|
#
|
358
533
|
# % irb
|
@@ -362,43 +537,80 @@ module Gem
|
|
362
537
|
#
|
363
538
|
def self.install: (String name, ?Gem::Requirement version, *DependencyInstaller::options options) -> Array[Specification]
|
364
539
|
|
540
|
+
# <!--
|
541
|
+
# rdoc-file=lib/rubygems.rb
|
542
|
+
# - java_platform?()
|
543
|
+
# -->
|
365
544
|
# Is this a java platform?
|
366
545
|
#
|
367
546
|
def self.java_platform?: () -> bool
|
368
547
|
|
548
|
+
# <!--
|
549
|
+
# rdoc-file=lib/rubygems.rb
|
550
|
+
# - latest_rubygems_version()
|
551
|
+
# -->
|
369
552
|
# Returns the latest release version of RubyGems.
|
370
553
|
#
|
371
554
|
def self.latest_rubygems_version: () -> Version
|
372
555
|
|
556
|
+
# <!--
|
557
|
+
# rdoc-file=lib/rubygems.rb
|
558
|
+
# - latest_spec_for(name)
|
559
|
+
# -->
|
373
560
|
# Returns the latest release-version specification for the gem `name`.
|
374
561
|
#
|
375
562
|
def self.latest_spec_for: (String name) -> Specification?
|
376
563
|
|
564
|
+
# <!--
|
565
|
+
# rdoc-file=lib/rubygems.rb
|
566
|
+
# - latest_version_for(name)
|
567
|
+
# -->
|
377
568
|
# Returns the version of the latest release-version of gem `name`
|
378
569
|
#
|
379
570
|
def self.latest_version_for: (String name) -> Version?
|
380
571
|
|
572
|
+
# <!--
|
573
|
+
# rdoc-file=lib/rubygems.rb
|
574
|
+
# - load_env_plugins()
|
575
|
+
# -->
|
381
576
|
# Find all 'rubygems_plugin' files in $LOAD_PATH and load them
|
382
577
|
#
|
383
578
|
def self.load_env_plugins: () -> Array[String]
|
384
579
|
|
580
|
+
# <!--
|
581
|
+
# rdoc-file=lib/rubygems.rb
|
582
|
+
# - load_path_insert_index()
|
583
|
+
# -->
|
385
584
|
# The index to insert activated gem paths into the $LOAD_PATH. The activated
|
386
585
|
# gem's paths are inserted before site lib directory by default.
|
387
586
|
#
|
388
587
|
def self.load_path_insert_index: () -> Integer
|
389
588
|
|
589
|
+
# <!--
|
590
|
+
# rdoc-file=lib/rubygems.rb
|
591
|
+
# - load_plugins()
|
592
|
+
# -->
|
390
593
|
# Find rubygems plugin files in the standard location and load them
|
391
594
|
#
|
392
595
|
def self.load_plugins: () -> Array[String]
|
393
596
|
|
597
|
+
# <!--
|
598
|
+
# rdoc-file=lib/rubygems.rb
|
599
|
+
# - load_yaml()
|
600
|
+
# -->
|
394
601
|
# Loads YAML, preferring Psych
|
395
602
|
#
|
396
603
|
def self.load_yaml: () -> bool?
|
397
604
|
|
605
|
+
# <!-- rdoc-file=lib/rubygems.rb -->
|
398
606
|
# Hash of loaded Gem::Specification keyed by name
|
399
607
|
#
|
400
608
|
def self.loaded_specs: () -> Hash[String, BasicSpecification]
|
401
609
|
|
610
|
+
# <!--
|
611
|
+
# rdoc-file=lib/rubygems.rb
|
612
|
+
# - location_of_caller(depth = 1)
|
613
|
+
# -->
|
402
614
|
# The file name and line number of the caller of the caller of this method.
|
403
615
|
#
|
404
616
|
# `depth` is how many layers up the call stack it should go.
|
@@ -413,12 +625,25 @@ module Gem
|
|
413
625
|
#
|
414
626
|
def self.location_of_caller: (?Integer depth) -> [ String, Integer ]
|
415
627
|
|
628
|
+
# <!--
|
629
|
+
# rdoc-file=lib/rubygems.rb
|
630
|
+
# - marshal_version()
|
631
|
+
# -->
|
416
632
|
# The version of the Marshal format for your Ruby.
|
417
633
|
#
|
418
634
|
def self.marshal_version: () -> String
|
419
635
|
|
636
|
+
# <!--
|
637
|
+
# rdoc-file=lib/rubygems.rb
|
638
|
+
# - needs() { |rs| ... }
|
639
|
+
# -->
|
640
|
+
#
|
420
641
|
def self.needs: () { (RequestSet) -> void } -> void
|
421
642
|
|
643
|
+
# <!--
|
644
|
+
# rdoc-file=lib/rubygems/defaults.rb
|
645
|
+
# - operating_system_defaults()
|
646
|
+
# -->
|
422
647
|
# Default options for gem commands for Ruby packagers.
|
423
648
|
#
|
424
649
|
# The options here should be structured as an array of string "gem" command
|
@@ -436,16 +661,33 @@ module Gem
|
|
436
661
|
#
|
437
662
|
def self.operating_system_defaults: () -> Hash[String, String]
|
438
663
|
|
664
|
+
# <!--
|
665
|
+
# rdoc-file=lib/rubygems.rb
|
666
|
+
# - path()
|
667
|
+
# -->
|
668
|
+
#
|
439
669
|
def self.path: () -> Array[String]
|
440
670
|
|
671
|
+
# <!--
|
672
|
+
# rdoc-file=lib/rubygems/defaults.rb
|
673
|
+
# - path_separator()
|
674
|
+
# -->
|
441
675
|
# How String Gem paths should be split. Overridable for esoteric platforms.
|
442
676
|
#
|
443
677
|
def self.path_separator: () -> String
|
444
678
|
|
679
|
+
# <!--
|
680
|
+
# rdoc-file=lib/rubygems.rb
|
681
|
+
# - paths()
|
682
|
+
# -->
|
445
683
|
# Retrieve the PathSupport object that RubyGems uses to lookup files.
|
446
684
|
#
|
447
685
|
def self.paths: () -> PathSupport
|
448
686
|
|
687
|
+
# <!--
|
688
|
+
# rdoc-file=lib/rubygems.rb
|
689
|
+
# - paths=(env)
|
690
|
+
# -->
|
449
691
|
# Initialize the filesystem paths to use from `env`. `env` is a hash-like object
|
450
692
|
# (typically ENV) that is queried for 'GEM_HOME', 'GEM_PATH', and
|
451
693
|
# 'GEM_SPEC_CACHE' Keys for the `env` hash should be Strings, and values of the
|
@@ -453,6 +695,10 @@ module Gem
|
|
453
695
|
#
|
454
696
|
def self.paths=: (_HashLike[String, String?] env) -> Array[String]
|
455
697
|
|
698
|
+
# <!--
|
699
|
+
# rdoc-file=lib/rubygems/defaults.rb
|
700
|
+
# - platform_defaults()
|
701
|
+
# -->
|
456
702
|
# Default options for gem commands for Ruby implementers.
|
457
703
|
#
|
458
704
|
# The options here should be structured as an array of string "gem" command
|
@@ -470,26 +716,50 @@ module Gem
|
|
470
716
|
#
|
471
717
|
def self.platform_defaults: () -> Hash[String, String]
|
472
718
|
|
719
|
+
# <!--
|
720
|
+
# rdoc-file=lib/rubygems.rb
|
721
|
+
# - platforms()
|
722
|
+
# -->
|
473
723
|
# Array of platforms this RubyGems supports.
|
474
724
|
#
|
475
725
|
def self.platforms: () -> Array[String | Platform]
|
476
726
|
|
727
|
+
# <!--
|
728
|
+
# rdoc-file=lib/rubygems.rb
|
729
|
+
# - platforms=(platforms)
|
730
|
+
# -->
|
477
731
|
# Set array of platforms this RubyGems supports (primarily for testing).
|
478
732
|
#
|
479
733
|
def self.platforms=: (Array[String | Platform] platforms) -> Array[String | Platform]
|
480
734
|
|
735
|
+
# <!--
|
736
|
+
# rdoc-file=lib/rubygems.rb
|
737
|
+
# - plugin_suffix_pattern()
|
738
|
+
# -->
|
481
739
|
# Glob pattern for require-able plugin suffixes.
|
482
740
|
#
|
483
741
|
def self.plugin_suffix_pattern: () -> String
|
484
742
|
|
743
|
+
# <!--
|
744
|
+
# rdoc-file=lib/rubygems.rb
|
745
|
+
# - plugin_suffix_regexp()
|
746
|
+
# -->
|
485
747
|
# Regexp for require-able plugin suffixes.
|
486
748
|
#
|
487
749
|
def self.plugin_suffix_regexp: () -> Regexp
|
488
750
|
|
751
|
+
# <!--
|
752
|
+
# rdoc-file=lib/rubygems.rb
|
753
|
+
# - plugindir(install_dir=Gem.dir)
|
754
|
+
# -->
|
489
755
|
# The path were rubygems plugins are to be installed.
|
490
756
|
#
|
491
757
|
def self.plugindir: (?String install_dir) -> String
|
492
758
|
|
759
|
+
# <!--
|
760
|
+
# rdoc-file=lib/rubygems.rb
|
761
|
+
# - post_build(&hook)
|
762
|
+
# -->
|
493
763
|
# Adds a post-build hook that will be passed an Gem::Installer instance when
|
494
764
|
# Gem::Installer#install is called. The hook is called after the gem has been
|
495
765
|
# extracted and extensions have been built but before the executables or gemspec
|
@@ -498,80 +768,127 @@ module Gem
|
|
498
768
|
#
|
499
769
|
def self.post_build: () { (Installer) -> untyped } -> Array[Proc]
|
500
770
|
|
771
|
+
# <!-- rdoc-file=lib/rubygems.rb -->
|
501
772
|
# The list of hooks to be run after Gem::Installer#install extracts files and
|
502
773
|
# builds extensions
|
503
774
|
#
|
504
775
|
def self.post_build_hooks: () -> Array[Proc]
|
505
776
|
|
777
|
+
# <!--
|
778
|
+
# rdoc-file=lib/rubygems.rb
|
779
|
+
# - post_install(&hook)
|
780
|
+
# -->
|
506
781
|
# Adds a post-install hook that will be passed an Gem::Installer instance when
|
507
782
|
# Gem::Installer#install is called
|
508
783
|
#
|
509
784
|
def self.post_install: () { (Installer) -> untyped } -> Array[Proc]
|
510
785
|
|
786
|
+
# <!-- rdoc-file=lib/rubygems.rb -->
|
511
787
|
# The list of hooks to be run after Gem::Installer#install completes
|
512
788
|
# installation
|
513
789
|
#
|
514
790
|
def self.post_install_hooks: () -> Array[Proc]
|
515
791
|
|
792
|
+
# <!--
|
793
|
+
# rdoc-file=lib/rubygems.rb
|
794
|
+
# - post_reset(&hook)
|
795
|
+
# -->
|
516
796
|
# Adds a hook that will get run after Gem::Specification.reset is run.
|
517
797
|
#
|
518
798
|
def self.post_reset: () { () -> untyped } -> Array[Proc]
|
519
799
|
|
800
|
+
# <!-- rdoc-file=lib/rubygems.rb -->
|
520
801
|
# The list of hooks to be run after Gem::Specification.reset is run.
|
521
802
|
#
|
522
803
|
def self.post_reset_hooks: () -> Array[Proc?]
|
523
804
|
|
805
|
+
# <!--
|
806
|
+
# rdoc-file=lib/rubygems.rb
|
807
|
+
# - post_uninstall(&hook)
|
808
|
+
# -->
|
524
809
|
# Adds a post-uninstall hook that will be passed a Gem::Uninstaller instance and
|
525
810
|
# the spec that was uninstalled when Gem::Uninstaller#uninstall is called
|
526
811
|
#
|
527
812
|
def self.post_uninstall: () { (Uninstaller) -> untyped } -> Array[Proc]
|
528
813
|
|
814
|
+
# <!-- rdoc-file=lib/rubygems.rb -->
|
529
815
|
# The list of hooks to be run after Gem::Uninstaller#uninstall completes
|
530
816
|
# installation
|
531
817
|
#
|
532
818
|
def self.post_uninstall_hooks: () -> Array[Proc?]
|
533
819
|
|
820
|
+
# <!--
|
821
|
+
# rdoc-file=lib/rubygems.rb
|
822
|
+
# - pre_install(&hook)
|
823
|
+
# -->
|
534
824
|
# Adds a pre-install hook that will be passed an Gem::Installer instance when
|
535
825
|
# Gem::Installer#install is called. If the hook returns `false` then the
|
536
826
|
# install will be aborted.
|
537
827
|
#
|
538
828
|
def self.pre_install: () { (Installer) -> untyped } -> Array[Proc]
|
539
829
|
|
830
|
+
# <!-- rdoc-file=lib/rubygems.rb -->
|
540
831
|
# The list of hooks to be run before Gem::Installer#install does any work
|
541
832
|
#
|
542
833
|
def self.pre_install_hooks: () -> Array[Proc?]
|
543
834
|
|
835
|
+
# <!--
|
836
|
+
# rdoc-file=lib/rubygems.rb
|
837
|
+
# - pre_reset(&hook)
|
838
|
+
# -->
|
544
839
|
# Adds a hook that will get run before Gem::Specification.reset is run.
|
545
840
|
#
|
546
841
|
def self.pre_reset: () { () -> untyped } -> Array[Proc]
|
547
842
|
|
843
|
+
# <!-- rdoc-file=lib/rubygems.rb -->
|
548
844
|
# The list of hooks to be run before Gem::Specification.reset is run.
|
549
845
|
#
|
550
846
|
def self.pre_reset_hooks: () -> Array[Proc?]
|
551
847
|
|
848
|
+
# <!--
|
849
|
+
# rdoc-file=lib/rubygems.rb
|
850
|
+
# - pre_uninstall(&hook)
|
851
|
+
# -->
|
552
852
|
# Adds a pre-uninstall hook that will be passed an Gem::Uninstaller instance and
|
553
853
|
# the spec that will be uninstalled when Gem::Uninstaller#uninstall is called
|
554
854
|
#
|
555
855
|
def self.pre_uninstall: () { (Uninstaller) -> untyped } -> Array[Proc]
|
556
856
|
|
857
|
+
# <!-- rdoc-file=lib/rubygems.rb -->
|
557
858
|
# The list of hooks to be run before Gem::Uninstaller#uninstall does any work
|
558
859
|
#
|
559
860
|
def self.pre_uninstall_hooks: () -> Array[Proc?]
|
560
861
|
|
862
|
+
# <!--
|
863
|
+
# rdoc-file=lib/rubygems.rb
|
864
|
+
# - prefix()
|
865
|
+
# -->
|
561
866
|
# The directory prefix this RubyGems was installed at. If your prefix is in a
|
562
867
|
# standard location (ie, rubygems is installed where you'd expect it to be),
|
563
868
|
# then prefix returns nil.
|
564
869
|
#
|
565
870
|
def self.prefix: () -> String?
|
566
871
|
|
872
|
+
# <!--
|
873
|
+
# rdoc-file=lib/rubygems.rb
|
874
|
+
# - read_binary(path)
|
875
|
+
# -->
|
567
876
|
# Safely read a file in binary mode on all platforms.
|
568
877
|
#
|
569
878
|
def self.read_binary: (String path) -> String
|
570
879
|
|
880
|
+
# <!--
|
881
|
+
# rdoc-file=lib/rubygems.rb
|
882
|
+
# - refresh()
|
883
|
+
# -->
|
571
884
|
# Refresh available gems from disk.
|
572
885
|
#
|
573
886
|
def self.refresh: () -> Array[Proc]
|
574
887
|
|
888
|
+
# <!--
|
889
|
+
# rdoc-file=lib/rubygems.rb
|
890
|
+
# - register_default_spec(spec)
|
891
|
+
# -->
|
575
892
|
# Register a Gem::Specification for default gem.
|
576
893
|
#
|
577
894
|
# Two formats for the specification are supported:
|
@@ -584,30 +901,59 @@ module Gem
|
|
584
901
|
#
|
585
902
|
def self.register_default_spec: (Specification spec) -> Array[String]
|
586
903
|
|
904
|
+
# <!--
|
905
|
+
# rdoc-file=lib/rubygems.rb
|
906
|
+
# - ruby()
|
907
|
+
# -->
|
587
908
|
# The path to the running Ruby interpreter.
|
588
909
|
#
|
589
910
|
def self.ruby: () -> String
|
590
911
|
|
912
|
+
# <!--
|
913
|
+
# rdoc-file=lib/rubygems.rb
|
914
|
+
# - ruby_api_version()
|
915
|
+
# -->
|
591
916
|
# Returns a String containing the API compatibility version of Ruby
|
592
917
|
#
|
593
918
|
def self.ruby_api_version: () -> String
|
594
919
|
|
920
|
+
# <!--
|
921
|
+
# rdoc-file=lib/rubygems/defaults.rb
|
922
|
+
# - ruby_engine()
|
923
|
+
# -->
|
924
|
+
#
|
595
925
|
def self.ruby_engine: () -> String
|
596
926
|
|
927
|
+
# <!--
|
928
|
+
# rdoc-file=lib/rubygems.rb
|
929
|
+
# - ruby_version()
|
930
|
+
# -->
|
597
931
|
# A Gem::Version for the currently running Ruby.
|
598
932
|
#
|
599
933
|
def self.ruby_version: () -> Version
|
600
934
|
|
935
|
+
# <!--
|
936
|
+
# rdoc-file=lib/rubygems.rb
|
937
|
+
# - rubygems_version()
|
938
|
+
# -->
|
601
939
|
# A Gem::Version for the currently running RubyGems
|
602
940
|
#
|
603
941
|
def self.rubygems_version: () -> Version
|
604
942
|
|
943
|
+
# <!--
|
944
|
+
# rdoc-file=lib/rubygems.rb
|
945
|
+
# - source_date_epoch()
|
946
|
+
# -->
|
605
947
|
# Returns the value of Gem.source_date_epoch_string, as a Time object.
|
606
948
|
#
|
607
949
|
# This is used throughout RubyGems for enabling reproducible builds.
|
608
950
|
#
|
609
951
|
def self.source_date_epoch: () -> Time
|
610
952
|
|
953
|
+
# <!--
|
954
|
+
# rdoc-file=lib/rubygems.rb
|
955
|
+
# - source_date_epoch_string()
|
956
|
+
# -->
|
611
957
|
# If the SOURCE_DATE_EPOCH environment variable is set, returns it's value.
|
612
958
|
# Otherwise, returns the time that `Gem.source_date_epoch_string` was first
|
613
959
|
# called in the same format as SOURCE_DATE_EPOCH.
|
@@ -626,11 +972,19 @@ module Gem
|
|
626
972
|
#
|
627
973
|
def self.source_date_epoch_string: () -> String
|
628
974
|
|
975
|
+
# <!--
|
976
|
+
# rdoc-file=lib/rubygems.rb
|
977
|
+
# - sources()
|
978
|
+
# -->
|
629
979
|
# Returns an Array of sources to fetch remote gems from. Uses default_sources if
|
630
980
|
# the sources list is empty.
|
631
981
|
#
|
632
982
|
def self.sources: () -> SourceList
|
633
983
|
|
984
|
+
# <!--
|
985
|
+
# rdoc-file=lib/rubygems.rb
|
986
|
+
# - sources=(new_sources)
|
987
|
+
# -->
|
634
988
|
# Need to be able to set the sources without calling Gem.sources.replace since
|
635
989
|
# that would cause an infinite loop.
|
636
990
|
#
|
@@ -639,35 +993,68 @@ module Gem
|
|
639
993
|
#
|
640
994
|
def self.sources=: (SourceList? new_sources) -> SourceList?
|
641
995
|
|
996
|
+
# <!--
|
997
|
+
# rdoc-file=lib/rubygems.rb
|
998
|
+
# - spec_cache_dir()
|
999
|
+
# -->
|
1000
|
+
#
|
642
1001
|
def self.spec_cache_dir: () -> String
|
643
1002
|
|
1003
|
+
# <!--
|
1004
|
+
# rdoc-file=lib/rubygems.rb
|
1005
|
+
# - suffix_pattern()
|
1006
|
+
# -->
|
644
1007
|
# Glob pattern for require-able path suffixes.
|
645
1008
|
#
|
646
1009
|
def self.suffix_pattern: () -> String
|
647
1010
|
|
1011
|
+
# <!--
|
1012
|
+
# rdoc-file=lib/rubygems.rb
|
1013
|
+
# - suffix_regexp()
|
1014
|
+
# -->
|
648
1015
|
# Regexp for require-able path suffixes.
|
649
1016
|
#
|
650
1017
|
def self.suffix_regexp: () -> Regexp
|
651
1018
|
|
1019
|
+
# <!--
|
1020
|
+
# rdoc-file=lib/rubygems.rb
|
1021
|
+
# - suffixes()
|
1022
|
+
# -->
|
652
1023
|
# Suffixes for require-able paths.
|
653
1024
|
#
|
654
1025
|
def self.suffixes: () -> Array[String]
|
655
1026
|
|
1027
|
+
# <!--
|
1028
|
+
# rdoc-file=lib/rubygems.rb
|
1029
|
+
# - time(msg, width = 0, display = Gem.configuration.verbose) { || ... }
|
1030
|
+
# -->
|
656
1031
|
# Prints the amount of time the supplied block takes to run using the debug UI
|
657
1032
|
# output.
|
658
1033
|
#
|
659
1034
|
def self.time: [T] (String msg, ?Integer width, ?boolish display) { () -> T } -> T
|
660
1035
|
|
1036
|
+
# <!--
|
1037
|
+
# rdoc-file=lib/rubygems.rb
|
1038
|
+
# - try_activate(path)
|
1039
|
+
# -->
|
661
1040
|
# Try to activate a gem containing `path`. Returns true if activation succeeded
|
662
1041
|
# or wasn't needed because it was already activated. Returns false if it can't
|
663
1042
|
# find the path in a gem.
|
664
1043
|
#
|
665
1044
|
def self.try_activate: (String path) -> bool
|
666
1045
|
|
1046
|
+
# <!--
|
1047
|
+
# rdoc-file=lib/rubygems.rb
|
1048
|
+
# - ui()
|
1049
|
+
# -->
|
667
1050
|
# Lazily loads DefaultUserInteraction and returns the default UI.
|
668
1051
|
#
|
669
1052
|
def self.ui: () -> StreamUI
|
670
1053
|
|
1054
|
+
# <!--
|
1055
|
+
# rdoc-file=lib/rubygems.rb
|
1056
|
+
# - use_gemdeps(path = nil)
|
1057
|
+
# -->
|
671
1058
|
# Looks for a gem dependency file at `path` and activates the gems in the file
|
672
1059
|
# if found. If the file is not found an ArgumentError is raised.
|
673
1060
|
#
|
@@ -687,23 +1074,43 @@ module Gem
|
|
687
1074
|
#
|
688
1075
|
def self.use_gemdeps: (?String path) -> void
|
689
1076
|
|
1077
|
+
# <!--
|
1078
|
+
# rdoc-file=lib/rubygems.rb
|
1079
|
+
# - use_paths(home, *paths)
|
1080
|
+
# -->
|
690
1081
|
# Use the `home` and `paths` values for Gem.dir and Gem.path. Used mainly by
|
691
1082
|
# the unit tests to provide environment isolation.
|
692
1083
|
#
|
693
1084
|
def self.use_paths: (String home, *String paths) -> Hash[String, String]
|
694
1085
|
|
1086
|
+
# <!--
|
1087
|
+
# rdoc-file=lib/rubygems/defaults.rb
|
1088
|
+
# - user_dir()
|
1089
|
+
# -->
|
695
1090
|
# Path for gems in the user's home directory
|
696
1091
|
#
|
697
1092
|
def self.user_dir: () -> String
|
698
1093
|
|
1094
|
+
# <!--
|
1095
|
+
# rdoc-file=lib/rubygems/defaults.rb
|
1096
|
+
# - user_home()
|
1097
|
+
# -->
|
699
1098
|
# The home directory for the user.
|
700
1099
|
#
|
701
1100
|
def self.user_home: () -> String
|
702
1101
|
|
1102
|
+
# <!--
|
1103
|
+
# rdoc-file=lib/rubygems.rb
|
1104
|
+
# - win_platform?()
|
1105
|
+
# -->
|
703
1106
|
# Is this a windows platform?
|
704
1107
|
#
|
705
1108
|
def self.win_platform?: () -> bool
|
706
1109
|
|
1110
|
+
# <!--
|
1111
|
+
# rdoc-file=lib/rubygems.rb
|
1112
|
+
# - write_binary(path, data)
|
1113
|
+
# -->
|
707
1114
|
# Safely write a file in binary mode on all platforms.
|
708
1115
|
#
|
709
1116
|
def self.write_binary: (String path, String data) -> Integer
|