rbs 2.0.0 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (179) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ruby.yml +5 -0
  3. data/CHANGELOG.md +23 -0
  4. data/README.md +6 -1
  5. data/core/array.rbs +2866 -1086
  6. data/core/basic_object.rbs +150 -30
  7. data/core/binding.rbs +33 -0
  8. data/core/builtin.rbs +4 -4
  9. data/core/class.rbs +43 -5
  10. data/core/comparable.rbs +57 -0
  11. data/core/complex.rbs +170 -4
  12. data/core/constants.rbs +51 -0
  13. data/core/deprecated.rbs +7 -0
  14. data/core/dir.rbs +305 -20
  15. data/core/encoding.rbs +472 -77
  16. data/core/enumerable.rbs +2173 -234
  17. data/core/enumerator.rbs +448 -182
  18. data/core/env.rbs +448 -1
  19. data/core/errno.rbs +1 -10
  20. data/core/errors.rbs +152 -2
  21. data/core/exception.rbs +201 -127
  22. data/core/false_class.rbs +27 -0
  23. data/core/fiber.rbs +118 -37
  24. data/core/fiber_error.rbs +8 -9
  25. data/core/file.rbs +1059 -139
  26. data/core/file_test.rbs +287 -32
  27. data/core/float.rbs +776 -300
  28. data/core/gc.rbs +185 -34
  29. data/core/global_variables.rbs +5 -1
  30. data/core/hash.rbs +1582 -649
  31. data/core/integer.rbs +974 -204
  32. data/core/io/buffer.rbs +710 -0
  33. data/core/io/wait.rbs +29 -8
  34. data/core/io.rbs +2438 -417
  35. data/core/kernel.rbs +2315 -316
  36. data/core/marshal.rbs +37 -2
  37. data/core/match_data.rbs +123 -6
  38. data/core/math.rbs +126 -6
  39. data/core/method.rbs +226 -102
  40. data/core/module.rbs +421 -45
  41. data/core/nil_class.rbs +64 -0
  42. data/core/numeric.rbs +620 -142
  43. data/core/object.rbs +453 -81
  44. data/core/object_space.rbs +92 -2
  45. data/core/proc.rbs +482 -285
  46. data/core/process.rbs +443 -34
  47. data/core/ractor.rbs +232 -9
  48. data/core/random.rbs +151 -52
  49. data/core/range.rbs +885 -160
  50. data/core/rational.rbs +122 -6
  51. data/core/rb_config.rbs +14 -4
  52. data/core/refinement.rbs +44 -0
  53. data/core/regexp.rbs +156 -14
  54. data/core/ruby_vm.rbs +42 -3
  55. data/core/signal.rbs +78 -39
  56. data/core/string.rbs +2123 -567
  57. data/core/string_io.rbs +204 -0
  58. data/core/struct.rbs +283 -28
  59. data/core/symbol.rbs +304 -30
  60. data/core/thread.rbs +1288 -688
  61. data/core/thread_group.rbs +66 -10
  62. data/core/time.rbs +643 -217
  63. data/core/trace_point.rbs +100 -12
  64. data/core/true_class.rbs +24 -0
  65. data/core/unbound_method.rbs +73 -7
  66. data/core/warning.rbs +37 -12
  67. data/docs/CONTRIBUTING.md +40 -34
  68. data/docs/stdlib.md +3 -102
  69. data/lib/rbs/annotate/annotations.rb +197 -0
  70. data/lib/rbs/annotate/formatter.rb +80 -0
  71. data/lib/rbs/annotate/rdoc_annotator.rb +398 -0
  72. data/lib/rbs/annotate/rdoc_source.rb +120 -0
  73. data/lib/rbs/annotate.rb +6 -0
  74. data/lib/rbs/cli.rb +45 -1
  75. data/lib/rbs/definition_builder.rb +5 -1
  76. data/lib/rbs/location_aux.rb +12 -0
  77. data/lib/rbs/prototype/rb.rb +12 -0
  78. data/lib/rbs/version.rb +1 -1
  79. data/sig/annotate/annotations.rbs +102 -0
  80. data/sig/annotate/formatter.rbs +24 -0
  81. data/sig/annotate/rdoc_annotater.rbs +82 -0
  82. data/sig/annotate/rdoc_source.rbs +30 -0
  83. data/sig/cli.rbs +2 -0
  84. data/sig/collection/{collections.rbs → sources.rbs} +0 -0
  85. data/sig/location.rbs +6 -0
  86. data/sig/method_types.rbs +5 -1
  87. data/sig/polyfill.rbs +78 -0
  88. data/stdlib/abbrev/0/abbrev.rbs +6 -0
  89. data/stdlib/abbrev/0/array.rbs +26 -0
  90. data/stdlib/base64/0/base64.rbs +31 -0
  91. data/stdlib/benchmark/0/benchmark.rbs +74 -3
  92. data/stdlib/bigdecimal/0/big_decimal.rbs +614 -165
  93. data/stdlib/bigdecimal-math/0/big_math.rbs +41 -64
  94. data/stdlib/cgi/0/core.rbs +59 -0
  95. data/stdlib/coverage/0/coverage.rbs +164 -2
  96. data/stdlib/csv/0/csv.rbs +2862 -398
  97. data/stdlib/date/0/date.rbs +483 -25
  98. data/stdlib/date/0/date_time.rbs +187 -12
  99. data/stdlib/dbm/0/dbm.rbs +152 -17
  100. data/stdlib/digest/0/digest.rbs +146 -0
  101. data/stdlib/erb/0/erb.rbs +65 -245
  102. data/stdlib/fiber/0/fiber.rbs +73 -91
  103. data/stdlib/fileutils/0/fileutils.rbs +301 -1
  104. data/stdlib/find/0/find.rbs +9 -0
  105. data/stdlib/forwardable/0/forwardable.rbs +65 -1
  106. data/stdlib/io-console/0/io-console.rbs +227 -15
  107. data/stdlib/ipaddr/0/ipaddr.rbs +161 -0
  108. data/stdlib/json/0/json.rbs +1146 -144
  109. data/stdlib/logger/0/formatter.rbs +24 -0
  110. data/stdlib/logger/0/log_device.rbs +64 -0
  111. data/stdlib/logger/0/logger.rbs +165 -13
  112. data/stdlib/logger/0/period.rbs +10 -0
  113. data/stdlib/logger/0/severity.rbs +26 -0
  114. data/stdlib/monitor/0/monitor.rbs +163 -0
  115. data/stdlib/mutex_m/0/mutex_m.rbs +35 -6
  116. data/stdlib/net-http/0/net-http.rbs +1492 -683
  117. data/stdlib/nkf/0/nkf.rbs +372 -0
  118. data/stdlib/objspace/0/objspace.rbs +149 -90
  119. data/stdlib/openssl/0/openssl.rbs +8108 -71
  120. data/stdlib/optparse/0/optparse.rbs +487 -19
  121. data/stdlib/pathname/0/pathname.rbs +425 -124
  122. data/stdlib/prettyprint/0/prettyprint.rbs +120 -99
  123. data/stdlib/prime/0/integer-extension.rbs +20 -2
  124. data/stdlib/prime/0/prime.rbs +88 -21
  125. data/stdlib/pstore/0/pstore.rbs +102 -0
  126. data/stdlib/pty/0/pty.rbs +64 -14
  127. data/stdlib/resolv/0/resolv.rbs +420 -31
  128. data/stdlib/rubygems/0/basic_specification.rbs +4 -1
  129. data/stdlib/rubygems/0/config_file.rbs +33 -1
  130. data/stdlib/rubygems/0/dependency_installer.rbs +4 -3
  131. data/stdlib/rubygems/0/installer.rbs +13 -1
  132. data/stdlib/rubygems/0/path_support.rbs +4 -1
  133. data/stdlib/rubygems/0/platform.rbs +5 -1
  134. data/stdlib/rubygems/0/request_set.rbs +44 -2
  135. data/stdlib/rubygems/0/requirement.rbs +65 -2
  136. data/stdlib/rubygems/0/rubygems.rbs +407 -0
  137. data/stdlib/rubygems/0/source_list.rbs +13 -0
  138. data/stdlib/rubygems/0/specification.rbs +21 -1
  139. data/stdlib/rubygems/0/stream_ui.rbs +3 -1
  140. data/stdlib/rubygems/0/uninstaller.rbs +8 -1
  141. data/stdlib/rubygems/0/version.rbs +60 -157
  142. data/stdlib/securerandom/0/securerandom.rbs +44 -0
  143. data/stdlib/set/0/set.rbs +420 -106
  144. data/stdlib/shellwords/0/shellwords.rbs +55 -77
  145. data/stdlib/singleton/0/singleton.rbs +20 -0
  146. data/stdlib/socket/0/addrinfo.rbs +210 -9
  147. data/stdlib/socket/0/basic_socket.rbs +103 -11
  148. data/stdlib/socket/0/ip_socket.rbs +31 -9
  149. data/stdlib/socket/0/socket.rbs +586 -38
  150. data/stdlib/socket/0/tcp_server.rbs +22 -2
  151. data/stdlib/socket/0/tcp_socket.rbs +12 -1
  152. data/stdlib/socket/0/udp_socket.rbs +25 -2
  153. data/stdlib/socket/0/unix_server.rbs +22 -2
  154. data/stdlib/socket/0/unix_socket.rbs +45 -5
  155. data/stdlib/strscan/0/string_scanner.rbs +210 -9
  156. data/stdlib/tempfile/0/tempfile.rbs +58 -10
  157. data/stdlib/time/0/time.rbs +208 -116
  158. data/stdlib/timeout/0/timeout.rbs +10 -0
  159. data/stdlib/tmpdir/0/tmpdir.rbs +13 -4
  160. data/stdlib/tsort/0/cyclic.rbs +1 -0
  161. data/stdlib/tsort/0/interfaces.rbs +1 -0
  162. data/stdlib/tsort/0/tsort.rbs +42 -0
  163. data/stdlib/uri/0/common.rbs +57 -8
  164. data/stdlib/uri/0/file.rbs +55 -109
  165. data/stdlib/uri/0/ftp.rbs +6 -3
  166. data/stdlib/uri/0/generic.rbs +556 -327
  167. data/stdlib/uri/0/http.rbs +26 -115
  168. data/stdlib/uri/0/https.rbs +8 -102
  169. data/stdlib/uri/0/ldap.rbs +143 -137
  170. data/stdlib/uri/0/ldaps.rbs +8 -102
  171. data/stdlib/uri/0/mailto.rbs +3 -0
  172. data/stdlib/uri/0/rfc2396_parser.rbs +66 -26
  173. data/stdlib/uri/0/ws.rbs +6 -3
  174. data/stdlib/uri/0/wss.rbs +5 -3
  175. data/stdlib/yaml/0/dbm.rbs +151 -87
  176. data/stdlib/yaml/0/store.rbs +6 -0
  177. data/stdlib/zlib/0/zlib.rbs +90 -31
  178. metadata +17 -5
  179. data/lib/rbs/location.rb +0 -221
