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
data/core/gc.rbs CHANGED
@@ -1,3 +1,4 @@
1
+ # <!-- rdoc-file=gc.rb -->
1
2
  # The GC module provides an interface to Ruby's mark and sweep garbage
2
3
  # collection mechanism.
3
4
  #
@@ -6,12 +7,20 @@
6
7
  # You may obtain information about the operation of the GC through GC::Profiler.
7
8
  #
8
9
  module GC
10
+ # <!--
11
+ # rdoc-file=gc.rb
12
+ # - GC.count -> Integer
13
+ # -->
9
14
  # The number of times GC occurred.
10
15
  #
11
16
  # It returns the number of times GC occurred since the process started.
12
17
  #
13
18
  def self.count: () -> Integer
14
19
 
20
+ # <!--
21
+ # rdoc-file=gc.rb
22
+ # - GC.disable -> true or false
23
+ # -->
15
24
  # Disables garbage collection, returning `true` if garbage collection was
16
25
  # already disabled.
17
26
  #
@@ -20,6 +29,10 @@ module GC
20
29
  #
21
30
  def self.disable: () -> bool
22
31
 
32
+ # <!--
33
+ # rdoc-file=gc.rb
34
+ # - GC.enable -> true or false
35
+ # -->
23
36
  # Enables garbage collection, returning `true` if garbage collection was
24
37
  # previously disabled.
25
38
  #
@@ -29,6 +42,15 @@ module GC
29
42
  #
30
43
  def self.enable: () -> bool
31
44
 
45
+ # <!--
46
+ # rdoc-file=gc.rb
47
+ # - GC.start -> nil
48
+ # - ObjectSpace.garbage_collect -> nil
49
+ # - include GC; garbage_collect -> nil
50
+ # - GC.start(full_mark: true, immediate_sweep: true) -> nil
51
+ # - ObjectSpace.garbage_collect(full_mark: true, immediate_sweep: true) -> nil
52
+ # - include GC; garbage_collect(full_mark: true, immediate_sweep: true) -> nil
53
+ # -->
32
54
  # Initiates garbage collection, even if manually disabled.
33
55
  #
34
56
  # This method is defined with keyword arguments that default to true:
@@ -44,50 +66,97 @@ module GC
44
66
  #
45
67
  def self.start: (?immediate_sweep: boolish immediate_sweep, ?immediate_mark: boolish immediate_mark, ?full_mark: boolish full_mark) -> nil
46
68
 
69
+ # <!--
70
+ # rdoc-file=gc.rb
71
+ # - GC.stat -> Hash
72
+ # - GC.stat(hash) -> Hash
73
+ # - GC.stat(:key) -> Numeric
74
+ # -->
47
75
  # Returns a Hash containing information about the GC.
48
76
  #
77
+ # The contents of the hash are implementation specific and may change in the
78
+ # future without notice.
79
+ #
49
80
  # The hash includes information about internal statistics about GC such as:
50
81
  #
