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/pstore.rb -->
1
2
  # PStore implements a file based persistence mechanism based on a Hash. User
2
3
  # code can store hierarchies of Ruby objects (values) into the data store file
3
4
  # by name (keys). An object hierarchy may be just a single object. User code
@@ -82,6 +83,10 @@
82
83
  class PStore
83
84
  public
84
85
 
86
+ # <!--
87
+ # rdoc-file=lib/pstore.rb
88
+ # - [](name)
89
+ # -->
85
90
  # Retrieves a value from the PStore file data, by *name*. The hierarchy of Ruby
86
91
  # objects stored under that root *name* will be returned.
87
92
  #
@@ -90,6 +95,10 @@ class PStore
90
95
  #
91
96
  def []: (untyped name) -> untyped
92
97
 
98
+ # <!--
99
+ # rdoc-file=lib/pstore.rb
100
+ # - []=(name, value)
101
+ # -->
93
102
  # Stores an individual Ruby object or a hierarchy of Ruby objects in the data
94
103
  # store file under the root *name*. Assigning to a *name* already in the data
95
104
  # store clobbers the old data.
@@ -111,6 +120,10 @@ class PStore
111
120
  #
112
121
  def []=: (untyped name, untyped value) -> untyped
113
122
 
123
+ # <!--
124
+ # rdoc-file=lib/pstore.rb
125
+ # - abort()
126
+ # -->
114
127
  # Ends the current PStore#transaction, discarding any changes to the data store.
115
128
  #
116
129
  # ## Example:
@@ -132,6 +145,10 @@ class PStore
132
145
  #
133
146
  def abort: () -> untyped
134
147
 
148
+ # <!--
149
+ # rdoc-file=lib/pstore.rb
150
+ # - commit()
151
+ # -->
135
152
  # Ends the current PStore#transaction, committing any changes to the data store
136
153
  # immediately.
137
154
  #
@@ -155,6 +172,10 @@ class PStore
155
172
  #
156
173
  def commit: () -> nil
157
174
 
175
+ # <!--
176
+ # rdoc-file=lib/pstore.rb
177
+ # - delete(name)
178
+ # -->
158
179
  # Removes an object hierarchy from the data store, by *name*.
159
180
  #
160
181
  # **WARNING**: This method is only valid in a PStore#transaction and it cannot
@@ -162,6 +183,10 @@ class PStore
162
183
  #
163
184
  def delete: (untyped name) -> untyped
164
185
 
186
+ # <!--
187
+ # rdoc-file=lib/pstore.rb
188
+ # - fetch(name, default=PStore::Error)
189
+ # -->
165
190
  # This method is just like PStore#[], save that you may also provide a *default*
166
191
  # value for the object. In the event the specified *name* is not found in the
167
192
  # data store, your *default* will be returned instead. If you do not specify a
@@ -172,10 +197,18 @@ class PStore
172
197
  #
173
198
  def fetch: (untyped name, ?untyped default) -> untyped
174
199
 
200
+ # <!--
201
+ # rdoc-file=lib/pstore.rb
202
+ # - path()
203
+ # -->
175
204
  # Returns the path to the data store file.
176
205
  #
177
206
  def path: () -> untyped
178
207
 
208
+ # <!--
209
+ # rdoc-file=lib/pstore.rb
210
+ # - root?(name)
211
+ # -->
179
212
  # Returns true if the supplied *name* is currently in the data store.
180
213
  #
181
214
  # **WARNING**: This method is only valid in a PStore#transaction. It will
@@ -183,6 +216,10 @@ class PStore
183
216
  #
184
217
  def root?: (untyped name) -> bool
185
218
 
219
+ # <!--
220
+ # rdoc-file=lib/pstore.rb
221
+ # - roots()
222
+ # -->
186
223
  # Returns the names of all object hierarchies currently in the store.
187
224
  #
188
225
  # **WARNING**: This method is only valid in a PStore#transaction. It will
@@ -190,6 +227,10 @@ class PStore
190
227
  #
191
228
  def roots: () -> Array[untyped]
192
229
 
230
+ # <!--
231
+ # rdoc-file=lib/pstore.rb
232
+ # - transaction(read_only = false) { |pstore| ... }
233
+ # -->
193
234
  # Opens a new transaction for the data store. Code executed inside a block
194
235
  # passed to this method may read and write data to and from the data store file.
195
236
  #
@@ -207,6 +248,7 @@ class PStore
207
248
  #
208
249
  def transaction: (?untyped read_only) -> untyped
209
250
 
251
+ # <!-- rdoc-file=lib/pstore.rb -->
210
252
  # Whether PStore should do its best to prevent file corruptions, even when under
211
253
  # unlikely-to-occur error conditions such as out-of-space conditions and other
212
254
  # unusual OS filesystem errors. Setting this flag comes at the price in the form
@@ -218,25 +260,57 @@ class PStore
218
260
  #
219
261
  def ultra_safe: () -> untyped
220
262
 