@@ -1,3 +1,4 @@
1
+ # <!-- rdoc-file=lib/forwardable.rb -->
1
2
  # The Forwardable module provides delegation of specified methods to a
2
3
  # designated object, using the methods #def_delegator and #def_delegators.
3
4
  #
@@ -61,7 +62,7 @@
61
62
  # def_delegators :@q, :clear, :first, :push, :shift, :size
62
63
  # end
63
64
  #
64
- # q = Queue.new
65
+ # q = Thread::Queue.new
65
66
  # q.enq 1, 2, 3, 4, 5
66
67
  # q.push 6
67
68
  #
@@ -94,18 +95,36 @@
94
95
  # `delegate.rb`.
95
96
  #
96
97
  module Forwardable
98
+ # <!-- rdoc-file=lib/forwardable.rb -->
99
+ # Version of `forwardable.rb`
100
+ #
97
101
  VERSION: String
98
102
 
99
103
  FORWARDABLE_VERSION: String
100
104
 
105
+ # <!--
106
+ # rdoc-file=lib/forwardable.rb
107
+ # - delegate method => accessor
108
+ # - delegate [method, method, ...] => accessor
109
+ # -->
101
110
  # Takes a hash as its argument. The key is a symbol or an array of symbols.
102
111
  # These symbols correspond to method names, instance variable names, or constant