51
- # {
52
- # :count=>0,
53
- # :heap_allocated_pages=>24,
54
- # :heap_sorted_length=>24,
55
- # :heap_allocatable_pages=>0,
56
- # :heap_available_slots=>9783,
57
- # :heap_live_slots=>7713,
58
- # :heap_free_slots=>2070,
59
- # :heap_final_slots=>0,
60
- # :heap_marked_slots=>0,
61
- # :heap_eden_pages=>24,
62
- # :heap_tomb_pages=>0,
63
- # :total_allocated_pages=>24,
64
- # :total_freed_pages=>0,
65
- # :total_allocated_objects=>7796,
66
- # :total_freed_objects=>83,
67
- # :malloc_increase_bytes=>2389312,
68
- # :malloc_increase_bytes_limit=>16777216,
69
- # :minor_gc_count=>0,
70
- # :major_gc_count=>0,
71
- # :remembered_wb_unprotected_objects=>0,
72
- # :remembered_wb_unprotected_objects_limit=>0,
73
- # :old_objects=>0,
74
- # :old_objects_limit=>0,
75
- # :oldmalloc_increase_bytes=>2389760,
76
- # :oldmalloc_increase_bytes_limit=>16777216
77
- # }
78
- #
79
- # The contents of the hash are implementation specific and may be changed in the
80
- # future.
81
- #
82
- # This method is only expected to work on C Ruby.
82
+ # count
83
+ # : The total number of garbage collections ran since application start (count
84
+ # includes both minor and major garbage collections)
85
+ # heap_allocated_pages
86
+ # : The total number of `:heap_eden_pages` + `:heap_tomb_pages`
87
+ # heap_sorted_length
88
+ # : The number of pages that can fit into the buffer that holds references to
89
+ # all pages
90
+ # heap_allocatable_pages
91
+ # : The total number of pages the application could allocate without
92
+ # additional GC
93
+ # heap_available_slots
94
+ # : The total number of slots in all `:heap_allocated_pages`
95
+ # heap_live_slots
96
+ # : The total number of slots which contain live objects
97
+ # heap_free_slots
98
+ # : The total number of slots which do not contain live objects
99
+ # heap_final_slots
100
+ # : The total number of slots with pending finalizers to be run
101
+ # heap_marked_slots
102
+ # : The total number of objects marked in the last GC
103
+ # heap_eden_pages
104
+ # : The total number of pages which contain at least one live slot
105
+ # heap_tomb_pages
106
+ # : The total number of pages which do not contain any live slots
107
+ # total_allocated_pages
108
+ # : The cumulative number of pages allocated since application start
109
+ # total_freed_pages
110
+ # : The cumulative number of pages freed since application start
111
+ # total_allocated_objects
112
+ # : The cumulative number of objects allocated since application start
113
+ # total_freed_objects
114
+ # : The cumulative number of objects freed since application start
115
+ # malloc_increase_bytes
116
+ # : Amount of memory allocated on the heap for objects. Decreased by any GC
117
+ # malloc_increase_bytes_limit
118
+ # : When `:malloc_increase_bytes` crosses this limit, GC is triggered
119
+ # minor_gc_count
120
+ # : The total number of minor garbage collections run since process start
121
+ # major_gc_count
122
+ # : The total number of major garbage collections run since process start
123
+ # remembered_wb_unprotected_objects
124
+ # : The total number of objects without write barriers
125
+ # remembered_wb_unprotected_objects_limit
126
+ # : When `:remembered_wb_unprotected_objects` crosses this limit, major GC is
127
+ # triggered
128
+ # old_objects
129
+ # : Number of live, old objects which have survived at least 3 garbage
130
+ # collections
131
+ # old_objects_limit
132
+ # : When `:old_objects` crosses this limit, major GC is triggered
133
+ # oldmalloc_increase_bytes
134
+ # : Amount of memory allocated on the heap for objects. Decreased by major GC
135
+ # oldmalloc_increase_bytes_limit
136
+ # : When `:old_malloc_increase_bytes` crosses this limit, major GC is
137
+ # triggered
138
+ #
139
+ #
140
+ # If the optional argument, hash, is given, it is overwritten and returned. This
141
+ # is intended to avoid probe effect.
142
+ #
143
+ # This method is only expected to work on CRuby.
83
144
  #
84
145
  def self.stat: (?::Hash[Symbol, Integer] arg0) -> ::Hash[Symbol, Integer]
85
146
  | (?Symbol arg0) -> Integer
86
147
 
148
+ # <!--
149
+ # rdoc-file=gc.rb
150
+ # - GC.stress -> integer, true or false
151
+ # -->
87
152
  # Returns current status of GC stress mode.
88
153
  #
89
154
  def self.stress: () -> (Integer | TrueClass | FalseClass)
90
155
 