263
+ # <!-- rdoc-file=lib/pstore.rb -->
264
+ # Whether PStore should do its best to prevent file corruptions, even when under
265
+ # unlikely-to-occur error conditions such as out-of-space conditions and other
266
+ # unusual OS filesystem errors. Setting this flag comes at the price in the form
267
+ # of a performance loss.
268
+ #
269
+ # This flag only has effect on platforms on which file renames are atomic (e.g.
270
+ # all POSIX platforms: Linux, MacOS X, FreeBSD, etc). The default value is
271
+ # false.
272
+ #
221
273
  def ultra_safe=: (untyped) -> untyped
222
274
 
223
275
  private
224
276
 
225
277
  def dump: (untyped table) -> untyped
226
278
 
279
+ # <!--
280
+ # rdoc-file=lib/pstore.rb
281
+ # - empty_marshal_checksum()
282
+ # -->
283
+ #
227
284
  def empty_marshal_checksum: () -> untyped
228
285
 
286
+ # <!--
287
+ # rdoc-file=lib/pstore.rb
288
+ # - empty_marshal_data()
289
+ # -->
290
+ #
229
291
  def empty_marshal_data: () -> untyped
230
292
 
293
+ # <!--
294
+ # rdoc-file=lib/pstore.rb
295
+ # - in_transaction()
296
+ # -->
231
297
  # Raises PStore::Error if the calling code is not in a PStore#transaction.
232
298
  #
233
299
  def in_transaction: () -> untyped
234
300
 
301
+ # <!--
302
+ # rdoc-file=lib/pstore.rb
303
+ # - in_transaction_wr()
304
+ # -->
235
305
  # Raises PStore::Error if the calling code is not in a PStore#transaction or if
236
306
  # the code is in a read-only PStore#transaction.
237
307
  #
238
308
  def in_transaction_wr: () -> untyped
239
309
 
310
+ # <!--
311
+ # rdoc-file=lib/pstore.rb
312
+ # - new(file, thread_safe = false)
313
+ # -->
240
314
  # To construct a PStore object, pass in the *file* path where you would like the
241
315
  # data to be stored.
242
316
  #
@@ -247,14 +321,27 @@ class PStore
247
321
 
248
322
  def load: (untyped content) -> untyped
249
323
 
324
+ # <!--
325
+ # rdoc-file=lib/pstore.rb
326
+ # - load_data(file, read_only)
327
+ # -->
250
328
  # Load the given PStore file. If `read_only` is true, the unmarshalled Hash will
251
329
  # be returned. If `read_only` is false, a 3-tuple will be returned: the
252
330
  # unmarshalled Hash, a checksum of the data, and the size of the data.
253
331
  #
254
332
  def load_data: (untyped file, untyped read_only) -> untyped
255
333
 
334
+ # <!--
335
+ # rdoc-file=lib/pstore.rb
336
+ # - on_windows?()
337
+ # -->
338
+ #
256
339
  def on_windows?: () -> bool
257
340
 
341
+ # <!--
342
+ # rdoc-file=lib/pstore.rb
343
+ # - open_and_lock_file(filename, read_only)
344
+ # -->
258
345
  # Open the specified filename (either in read-only mode or in read-write mode)
259
346
  # and lock it for reading or writing.
260
347
  #
@@ -265,10 +352,25 @@ class PStore
265
352
  #
266
353
  def open_and_lock_file: (untyped filename, untyped read_only) -> untyped
267
354
 
355
+ # <!--
356
+ # rdoc-file=lib/pstore.rb
357
+ # - save_data(original_checksum, original_file_size, file)
358
+ # -->
359
+ #
268
360
  def save_data: (untyped original_checksum, untyped original_file_size, untyped file) -> untyped
269
361
 
362
+ # <!--
363
+ # rdoc-file=lib/pstore.rb
364
+ # - save_data_with_atomic_file_rename_strategy(data, file)
365
+ # -->
366
+ #
270
367
  def save_data_with_atomic_file_rename_strategy: (untyped data, untyped file) -> untyped
271
368
 
369
+ # <!--
370
+ # rdoc-file=lib/pstore.rb
371
+ # - save_data_with_fast_strategy(data, file)
372
+ # -->
373
+ #
272
374
  def save_data_with_fast_strategy: (untyped data, untyped file) -> untyped
273
375
  end
274
376
 
data/stdlib/pty/0/pty.rbs CHANGED
@@ -1,5 +1,6 @@
1
+ # <!-- rdoc-file=ext/pty/pty.c -->
1
2
  # Creates and manages pseudo terminals (PTYs). See also
2
- # http://en.wikipedia.org/wiki/Pseudo_terminal
3
+ # https://en.wikipedia.org/wiki/Pseudo_terminal
3
4
  #
4
5
  # PTY allows you to allocate new terminals using ::open or ::spawn a new
5
6
  # terminal with a specific command.
@@ -42,18 +43,23 @@
42
43
  #
43
44
  # ## License
44
45
  #