103
112
  # names (see def_delegator). The value is the accessor to which the methods
104
113
  # will be delegated.
114
+ #
105
115
  def instance_delegate: (Hash[Symbol | Array[Symbol], Symbol] hash) -> void
106
116
 
117
+ # <!--
118
+ # rdoc-file=lib/forwardable.rb
119
+ # - delegate(hash)
120
+ # -->
121
+ #
107
122
  alias delegate instance_delegate
108
123
 
124
+ # <!--
125
+ # rdoc-file=lib/forwardable.rb
126
+ # - def_instance_delegators(accessor, *methods)
127
+ # -->
109
128
  # Shortcut for defining multiple delegator methods, but with no provision for
110
129
  # using a different name. The following two code samples have the same effect:
111
130
  #
@@ -117,8 +136,17 @@ module Forwardable
117
136
  #
118
137
  def def_instance_delegators: (Symbol | String accessor, *Symbol methods) -> void
119
138
 
139
+ # <!--
140
+ # rdoc-file=lib/forwardable.rb
141
+ # - def_delegators(accessor, *methods)
142
+ # -->
143
+ #
120
144
  alias def_delegators def_instance_delegators
121
145
 
146
+ # <!--
147
+ # rdoc-file=lib/forwardable.rb
148
+ # - def_instance_delegator(accessor, method, ali = method)
149
+ # -->
122
150
  # Define `method` as delegator instance method with an optional alias name