156
+ # <!--
157
+ # rdoc-file=gc.rb
158
+ # - GC.stress = flag -> flag
159
+ # -->
91
160
  # Updates the GC stress mode.
92
161
  #
93
162
  # When stress mode is enabled, the GC is invoked at every GC opportunity: all
@@ -102,8 +171,33 @@ module GC
102
171
  #
103
172
  def self.stress=: (Integer | TrueClass | FalseClass flag) -> (Integer | TrueClass | FalseClass)
104
173
 
174
+ # <!--
175
+ # rdoc-file=gc.rb
176
+ # - GC.total_time -> int
177
+ # -->
178
+ # Return measured GC total time in nano seconds.
179
+ #
180
+ def self.total_time: () -> Integer
181
+
182
+ # <!--
183
+ # rdoc-file=gc.rb
184
+ # - GC.compact
185
+ # -->
186
+ # This function compacts objects together in Ruby's heap. It eliminates unused
187
+ # space (or fragmentation) in the heap by moving objects in to that unused
188
+ # space. This function returns a hash which contains statistics about which
189
+ # objects were moved. See `GC.latest_gc_info` for details about compaction
190
+ # statistics.
191
+ #
192
+ # This method is implementation specific and not expected to be implemented in
193
+ # any implementation besides MRI.
194
+ #
105
195
  def self.compact: () -> ::Hash[:considered | :moved, Hash[Symbol | Integer, Integer]]
106
196
 
197
+ # <!--
198
+ # rdoc-file=gc.rb
199
+ # - GC.verify_compaction_references(toward: nil, double_heap: false) -> hash
200
+ # -->
107
201
  # Verify compaction reference consistency.
108
202
  #
109
203
  # This method is implementation specific. During compaction, objects that were
@@ -117,6 +211,10 @@ module GC
117
211
  #
118
212
  def self.verify_compaction_references: () -> ::Hash[:considered | :moved, Hash[Symbol | Integer, Integer]]
119
213
 
214
+ # <!--
215
+ # rdoc-file=gc.c
216
+ # - GC.verify_internal_consistency -> nil
217
+ # -->
120
218
  # Verify internal consistency.
121
219
  #
122
220
  # This method is implementation specific. Now this method checks generational
@@ -124,27 +222,47 @@ module GC
124
222
  #
125
223
  def self.verify_internal_consistency: () -> nil
126
224
 
225
+ # <!--
226
+ # rdoc-file=gc.c
227
+ # - verify_transient_heap_internal_consistency()
228
+ # -->
229
+ #
127
230
  def self.verify_transient_heap_internal_consistency: () -> nil
128
231
 
232
+ # <!--
233
+ # rdoc-file=gc.rb
234
+ # - GC.latest_gc_info -> {:gc_by=>:newobj}
235
+ # - GC.latest_gc_info(hash) -> hash
236
+ # - GC.latest_gc_info(:major_by) -> :malloc
237
+ # -->
129
238
  # Returns information about the most recent garbage collection.
130
239
  #
240
+ # If the optional argument, hash, is given, it is overwritten and returned. This
241
+ # is intended to avoid probe effect.
242
+ #
131
243
  def self.latest_gc_info: () -> ::Hash[::Symbol, untyped]
132
244
  | [K] (?Hash[K, untyped] hash) -> ::Hash[::Symbol | K, untyped]
133
245
  | (Symbol key) -> untyped
134
246
 
247
+ # <!--
248
+ # rdoc-file=gc.rb
249
+ # - garbage_collect(full_mark: true, immediate_mark: true, immediate_sweep: true)
250
+ # -->
251
+ #
135
252
  def garbage_collect: (?immediate_sweep: boolish immediate_sweep, ?immediate_mark: boolish immediate_mark, ?full_mark: boolish full_mark) -> nil
136
253
  end
137
254
 
255
+ # <!-- rdoc-file=gc.c -->
138
256
  # internal constants
139
257
  #