45
- # C) Copyright 1998 by Akinori Ito.
46
+ # (c) Copyright 1998 by Akinori Ito.
46
47
  #
47
- # This software may be redistributed freely for this purpose, in full
48
- # or in part, provided that this entire copyright notice is included
49
- # on any copies of this software and applications and derivations thereof.
48
+ # This software may be redistributed freely for this purpose, in full or in
49
+ # part, provided that this entire copyright notice is included on any copies of
50
+ # this software and applications and derivations thereof.
50
51
  #
51
- # This software is provided on an "as is" basis, without warranty of any
52
- # kind, either expressed or implied, as to any matter including, but not
53
- # limited to warranty of fitness of purpose, or merchantability, or
54
- # results obtained from use of this software.
52
+ # This software is provided on an "as is" basis, without warranty of any kind,
53
+ # either expressed or implied, as to any matter including, but not limited to
54
+ # warranty of fitness of purpose, or merchantability, or results obtained from
55
+ # use of this software.
55
56
  #
56
57
  module PTY
58
+ # <!--
59
+ # rdoc-file=ext/pty/pty.c
60
+ # - PTY.check(pid, raise = false) => Process::Status or nil
61
+ # - PTY.check(pid, true) => nil or raises PTY::ChildExited
62
+ # -->
57
63
  # Checks the status of the child process specified by `pid`. Returns `nil` if
58
64
  # the process is still alive.
59
65
  #
@@ -68,12 +74,47 @@ module PTY
68
74
  #
69
75
  def self.check: (Integer pid, ?boolish raise) -> Process::Status?
70
76
 
77
+ # <!--
78
+ # rdoc-file=ext/pty/pty.c
79
+ # - PTY.spawn(command_line) { |r, w, pid| ... }
80
+ # - PTY.spawn(command_line) => [r, w, pid]
81
+ # - PTY.spawn(command, arguments, ...) { |r, w, pid| ... }
82
+ # - PTY.spawn(command, arguments, ...) => [r, w, pid]
83
+ # -->
84
+ # Spawns the specified command on a newly allocated pty. You can also use the
85
+ # alias ::getpty.
86
+ #
87
+ # The command's controlling tty is set to the slave device of the pty and its
88
+ # standard input/output/error is redirected to the slave device.
89
+ #
90
+ # `command` and `command_line` are the full commands to run, given a String. Any
91
+ # additional `arguments` will be passed to the command.
92
+ #
93
+ # ### Return values
94
+ #
95
+ # In the non-block form this returns an array of size three, `[r, w, pid]`.
96
+ #
97
+ # In the block form these same values will be yielded to the block:
98
+ #
99
+ # `r`
100
+ # : A readable IO that contains the command's standard output and standard
101
+ # error
102
+ # `w`
103
+ # : A writable IO that is the command's standard input
104
+ # `pid`
105
+ # : The process identifier for the command.
106
+ #
71
107
  alias self.getpty self.spawn
72
108
 
109
+ # <!--
110
+ # rdoc-file=ext/pty/pty.c
111
+ # - PTY.open => [master_io, slave_file]
112
+ # - PTY.open {|(master_io, slave_file)| ... } => block value
113
+ # -->
73
114
  # Allocates a pty (pseudo-terminal).
74
115
  #
75
- # In the block form, yields two arguments `master_io, slave_file` and the value
76
- # of the block is returned from `open`.
116
+ # In the block form, yields an array of two elements (`master_io, slave_file`)
117
+ # and the value of the block is returned from `open`.
77
118
  #
78
119
  # The IO and File are both closed after the block completes if they haven't been
79
120
  # already closed.
@@ -103,11 +144,19 @@ module PTY
103
144
  # require 'io/console'
104
145
  # PTY.open {|m, s|
105
146
  # s.raw!
106
- # ...
147
+ # # ...
107
148
  # }
149
+ #
108
150
  def self.open: () -> [ IO, File ]
109
- | [A] () { ([ IO , File ]) -> A } -> A
151
+ | [A] () { ([ IO, File ]) -> A } -> A
110
152
 
153
+ # <!--
154
+ # rdoc-file=ext/pty/pty.c
155
+ # - PTY.spawn(command_line) { |r, w, pid| ... }
156
+ # - PTY.spawn(command_line) => [r, w, pid]
157
+ # - PTY.spawn(command, arguments, ...) { |r, w, pid| ... }
158
+ # - PTY.spawn(command, arguments, ...) => [r, w, pid]
159
+ # -->
111
160
  # Spawns the specified command on a newly allocated pty. You can also use the
112
161
  # alias ::getpty.
113
162
  #
@@ -130,6 +179,7 @@ module PTY
130
179
  # : A writable IO that is the command's standard input
131
180
  # `pid`
132
181
  # : The process identifier for the command.
182
+ #
133
183
  def self.spawn: (*String command) -> [ IO, IO, Integer ]
134
- | (*String command) {([ IO , IO , Integer ]) -> void } -> void
184
+ | (*String command) { ([ IO, IO, Integer ]) -> void } -> void
135
185
  end