123
151
  # `ali`. Method calls to `ali` will be delegated to `accessor.method`.
124
152
  # `accessor` should be a method name, instance variable name, or constant name.
@@ -145,9 +173,15 @@ module Forwardable
145
173
  #
146
174
  def def_instance_delegator: (Symbol | String accessor, Symbol method, ?Symbol ali) -> void
147
175
 
176
+ # <!--
177
+ # rdoc-file=lib/forwardable.rb
178
+ # - def_delegator(accessor, method, ali = method)
179
+ # -->
180
+ #
148
181
  alias def_delegator def_instance_delegator
149
182
  end
150
183
 
184
+ # <!-- rdoc-file=lib/forwardable.rb -->
151
185
  # SingleForwardable can be used to setup delegation at the object level as well.
152
186
  #
153
187
  # printer = String.new
@@ -175,13 +209,28 @@ end
175
209
  # def_instance_delegator and def_single_delegator, etc.
176
210
  #
177
211
  module SingleForwardable
212
+ # <!--
213
+ # rdoc-file=lib/forwardable.rb
214
+ # - delegate method => accessor
215
+ # - delegate [method, method, ...] => accessor
216
+ # -->
178
217
  # Takes a hash as its argument. The key is a symbol or an array of symbols.
179
218
  # These symbols correspond to method names. The value is the accessor to which
180
219
  # the methods will be delegated.
220
+ #
181
221
  def single_delegate: (Hash[Symbol | Array[Symbol], Symbol] hash) -> void
182
222
 
223
+ # <!--
224
+ # rdoc-file=lib/forwardable.rb
225
+ # - delegate(hash)
226
+ # -->
227
+ #
183
228
  alias delegate single_delegate
184
229
 
230
+ # <!--
231
+ # rdoc-file=lib/forwardable.rb
232
+ # - def_single_delegators(accessor, *methods)
233
+ # -->
185
234
  # Shortcut for defining multiple delegator methods, but with no provision for
186
235
  # using a different name. The following two code samples have the same effect:
187
236
  #
@@ -193,12 +242,27 @@ module SingleForwardable
193
242
  #
194
243
  def def_single_delegators: (Symbol | String accessor, *Symbol methods) -> void
195
244
 
245
+ # <!--
246
+ # rdoc-file=lib/forwardable.rb
247
+ # - def_delegators(accessor, *methods)
248
+ # -->
249
+ #
196
250
  alias def_delegators def_single_delegators
197
251
 
252
+ # <!--
253
+ # rdoc-file=lib/forwardable.rb
254
+ # - def_single_delegator(accessor, method, new_name=method)
255
+ # -->
198
256
  # Defines a method *method* which delegates to *accessor* (i.e. it calls the
199
257
  # method of the same name in *accessor*). If *new_name* is provided, it is used
200
258
  # as the name for the delegate method. Returns the name of the method defined.
259
+ #
201
260
  def def_single_delegator: (Symbol | String accessor, Symbol method, ?Symbol ali) -> void
202
261
 
262
+ # <!--
263
+ # rdoc-file=lib/forwardable.rb
264
+ # - def_delegator(accessor, method, ali = method)
265
+ # -->
266
+ #
203
267
  alias def_delegator def_single_delegator
204
268
  end