140
- #
141
258
  GC::INTERNAL_CONSTANTS: Hash[Symbol, Integer]
142
259
 
260
+ # <!-- rdoc-file=gc.c -->
143
261
  # GC build options
144
262
  #
145
- #
146
263
  GC::OPTS: Array[String]
147
264
 
265
+ # <!-- rdoc-file=gc.c -->
148
266
  # The GC profiler provides access to information on GC runs including time,
149
267
  # length and object space size.
150
268
  #
@@ -161,22 +279,42 @@ GC::OPTS: Array[String]
161
279
  # See also GC.count, GC.malloc_allocated_size and GC.malloc_allocations
162
280
  #
163
281
  module GC::Profiler
282
+ # <!--
283
+ # rdoc-file=gc.c
284
+ # - GC::Profiler.clear -> nil
285
+ # -->
164
286
  # Clears the GC profiler data.
165
287
  #
166
288
  def self.clear: () -> void
167
289
 
290
+ # <!--
291
+ # rdoc-file=gc.c
292
+ # - GC::Profiler.disable -> nil
293
+ # -->
168
294
  # Stops the GC profiler.
169
295
  #
170
296
  def self.disable: () -> void
171
297
 
298
+ # <!--
299
+ # rdoc-file=gc.c
300
+ # - GC::Profiler.enable -> nil
301
+ # -->
172
302
  # Starts the GC profiler.
173
303
  #
174
304
  def self.enable: () -> void
175
305
 
306
+ # <!--
307
+ # rdoc-file=gc.c
308
+ # - GC::Profiler.enabled? -> true or false
309
+ # -->
176
310
  # The current status of GC profile mode.
177
311
  #
178
312
  def self.enabled?: () -> bool
179
313
 
314
+ # <!--
315
+ # rdoc-file=gc.c
316
+ # - GC::Profiler.raw_data -> [Hash, ...]
317
+ # -->
180
318
  # Returns an Array of individual raw profile data Hashes ordered from earliest
181
319
  # to latest by `:GC_INVOKE_TIME`.
182
320
  #
@@ -225,10 +363,19 @@ module GC::Profiler
225
363
  #
226
364
  def self.raw_data: () -> ::Array[::Hash[Symbol, untyped]]
227
365
 
366
+ # <!--
367
+ # rdoc-file=gc.c
368
+ # - GC::Profiler.report
369
+ # - GC::Profiler.report(io)
370
+ # -->
228
371
  # Writes the GC::Profiler.result to `$stdout` or the given IO object.
229
372
  #
230
373
  def self.report: (?IO io) -> void
231
374
 
375
+ # <!--
376
+ # rdoc-file=gc.c
377
+ # - GC::Profiler.result -> String
378
+ # -->
232
379
  # Returns a profile data report such as:
233
380
  #
234
381
  # GC 1 invokes.
@@ -237,6 +384,10 @@ module GC::Profiler
237
384
  #
238
385
  def self.result: () -> String
239
386
 
387
+ # <!--
388
+ # rdoc-file=gc.c
389
+ # - GC::Profiler.total_time -> float
390
+ # -->
240
391
  # The total time used for garbage collection in seconds
241
392
  #
242
393
  def self.total_time: () -> Float
@@ -147,7 +147,11 @@ $LOADED_FEATURES: Array[String]
147
147
  # Has a singleton method <code>$LOAD_PATH.resolve_feature_path(feature)</code>
148
148
  # that returns [+:rb+ or +:so+, path], which resolves the feature to
149
149
  # the path the original Kernel#require method would load.
150
- $LOAD_PATH: Array[String]
150
+ $LOAD_PATH: Array[String] & _LoadPathAPI
151
+
152
+ interface _LoadPathAPI
153
+ def resolve_feature_path: (String) -> [:rb | :so, String]?
154
+ end
151
155
 
152
156
  # Contains the name of the script being executed. May be assignable.
153
157
  $PROGRAM_NAME: String