rbs 2.0.0 → 2.2.2

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 (208) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/comments.yml +34 -0
  3. data/.github/workflows/ruby.yml +5 -0
  4. data/CHANGELOG.md +82 -0
  5. data/README.md +6 -1
  6. data/Rakefile +56 -21
  7. data/core/array.rbs +2866 -1086
  8. data/core/basic_object.rbs +150 -30
  9. data/core/binding.rbs +33 -0
  10. data/core/builtin.rbs +4 -4
  11. data/core/class.rbs +43 -5
  12. data/core/comparable.rbs +57 -0
  13. data/core/complex.rbs +170 -4
  14. data/core/constants.rbs +51 -0
  15. data/core/deprecated.rbs +7 -0
  16. data/core/dir.rbs +305 -20
  17. data/core/encoding.rbs +1214 -77
  18. data/core/enumerable.rbs +2173 -234
  19. data/core/enumerator.rbs +448 -182
  20. data/core/env.rbs +448 -1
  21. data/core/errno.rbs +1 -10
  22. data/core/errors.rbs +152 -2
  23. data/core/exception.rbs +201 -127
  24. data/core/false_class.rbs +27 -0
  25. data/core/fiber.rbs +118 -37
  26. data/core/fiber_error.rbs +8 -9
  27. data/core/file.rbs +1060 -142
  28. data/core/file_test.rbs +287 -32
  29. data/core/float.rbs +776 -300
  30. data/core/gc.rbs +185 -34
  31. data/core/global_variables.rbs +5 -1
  32. data/core/hash.rbs +1582 -649
  33. data/core/integer.rbs +974 -204
  34. data/core/io/buffer.rbs +710 -0
  35. data/core/io/wait.rbs +29 -8
  36. data/core/io.rbs +2438 -417
  37. data/core/kernel.rbs +2319 -318
  38. data/core/marshal.rbs +37 -2
  39. data/core/match_data.rbs +123 -6
  40. data/core/math.rbs +126 -6
  41. data/core/method.rbs +226 -102
  42. data/core/module.rbs +421 -45
  43. data/core/nil_class.rbs +64 -0
  44. data/core/numeric.rbs +620 -142
  45. data/core/object.rbs +453 -81
  46. data/core/object_space.rbs +92 -2
  47. data/core/proc.rbs +482 -285
  48. data/core/process.rbs +443 -34
  49. data/core/ractor.rbs +232 -9
  50. data/core/random.rbs +151 -52
  51. data/core/range.rbs +885 -160
  52. data/core/rational.rbs +122 -6
  53. data/core/rb_config.rbs +14 -4
  54. data/core/refinement.rbs +44 -0
  55. data/core/regexp.rbs +156 -14
  56. data/core/ruby_vm.rbs +42 -3
  57. data/core/signal.rbs +78 -39
  58. data/core/string.rbs +2123 -567
  59. data/core/string_io.rbs +204 -0
  60. data/core/struct.rbs +283 -28
  61. data/core/symbol.rbs +304 -30
  62. data/core/thread.rbs +1288 -688
  63. data/core/thread_group.rbs +66 -10
  64. data/core/time.rbs +643 -217
  65. data/core/trace_point.rbs +100 -12
  66. data/core/true_class.rbs +24 -0
  67. data/core/unbound_method.rbs +73 -7
  68. data/core/warning.rbs +37 -12
  69. data/docs/CONTRIBUTING.md +40 -34
  70. data/docs/stdlib.md +3 -102
  71. data/docs/syntax.md +54 -11
  72. data/ext/rbs_extension/extconf.rb +1 -0
  73. data/ext/rbs_extension/lexer.h +5 -0
  74. data/ext/rbs_extension/lexstate.c +6 -0
  75. data/ext/rbs_extension/parser.c +85 -10
  76. data/ext/rbs_extension/ruby_objs.c +4 -2
  77. data/ext/rbs_extension/ruby_objs.h +2 -2
  78. data/goodcheck.yml +0 -11
  79. data/lib/rbs/annotate/annotations.rb +197 -0
  80. data/lib/rbs/annotate/formatter.rb +80 -0
  81. data/lib/rbs/annotate/rdoc_annotator.rb +398 -0
  82. data/lib/rbs/annotate/rdoc_source.rb +120 -0
  83. data/lib/rbs/annotate.rb +6 -0
  84. data/lib/rbs/ast/members.rb +21 -13
  85. data/lib/rbs/buffer.rb +17 -11
  86. data/lib/rbs/cli.rb +48 -1
  87. data/lib/rbs/definition_builder/method_builder.rb +28 -16
  88. data/lib/rbs/definition_builder.rb +6 -2
  89. data/lib/rbs/environment.rb +8 -4
  90. data/lib/rbs/location_aux.rb +12 -0
  91. data/lib/rbs/namespace.rb +1 -1
  92. data/lib/rbs/prototype/rb.rb +12 -0
  93. data/lib/rbs/type_alias_regularity.rb +6 -4
  94. data/lib/rbs/type_name.rb +1 -1
  95. data/lib/rbs/types.rb +1 -1
  96. data/lib/rbs/validator.rb +6 -0
  97. data/lib/rbs/version.rb +1 -1
  98. data/lib/rbs/writer.rb +54 -4
  99. data/lib/rbs.rb +0 -2
  100. data/schema/typeParam.json +3 -3
  101. data/sig/annotate/annotations.rbs +102 -0
  102. data/sig/annotate/formatter.rbs +24 -0
  103. data/sig/annotate/rdoc_annotater.rbs +82 -0
  104. data/sig/annotate/rdoc_source.rbs +30 -0
  105. data/sig/buffer.rbs +6 -2
  106. data/sig/cli.rbs +2 -0
  107. data/sig/collection/{collections.rbs → sources.rbs} +0 -0
  108. data/sig/location.rbs +6 -0
  109. data/sig/members.rbs +24 -18
  110. data/sig/method_builder.rbs +5 -4
  111. data/sig/method_types.rbs +5 -1
  112. data/sig/polyfill.rbs +78 -0
  113. data/sig/validator.rbs +3 -1
  114. data/sig/writer.rbs +79 -2
  115. data/stdlib/abbrev/0/abbrev.rbs +6 -0
  116. data/stdlib/abbrev/0/array.rbs +26 -0
  117. data/stdlib/base64/0/base64.rbs +31 -0
  118. data/stdlib/benchmark/0/benchmark.rbs +74 -3
  119. data/stdlib/bigdecimal/0/big_decimal.rbs +614 -165
  120. data/stdlib/bigdecimal-math/0/big_math.rbs +41 -64
  121. data/stdlib/cgi/0/core.rbs +649 -21
  122. data/stdlib/coverage/0/coverage.rbs +164 -2
  123. data/stdlib/csv/0/csv.rbs +2862 -398
  124. data/stdlib/date/0/date.rbs +483 -25
  125. data/stdlib/date/0/date_time.rbs +187 -12
  126. data/stdlib/dbm/0/dbm.rbs +152 -17
  127. data/stdlib/digest/0/digest.rbs +146 -0
  128. data/stdlib/erb/0/erb.rbs +65 -245
  129. data/stdlib/fiber/0/fiber.rbs +73 -91
  130. data/stdlib/fileutils/0/fileutils.rbs +301 -1
  131. data/stdlib/find/0/find.rbs +9 -0
  132. data/stdlib/forwardable/0/forwardable.rbs +65 -1
  133. data/stdlib/io-console/0/io-console.rbs +227 -15
  134. data/stdlib/ipaddr/0/ipaddr.rbs +161 -0
  135. data/stdlib/json/0/json.rbs +1147 -145
  136. data/stdlib/logger/0/formatter.rbs +24 -0
  137. data/stdlib/logger/0/log_device.rbs +64 -0
  138. data/stdlib/logger/0/logger.rbs +165 -13
  139. data/stdlib/logger/0/period.rbs +10 -0
  140. data/stdlib/logger/0/severity.rbs +26 -0
  141. data/stdlib/monitor/0/monitor.rbs +163 -0
  142. data/stdlib/mutex_m/0/mutex_m.rbs +35 -6
  143. data/stdlib/net-http/0/manifest.yaml +1 -0
  144. data/stdlib/net-http/0/net-http.rbs +1513 -683
  145. data/stdlib/nkf/0/nkf.rbs +372 -0
  146. data/stdlib/objspace/0/objspace.rbs +149 -90
  147. data/stdlib/openssl/0/openssl.rbs +8108 -71
  148. data/stdlib/optparse/0/optparse.rbs +487 -19
  149. data/stdlib/pathname/0/pathname.rbs +425 -124
  150. data/stdlib/prettyprint/0/prettyprint.rbs +120 -99
  151. data/stdlib/prime/0/integer-extension.rbs +20 -2
  152. data/stdlib/prime/0/prime.rbs +88 -21
  153. data/stdlib/pstore/0/pstore.rbs +102 -0
  154. data/stdlib/pty/0/pty.rbs +64 -14
  155. data/stdlib/resolv/0/resolv.rbs +420 -31
  156. data/stdlib/rubygems/0/basic_specification.rbs +4 -1
  157. data/stdlib/rubygems/0/config_file.rbs +33 -1
  158. data/stdlib/rubygems/0/dependency_installer.rbs +4 -3
  159. data/stdlib/rubygems/0/installer.rbs +13 -1
  160. data/stdlib/rubygems/0/path_support.rbs +4 -1
  161. data/stdlib/rubygems/0/platform.rbs +5 -1
  162. data/stdlib/rubygems/0/request_set.rbs +44 -2
  163. data/stdlib/rubygems/0/requirement.rbs +65 -2
  164. data/stdlib/rubygems/0/rubygems.rbs +407 -0
  165. data/stdlib/rubygems/0/source_list.rbs +13 -0
  166. data/stdlib/rubygems/0/specification.rbs +21 -1
  167. data/stdlib/rubygems/0/stream_ui.rbs +3 -1
  168. data/stdlib/rubygems/0/uninstaller.rbs +8 -1
  169. data/stdlib/rubygems/0/version.rbs +60 -157
  170. data/stdlib/securerandom/0/securerandom.rbs +44 -0
  171. data/stdlib/set/0/set.rbs +423 -109
  172. data/stdlib/shellwords/0/shellwords.rbs +55 -77
  173. data/stdlib/singleton/0/singleton.rbs +20 -0
  174. data/stdlib/socket/0/addrinfo.rbs +210 -9
  175. data/stdlib/socket/0/basic_socket.rbs +103 -11
  176. data/stdlib/socket/0/ip_socket.rbs +31 -9
  177. data/stdlib/socket/0/socket.rbs +586 -38
  178. data/stdlib/socket/0/tcp_server.rbs +22 -2
  179. data/stdlib/socket/0/tcp_socket.rbs +12 -1
  180. data/stdlib/socket/0/udp_socket.rbs +25 -2
  181. data/stdlib/socket/0/unix_server.rbs +22 -2
  182. data/stdlib/socket/0/unix_socket.rbs +45 -5
  183. data/stdlib/strscan/0/string_scanner.rbs +210 -9
  184. data/stdlib/tempfile/0/tempfile.rbs +58 -10
  185. data/stdlib/time/0/time.rbs +208 -116
  186. data/stdlib/timeout/0/timeout.rbs +10 -0
  187. data/stdlib/tmpdir/0/tmpdir.rbs +13 -4
  188. data/stdlib/tsort/0/cyclic.rbs +1 -0
  189. data/stdlib/tsort/0/interfaces.rbs +1 -0
  190. data/stdlib/tsort/0/tsort.rbs +42 -0
  191. data/stdlib/uri/0/common.rbs +57 -8
  192. data/stdlib/uri/0/file.rbs +55 -109
  193. data/stdlib/uri/0/ftp.rbs +6 -3
  194. data/stdlib/uri/0/generic.rbs +558 -329
  195. data/stdlib/uri/0/http.rbs +60 -114
  196. data/stdlib/uri/0/https.rbs +8 -102
  197. data/stdlib/uri/0/ldap.rbs +143 -137
  198. data/stdlib/uri/0/ldaps.rbs +8 -102
  199. data/stdlib/uri/0/mailto.rbs +3 -0
  200. data/stdlib/uri/0/rfc2396_parser.rbs +66 -26
  201. data/stdlib/uri/0/ws.rbs +6 -3
  202. data/stdlib/uri/0/wss.rbs +5 -3
  203. data/stdlib/yaml/0/dbm.rbs +151 -87
  204. data/stdlib/yaml/0/store.rbs +6 -0
  205. data/stdlib/zlib/0/zlib.rbs +90 -31
  206. metadata +18 -6
  207. data/lib/rbs/location.rb +0 -221
  208. data/sig/char_scanner.rbs +0 -9
@@ -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