@@ -1,3 +1,4 @@
1
+ %a{annotate:rdoc:skip}
1
2
  class IO
2
3
  class ConsoleMode
3
4
  def echo=: (bool) -> bool
@@ -5,100 +6,276 @@ class IO
5
6
  def raw!: (?min: int, ?time: int, ?intr: bool) -> self
6
7
  end
7
8
 
9
+ # <!--
10
+ # rdoc-file=ext/io/console/console.c
11
+ # - IO.console -> #<File:/dev/tty>
12
+ # - IO.console(sym, *args)
13
+ # -->
8
14
  # Returns an File instance opened console.
9
15
  #
10
16
  # If `sym` is given, it will be sent to the opened console with `args` and the
11
17
  # result will be returned instead of the console IO itself.
18
+ #
19
+ # You must require 'io/console' to use this method.
20
+ #
12
21
  def self.console: () -> File?
13
22
  | (:close) -> nil
14
23
  | (Symbol sym, *untyped args) -> untyped
15
24
 
16
- # returns console window size
25
+ # <!--
26
+ # rdoc-file=ext/io/console/lib/console/size.rb
27
+ # - console_size()
28
+ # -->
17
29
  #
18
- # You must require 'io/console/size' to use this method.
19
- def self.console_size: () -> [Integer, Integer]
30
+ def self.console_size: () -> [ Integer, Integer ]
20
31
 
32
+ # <!--
33
+ # rdoc-file=ext/io/console/lib/console/size.rb
34
+ # - default_console_size()
35
+ # -->
21
36
  # fallback to console window size
22
37
  #
23
- # You must require 'io/console/size' to use this method.
24
- def self.default_console_size: -> [Integer, Integer]
38
+ def self.default_console_size: () -> [ Integer, Integer ]
25
39
 
40
+ # <!--
41
+ # rdoc-file=ext/io/console/console.c
42
+ # - beep()
43
+ # -->
44
+ #
26
45
  def beep: () -> self
27
46
 
47
+ # <!--
48
+ # rdoc-file=ext/io/console/console.c
49
+ # - check_winsize_changed()
50
+ # -->
51
+ #
28
52
  def check_winsize_changed: () { () -> void } -> self
53
+
54
+ # <!--
55
+ # rdoc-file=ext/io/console/console.c
56
+ # - clear_screen()
57
+ # -->
58
+ #
29
59
  def clear_screen: () -> self
30
60
 
61
+ # <!--
62
+ # rdoc-file=ext/io/console/console.c
63
+ # - io.console_mode -> mode
64
+ # -->
31
65
  # Returns a data represents the current console mode.
66
+ #
67
+ # You must require 'io/console' to use this method.
68
+ #
32
69
  def console_mode: () -> IO::ConsoleMode
33
70
 
71
+ # <!--
72
+ # rdoc-file=ext/io/console/console.c
73
+ # - io.console_mode = mode
74
+ # -->
34
75
  # Sets the console mode to `mode`.
76
+ #
77
+ # You must require 'io/console' to use this method.
78
+ #
35
79
  def console_mode=: (IO::ConsoleMode mode) -> IO::ConsoleMode
36
80
 
81
+ # <!--
82
+ # rdoc-file=ext/io/console/console.c
83
+ # - io.cooked {|io| }
84
+ # -->
37
85
  # Yields `self` within cooked mode.
38
86
  #
39
87
  # STDIN.cooked(&:gets)
40
88
  #
41
89
  # will read and return a line with echo back and line editing.
90
+ #
91
+ # You must require 'io/console' to use this method.
92
+ #
42
93
  def cooked: [T] () { (self) -> T } -> T
43
94
 
95
+ # <!--
96
+ # rdoc-file=ext/io/console/console.c
97
+ # - io.cooked!
98
+ # -->
44
99
  # Enables cooked mode.
45
100
  #
46
101
  # If the terminal mode needs to be back, use io.cooked { ... }.
102
+ #
103
+ # You must require 'io/console' to use this method.
104
+ #
47
105
  def cooked!: () -> self
48
106
 
49
- def cursor: () -> [Integer, Integer]
50
- def cursor=: ([Integer, Integer]) -> [Integer, Integer]
107
+ # <!--
108
+ # rdoc-file=ext/io/console/console.c
109
+ # - cursor()
110
+ # -->
111
+ #
112
+ def cursor: () -> [ Integer, Integer ]
51
113
 
114
+ # <!--
115
+ # rdoc-file=ext/io/console/console.c
116
+ # - cursor=(p1)
117
+ # -->
118
+ #
119
+ def cursor=: ([ Integer, Integer ]) -> [ Integer, Integer ]
120
+
121
+ # <!--
122
+ # rdoc-file=ext/io/console/console.c
123
+ # - cursor_down(p1)
124
+ # -->
125
+ #
52
126
  def cursor_down: (int) -> self
127
+
128
+ # <!--
129
+ # rdoc-file=ext/io/console/console.c
130
+ # - cursor_left(p1)
131
+ # -->
132
+ #
53
133
  def cursor_left: (int) -> self
134
+
135
+ # <!--
136
+ # rdoc-file=ext/io/console/console.c
137
+ # - cursor_right(p1)
138
+ # -->
139
+ #
54
140
  def cursor_right: (int) -> self
141
+
142
+ # <!--
143
+ # rdoc-file=ext/io/console/console.c
144
+ # - cursor_up(p1)
145
+ # -->
146
+ #
55
147
  def cursor_up: (int) -> self
56
148
 
149
+ # <!--
150
+ # rdoc-file=ext/io/console/console.c
151
+ # - io.echo = flag
152
+ # -->
57
153
  # Enables/disables echo back. On some platforms, all combinations of this flags
58
154
  # and raw/cooked mode may not be valid.
155
+ #
156
+ # You must require 'io/console' to use this method.
157
+ #
59
158
  def echo=: (bool flag) -> bool
60
159
 
160
+ # <!--
161
+ # rdoc-file=ext/io/console/console.c
162
+ # - io.echo? -> true or false
163
+ # -->
61
164
  # Returns `true` if echo back is enabled.
165
+ #
166
+ # You must require 'io/console' to use this method.
167
+ #
62
168
  def echo?: () -> bool
63
169
 
170
+ # <!--
171
+ # rdoc-file=ext/io/console/console.c
172
+ # - erase_line(p1)
173
+ # -->
174
+ #
64
175
  def erase_line: (0 | 1 | 2 | nil) -> self
176
+
177
+ # <!--
178
+ # rdoc-file=ext/io/console/console.c
179
+ # - erase_screen(p1)
180
+ # -->
181
+ #
65
182
  def erase_screen: (0 | 1 | 2 | 3 | nil) -> self
66
183
 
184
+ # <!--
185
+ # rdoc-file=ext/io/console/console.c
186
+ # - io.getch(min: nil, time: nil, intr: nil) -> char
187
+ # -->
67
188
  # Reads and returns a character in raw mode.
68
189
  #
69
190
  # See IO#raw for details on the parameters.
191
+ #
192
+ # You must require 'io/console' to use this method.
193
+ #
70
194
  def getch: (?min: int, ?time: int, ?intr: bool) -> String
71
195
 
72
- # Reads and returns a line without echo back.
73
- # Prints +prompt+ unless it is +nil+.
196
+ # <!--
197
+ # rdoc-file=ext/io/console/console.c
198
+ # - io.getpass(prompt=nil) -> string
199
+ # -->
200
+ # Reads and returns a line without echo back. Prints `prompt` unless it is
201
+ # `nil`.
202
+ #
203
+ # The newline character that terminates the read line is removed from the
204
+ # returned string, see String#chomp!.
205
+ #
206
+ # You must require 'io/console' to use this method.
74
207
  #
75
- # The newline character that terminates the
76
- # read line is removed from the returned string,
77
- # see String#chomp!.
78
208
  def getpass: (?String) -> String
79
209
 
210
+ # <!--
211
+ # rdoc-file=ext/io/console/console.c
212
+ # - goto(p1, p2)
213
+ # -->
214
+ #
80
215
  def goto: (int, int) -> self
81
216
 
217
+ # <!--
218
+ # rdoc-file=ext/io/console/console.c
219
+ # - goto_column(p1)
220
+ # -->
221
+ #
82
222
  def goto_column: (int) -> self
83
223
 
224
+ # <!--
225
+ # rdoc-file=ext/io/console/console.c
226
+ # - io.iflush
227
+ # -->
84
228
  # Flushes input buffer in kernel.
229
+ #
230
+ # You must require 'io/console' to use this method.
231
+ #
85
232
  def iflush: () -> self
86
233
 
234
+ # <!--
235
+ # rdoc-file=ext/io/console/console.c
236
+ # - io.ioflush
237
+ # -->
87
238
  # Flushes input and output buffers in kernel.
239
+ #
240
+ # You must require 'io/console' to use this method.
241
+ #
88
242
  def ioflush: () -> self
89
243
 
244
+ # <!--
245
+ # rdoc-file=ext/io/console/console.c
246
+ # - io.noecho {|io| }
247
+ # -->
90
248
  # Yields `self` with disabling echo back.
91
249
  #
92
250
  # STDIN.noecho(&:gets)
93
251
  #
94
252
  # will read and return a line without echo back.
253
+ #
254
+ # You must require 'io/console' to use this method.
255
+ #
95
256
  def noecho: [T] () { (self) -> T } -> T
96
257
 
258
+ # <!--
259
+ # rdoc-file=ext/io/console/console.c
260
+ # - io.oflush
261
+ # -->
97
262
  # Flushes output buffer in kernel.
263
+ #
264
+ # You must require 'io/console' to use this method.
265
+ #
98
266
  def oflush: () -> self
99
267
 
268
+ # <!--
269
+ # rdoc-file=ext/io/console/console.c
270
+ # - pressed?(p1)
271
+ # -->
272
+ #
100
273
  def pressed?: (Integer | Symbol | String) -> bool
101
274
 
275
+ # <!--
276
+ # rdoc-file=ext/io/console/console.c
277
+ # - io.raw(min: nil, time: nil, intr: nil) {|io| }
278
+ # -->
102
279
  # Yields `self` within raw mode, and returns the result of the block.
103
280
  #
104
281
  # STDIN.raw(&:gets)
@@ -115,23 +292,58 @@ class IO
115
292
  # special characters.
116
293
  #
117
294
  # Refer to the manual page of termios for further details.
295
+ #
296
+ # You must require 'io/console' to use this method.
297
+ #
118
298
  def raw: [T] (?min: int, ?time: int, ?intr: bool) { (self) -> T } -> T
119
299
 
300
+ # <!--
301
+ # rdoc-file=ext/io/console/console.c
302
+ # - io.raw!(min: nil, time: nil, intr: nil) -> io
303
+ # -->
120
304
  # Enables raw mode, and returns `io`.
121
305
  #
122
306
  # If the terminal mode needs to be back, use `io.raw { ... }`.
123
307
  #
124
308
  # See IO#raw for details on the parameters.
309
+ #
310
+ # You must require 'io/console' to use this method.
311
+ #
125
312
  def raw!: (?min: int, ?time: int, ?intr: bool) -> self
126
313
 
314
+ # <!--
315
+ # rdoc-file=ext/io/console/console.c
316
+ # - scroll_backward(p1)
317
+ # -->
318
+ #
127
319
  def scroll_backward: (int) -> self
320
+
321
+ # <!--
322
+ # rdoc-file=ext/io/console/console.c
323
+ # - scroll_forward(p1)
324
+ # -->
325
+ #
128
326
  def scroll_forward: (int) -> self
129
327
 
328
+ # <!--
329
+ # rdoc-file=ext/io/console/console.c
330
+ # - io.winsize -> [rows, columns]
331
+ # -->
130
332
  # Returns console size.
131
- def winsize: () -> [Integer, Integer]
333
+ #
334
+ # You must require 'io/console' to use this method.
335
+ #
336
+ def winsize: () -> [ Integer, Integer ]
132
337
 
338
+ # <!--
339
+ # rdoc-file=ext/io/console/console.c
340
+ # - io.winsize = [rows, columns]
341
+ # -->
133
342
  # Tries to set console size. The effect depends on the platform and the running
134
343
  # environment.
135
- def winsize=: ([Integer, Integer]) -> [Integer, Integer]
136
- | ([Integer, Integer, Integer, Integer]) -> [Integer, Integer, Integer, Integer]
344
+ #
345
+ # You must require 'io/console' to use this method.
346
+ #
347
+ def winsize=: ([ Integer, Integer ]) -> [ Integer, Integer ]
348
+ | ([ Integer, Integer, Integer, Integer ]) -> [ Integer, Integer, Integer, Integer ]
137
349
  end