steep 0.11.1 → 0.12.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (299) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ruby.yml +27 -0
  3. data/.gitmodules +3 -0
  4. data/CHANGELOG.md +5 -0
  5. data/README.md +48 -90
  6. data/Rakefile +10 -6
  7. data/Steepfile +1 -0
  8. data/bin/setup +1 -0
  9. data/bin/smoke_runner.rb +9 -14
  10. data/exe/rbs +3 -0
  11. data/exe/ruby-signature +3 -0
  12. data/exe/steep +1 -0
  13. data/lib/steep.rb +32 -26
  14. data/lib/steep/annotation_parser.rb +167 -0
  15. data/lib/steep/ast/annotation/collection.rb +7 -7
  16. data/lib/steep/ast/types.rb +60 -0
  17. data/lib/steep/ast/types/any.rb +1 -1
  18. data/lib/steep/ast/types/factory.rb +535 -0
  19. data/lib/steep/ast/types/name.rb +3 -3
  20. data/lib/steep/ast/types/var.rb +1 -1
  21. data/lib/steep/cli.rb +56 -240
  22. data/lib/steep/drivers/annotations.rb +36 -19
  23. data/lib/steep/drivers/check.rb +55 -91
  24. data/lib/steep/drivers/init.rb +54 -0
  25. data/lib/steep/drivers/langserver.rb +241 -150
  26. data/lib/steep/drivers/print_project.rb +56 -0
  27. data/lib/steep/drivers/signature_error_printer.rb +25 -0
  28. data/lib/steep/drivers/trace_printer.rb +25 -0
  29. data/lib/steep/drivers/utils/driver_helper.rb +26 -0
  30. data/lib/steep/drivers/validate.rb +18 -38
  31. data/lib/steep/drivers/vendor.rb +46 -0
  32. data/lib/steep/drivers/watch.rb +78 -140
  33. data/lib/steep/errors.rb +22 -13
  34. data/lib/steep/interface/interface.rb +91 -0
  35. data/lib/steep/interface/method.rb +0 -4
  36. data/lib/steep/interface/method_type.rb +362 -2
  37. data/lib/steep/interface/substitution.rb +22 -0
  38. data/lib/steep/project.rb +25 -233
  39. data/lib/steep/project/dsl.rb +132 -0
  40. data/lib/steep/project/file.rb +93 -76
  41. data/lib/steep/project/file_loader.rb +63 -0
  42. data/lib/steep/project/options.rb +7 -0
  43. data/lib/steep/project/target.rb +190 -0
  44. data/lib/steep/signature/errors.rb +25 -77
  45. data/lib/steep/signature/validator.rb +122 -0
  46. data/lib/steep/source.rb +12 -7
  47. data/lib/steep/subtyping/check.rb +357 -633
  48. data/lib/steep/subtyping/constraints.rb +2 -2
  49. data/lib/steep/subtyping/trace.rb +23 -0
  50. data/lib/steep/type_construction.rb +509 -455
  51. data/lib/steep/type_inference/constant_env.rb +16 -24
  52. data/lib/steep/type_inference/type_env.rb +26 -18
  53. data/lib/steep/version.rb +1 -1
  54. data/sample/Steepfile +6 -0
  55. data/sample/lib/conference.rb +12 -0
  56. data/sample/sig/conference.rbs +6 -0
  57. data/smoke/alias/Steepfile +4 -0
  58. data/smoke/alias/a.rb +2 -2
  59. data/smoke/alias/{a.rbi → a.rbs} +1 -1
  60. data/smoke/and/Steepfile +4 -0
  61. data/smoke/array/Steepfile +4 -0
  62. data/smoke/array/a.rb +2 -2
  63. data/smoke/array/b.rb +4 -4
  64. data/smoke/array/c.rb +2 -2
  65. data/smoke/block/Steepfile +5 -0
  66. data/smoke/block/{a.rbi → a.rbs} +1 -1
  67. data/smoke/block/{c.rbi → c.rbs} +0 -0
  68. data/smoke/block/d.rb +6 -6
  69. data/smoke/case/Steepfile +4 -0
  70. data/smoke/case/a.rb +4 -3
  71. data/smoke/class/Steepfile +4 -0
  72. data/smoke/class/a.rb +1 -4
  73. data/smoke/class/a.rbs +24 -0
  74. data/smoke/class/h.rb +6 -2
  75. data/smoke/class/{h.rbi → h.rbs} +1 -2
  76. data/smoke/class/i.rb +1 -2
  77. data/smoke/class/i.rbs +9 -0
  78. data/smoke/const/Steepfile +4 -0
  79. data/smoke/dstr/Steepfile +4 -0
  80. data/smoke/ensure/Steepfile +4 -0
  81. data/smoke/ensure/a.rb +1 -1
  82. data/smoke/enumerator/Steepfile +4 -0
  83. data/smoke/enumerator/a.rb +7 -7
  84. data/smoke/enumerator/b.rb +6 -6
  85. data/smoke/extension/Steepfile +4 -0
  86. data/smoke/extension/{a.rbi → a.rbs} +2 -2
  87. data/smoke/extension/{e.rbi → e.rbs} +2 -2
  88. data/smoke/hash/Steepfile +4 -0
  89. data/smoke/hash/{a.rbi → a.rbs} +0 -0
  90. data/smoke/hash/b.rb +2 -2
  91. data/smoke/hash/c.rb +1 -1
  92. data/smoke/hash/e.rbs +3 -0
  93. data/smoke/hash/f.rb +1 -1
  94. data/smoke/hello/Steepfile +4 -0
  95. data/smoke/hello/hello.rbs +7 -0
  96. data/smoke/if/Steepfile +4 -0
  97. data/smoke/implements/Steepfile +4 -0
  98. data/smoke/implements/a.rbs +6 -0
  99. data/smoke/initialize/Steepfile +4 -0
  100. data/smoke/initialize/a.rbs +3 -0
  101. data/smoke/integer/Steepfile +4 -0
  102. data/smoke/integer/a.rb +5 -3
  103. data/smoke/interface/Steepfile +4 -0
  104. data/smoke/interface/{a.rbi → a.rbs} +0 -0
  105. data/smoke/kwbegin/Steepfile +4 -0
  106. data/smoke/lambda/Steepfile +4 -0
  107. data/smoke/lambda/a.rb +9 -2
  108. data/smoke/literal/Steepfile +4 -0
  109. data/smoke/literal/{literal_methods.rbi → literal_methods.rbs} +0 -0
  110. data/smoke/map/Steepfile +4 -0
  111. data/smoke/map/a.rb +1 -1
  112. data/smoke/method/Steepfile +4 -0
  113. data/smoke/method/{a.rbi → a.rbs} +0 -0
  114. data/smoke/method/b.rb +1 -4
  115. data/smoke/method/d.rb +1 -0
  116. data/smoke/method/d.rbs +3 -0
  117. data/smoke/module/Steepfile +4 -0
  118. data/smoke/module/a.rb +1 -1
  119. data/smoke/module/a.rbs +16 -0
  120. data/smoke/module/c.rb +1 -1
  121. data/smoke/regexp/Steepfile +4 -0
  122. data/smoke/regexp/a.rb +2 -2
  123. data/smoke/regexp/b.rb +16 -16
  124. data/smoke/regression/Steepfile +5 -0
  125. data/smoke/regression/array.rb +2 -2
  126. data/smoke/regression/hash.rb +2 -2
  127. data/smoke/regression/poly_new.rb +2 -0
  128. data/smoke/regression/poly_new.rbs +4 -0
  129. data/smoke/regression/set_divide.rb +2 -2
  130. data/smoke/rescue/Steepfile +4 -0
  131. data/smoke/rescue/a.rb +1 -1
  132. data/smoke/self/Steepfile +4 -0
  133. data/smoke/self/a.rbs +4 -0
  134. data/smoke/skip/Steepfile +4 -0
  135. data/smoke/stdout/Steepfile +4 -0
  136. data/smoke/stdout/{a.rbi → a.rbs} +1 -1
  137. data/smoke/super/Steepfile +4 -0
  138. data/smoke/super/a.rbs +10 -0
  139. data/smoke/type_case/Steepfile +4 -0
  140. data/smoke/type_case/a.rb +1 -1
  141. data/smoke/yield/Steepfile +4 -0
  142. data/smoke/yield/a.rb +2 -2
  143. data/steep.gemspec +14 -7
  144. data/vendor/ruby-signature/.github/workflows/ruby.yml +27 -0
  145. data/vendor/ruby-signature/.gitignore +12 -0
  146. data/vendor/ruby-signature/.rubocop.yml +15 -0
  147. data/vendor/ruby-signature/BSDL +22 -0
  148. data/vendor/ruby-signature/COPYING +56 -0
  149. data/vendor/ruby-signature/Gemfile +6 -0
  150. data/vendor/ruby-signature/README.md +93 -0
  151. data/vendor/ruby-signature/Rakefile +66 -0
  152. data/vendor/ruby-signature/bin/annotate-with-rdoc +156 -0
  153. data/vendor/ruby-signature/bin/console +14 -0
  154. data/vendor/ruby-signature/bin/query-rdoc +103 -0
  155. data/vendor/ruby-signature/bin/setup +10 -0
  156. data/vendor/ruby-signature/bin/sort +88 -0
  157. data/vendor/ruby-signature/bin/test_runner.rb +17 -0
  158. data/vendor/ruby-signature/docs/CONTRIBUTING.md +97 -0
  159. data/vendor/ruby-signature/docs/sigs.md +148 -0
  160. data/vendor/ruby-signature/docs/stdlib.md +152 -0
  161. data/vendor/ruby-signature/docs/syntax.md +528 -0
  162. data/vendor/ruby-signature/exe/rbs +3 -0
  163. data/vendor/ruby-signature/exe/ruby-signature +7 -0
  164. data/vendor/ruby-signature/lib/ruby/signature.rb +64 -0
  165. data/vendor/ruby-signature/lib/ruby/signature/ast/annotation.rb +29 -0
  166. data/vendor/ruby-signature/lib/ruby/signature/ast/comment.rb +29 -0
  167. data/vendor/ruby-signature/lib/ruby/signature/ast/declarations.rb +391 -0
  168. data/vendor/ruby-signature/lib/ruby/signature/ast/members.rb +364 -0
  169. data/vendor/ruby-signature/lib/ruby/signature/buffer.rb +52 -0
  170. data/vendor/ruby-signature/lib/ruby/signature/builtin_names.rb +54 -0
  171. data/vendor/ruby-signature/lib/ruby/signature/cli.rb +534 -0
  172. data/vendor/ruby-signature/lib/ruby/signature/constant.rb +28 -0
  173. data/vendor/ruby-signature/lib/ruby/signature/constant_table.rb +152 -0
  174. data/vendor/ruby-signature/lib/ruby/signature/definition.rb +172 -0
  175. data/vendor/ruby-signature/lib/ruby/signature/definition_builder.rb +921 -0
  176. data/vendor/ruby-signature/lib/ruby/signature/environment.rb +283 -0
  177. data/vendor/ruby-signature/lib/ruby/signature/environment_loader.rb +138 -0
  178. data/vendor/ruby-signature/lib/ruby/signature/environment_walker.rb +126 -0
  179. data/vendor/ruby-signature/lib/ruby/signature/errors.rb +189 -0
  180. data/vendor/ruby-signature/lib/ruby/signature/location.rb +104 -0
  181. data/vendor/ruby-signature/lib/ruby/signature/method_type.rb +125 -0
  182. data/vendor/ruby-signature/lib/ruby/signature/namespace.rb +93 -0
  183. data/vendor/ruby-signature/lib/ruby/signature/parser.y +1343 -0
  184. data/vendor/ruby-signature/lib/ruby/signature/prototype/rb.rb +441 -0
  185. data/vendor/ruby-signature/lib/ruby/signature/prototype/rbi.rb +579 -0
  186. data/vendor/ruby-signature/lib/ruby/signature/prototype/runtime.rb +383 -0
  187. data/vendor/ruby-signature/lib/ruby/signature/substitution.rb +48 -0
  188. data/vendor/ruby-signature/lib/ruby/signature/test.rb +28 -0
  189. data/vendor/ruby-signature/lib/ruby/signature/test/errors.rb +63 -0
  190. data/vendor/ruby-signature/lib/ruby/signature/test/hook.rb +290 -0
  191. data/vendor/ruby-signature/lib/ruby/signature/test/setup.rb +58 -0
  192. data/vendor/ruby-signature/lib/ruby/signature/test/spy.rb +324 -0
  193. data/vendor/ruby-signature/lib/ruby/signature/test/test_helper.rb +185 -0
  194. data/vendor/ruby-signature/lib/ruby/signature/test/type_check.rb +256 -0
  195. data/vendor/ruby-signature/lib/ruby/signature/type_name.rb +72 -0
  196. data/vendor/ruby-signature/lib/ruby/signature/types.rb +932 -0
  197. data/vendor/ruby-signature/lib/ruby/signature/variance_calculator.rb +140 -0
  198. data/vendor/ruby-signature/lib/ruby/signature/vendorer.rb +49 -0
  199. data/vendor/ruby-signature/lib/ruby/signature/version.rb +5 -0
  200. data/vendor/ruby-signature/lib/ruby/signature/writer.rb +271 -0
  201. data/vendor/ruby-signature/ruby-signature.gemspec +45 -0
  202. data/vendor/ruby-signature/stdlib/abbrev/abbrev.rbs +3 -0
  203. data/vendor/ruby-signature/stdlib/base64/base64.rbs +15 -0
  204. data/vendor/ruby-signature/stdlib/builtin/array.rbs +1997 -0
  205. data/vendor/ruby-signature/stdlib/builtin/basic_object.rbs +280 -0
  206. data/vendor/ruby-signature/stdlib/builtin/binding.rbs +177 -0
  207. data/vendor/ruby-signature/stdlib/builtin/builtin.rbs +35 -0
  208. data/vendor/ruby-signature/stdlib/builtin/class.rbs +145 -0
  209. data/vendor/ruby-signature/stdlib/builtin/comparable.rbs +116 -0
  210. data/vendor/ruby-signature/stdlib/builtin/complex.rbs +400 -0
  211. data/vendor/ruby-signature/stdlib/builtin/constants.rbs +37 -0
  212. data/vendor/ruby-signature/stdlib/builtin/data.rbs +5 -0
  213. data/vendor/ruby-signature/stdlib/builtin/deprecated.rbs +2 -0
  214. data/vendor/ruby-signature/stdlib/builtin/dir.rbs +419 -0
  215. data/vendor/ruby-signature/stdlib/builtin/encoding.rbs +606 -0
  216. data/vendor/ruby-signature/stdlib/builtin/enumerable.rbs +404 -0
  217. data/vendor/ruby-signature/stdlib/builtin/enumerator.rbs +260 -0
  218. data/vendor/ruby-signature/stdlib/builtin/errno.rbs +781 -0
  219. data/vendor/ruby-signature/stdlib/builtin/errors.rbs +582 -0
  220. data/vendor/ruby-signature/stdlib/builtin/exception.rbs +193 -0
  221. data/vendor/ruby-signature/stdlib/builtin/false_class.rbs +40 -0
  222. data/vendor/ruby-signature/stdlib/builtin/fiber.rbs +68 -0
  223. data/vendor/ruby-signature/stdlib/builtin/fiber_error.rbs +12 -0
  224. data/vendor/ruby-signature/stdlib/builtin/file.rbs +476 -0
  225. data/vendor/ruby-signature/stdlib/builtin/file_test.rbs +59 -0
  226. data/vendor/ruby-signature/stdlib/builtin/float.rbs +696 -0
  227. data/vendor/ruby-signature/stdlib/builtin/gc.rbs +121 -0
  228. data/vendor/ruby-signature/stdlib/builtin/hash.rbs +1029 -0
  229. data/vendor/ruby-signature/stdlib/builtin/integer.rbs +710 -0
  230. data/vendor/ruby-signature/stdlib/builtin/io.rbs +683 -0
  231. data/vendor/ruby-signature/stdlib/builtin/kernel.rbs +574 -0
  232. data/vendor/ruby-signature/stdlib/builtin/marshal.rbs +135 -0
  233. data/vendor/ruby-signature/stdlib/builtin/match_data.rbs +141 -0
  234. data/vendor/ruby-signature/stdlib/builtin/math.rbs +66 -0
  235. data/vendor/ruby-signature/stdlib/builtin/method.rbs +182 -0
  236. data/vendor/ruby-signature/stdlib/builtin/module.rbs +248 -0
  237. data/vendor/ruby-signature/stdlib/builtin/nil_class.rbs +82 -0
  238. data/vendor/ruby-signature/stdlib/builtin/numeric.rbs +409 -0
  239. data/vendor/ruby-signature/stdlib/builtin/object.rbs +824 -0
  240. data/vendor/ruby-signature/stdlib/builtin/proc.rbs +426 -0
  241. data/vendor/ruby-signature/stdlib/builtin/process.rbs +354 -0
  242. data/vendor/ruby-signature/stdlib/builtin/random.rbs +93 -0
  243. data/vendor/ruby-signature/stdlib/builtin/range.rbs +226 -0
  244. data/vendor/ruby-signature/stdlib/builtin/rational.rbs +424 -0
  245. data/vendor/ruby-signature/stdlib/builtin/rb_config.rbs +10 -0
  246. data/vendor/ruby-signature/stdlib/builtin/regexp.rbs +131 -0
  247. data/vendor/ruby-signature/stdlib/builtin/ruby_vm.rbs +14 -0
  248. data/vendor/ruby-signature/stdlib/builtin/signal.rbs +55 -0
  249. data/vendor/ruby-signature/stdlib/builtin/string.rbs +770 -0
  250. data/vendor/ruby-signature/stdlib/builtin/string_io.rbs +13 -0
  251. data/vendor/ruby-signature/stdlib/builtin/struct.rbs +40 -0
  252. data/vendor/ruby-signature/stdlib/builtin/symbol.rbs +230 -0
  253. data/vendor/ruby-signature/stdlib/builtin/thread.rbs +1112 -0
  254. data/vendor/ruby-signature/stdlib/builtin/thread_group.rbs +23 -0
  255. data/vendor/ruby-signature/stdlib/builtin/time.rbs +739 -0
  256. data/vendor/ruby-signature/stdlib/builtin/trace_point.rbs +91 -0
  257. data/vendor/ruby-signature/stdlib/builtin/true_class.rbs +46 -0
  258. data/vendor/ruby-signature/stdlib/builtin/unbound_method.rbs +159 -0
  259. data/vendor/ruby-signature/stdlib/builtin/warning.rbs +17 -0
  260. data/vendor/ruby-signature/stdlib/erb/erb.rbs +18 -0
  261. data/vendor/ruby-signature/stdlib/find/find.rbs +44 -0
  262. data/vendor/ruby-signature/stdlib/pathname/pathname.rbs +21 -0
  263. data/vendor/ruby-signature/stdlib/prime/integer-extension.rbs +23 -0
  264. data/vendor/ruby-signature/stdlib/prime/prime.rbs +188 -0
  265. data/vendor/ruby-signature/stdlib/securerandom/securerandom.rbs +9 -0
  266. data/vendor/ruby-signature/stdlib/set/set.rbs +77 -0
  267. data/vendor/ruby-signature/stdlib/tmpdir/tmpdir.rbs +53 -0
  268. metadata +244 -54
  269. data/.travis.yml +0 -7
  270. data/lib/steep/ast/signature/alias.rb +0 -19
  271. data/lib/steep/ast/signature/class.rb +0 -33
  272. data/lib/steep/ast/signature/const.rb +0 -17
  273. data/lib/steep/ast/signature/env.rb +0 -138
  274. data/lib/steep/ast/signature/extension.rb +0 -21
  275. data/lib/steep/ast/signature/gvar.rb +0 -17
  276. data/lib/steep/ast/signature/interface.rb +0 -31
  277. data/lib/steep/ast/signature/members.rb +0 -115
  278. data/lib/steep/ast/signature/module.rb +0 -21
  279. data/lib/steep/drivers/print_interface.rb +0 -94
  280. data/lib/steep/drivers/scaffold.rb +0 -321
  281. data/lib/steep/drivers/utils/each_signature.rb +0 -31
  282. data/lib/steep/interface/abstract.rb +0 -68
  283. data/lib/steep/interface/builder.rb +0 -637
  284. data/lib/steep/interface/instantiated.rb +0 -163
  285. data/lib/steep/interface/ivar_chain.rb +0 -26
  286. data/lib/steep/parser.y +0 -1278
  287. data/lib/steep/project/listener.rb +0 -53
  288. data/smoke/class/a.rbi +0 -24
  289. data/smoke/class/d.rb +0 -9
  290. data/smoke/class/e.rb +0 -12
  291. data/smoke/class/i.rbi +0 -9
  292. data/smoke/hash/e.rbi +0 -3
  293. data/smoke/hello/hello.rbi +0 -7
  294. data/smoke/implements/a.rbi +0 -6
  295. data/smoke/initialize/a.rbi +0 -3
  296. data/smoke/module/a.rbi +0 -16
  297. data/smoke/self/a.rbi +0 -4
  298. data/smoke/super/a.rbi +0 -10
  299. data/stdlib/builtin.rbi +0 -787
@@ -1,53 +0,0 @@
1
- module Steep
2
- class Project
3
- class NullListener
4
- def parse_signature(project:, file:)
5
- yield
6
- end
7
-
8
- def parse_source(project:, file:)
9
- yield
10
- end
11
-
12
- def check(project:)
13
- yield
14
- end
15
-
16
- def validate_signature(project:)
17
- yield
18
- end
19
-
20
- def type_check_source(project:, file:)
21
- yield
22
- end
23
-
24
- def clear_project(project:)
25
- yield
26
- end
27
-
28
- def load_signature(project:)
29
- yield
30
- end
31
- end
32
-
33
- class SyntaxErrorRaisingListener < NullListener
34
- def load_signature(project:)
35
- yield.tap do
36
- case signature = project.signature
37
- when SignatureHasSyntaxError
38
- raise signature.errors.values[0]
39
- end
40
- end
41
- end
42
-
43
- def parse_source(project:, file:)
44
- yield.tap do
45
- case source = file.source
46
- when ::Parser::SyntaxError
47
- raise source
48
- end
49
- end
50
- end
51
- end
52
- end
53
- end
data/smoke/class/a.rbi DELETED
@@ -1,24 +0,0 @@
1
- class A
2
- def foo: (String) -> any
3
- def bar: () -> String
4
- def self.baz: -> Integer
5
- end
6
-
7
- class B
8
- def name: -> String
9
- end
10
-
11
- class C
12
- def (constructor) foo: -> instance
13
- def bar: -> instance
14
- end
15
-
16
- class D
17
- def initialize: (String) -> any
18
- def foo: -> any
19
- end
20
-
21
- class E
22
- def initialize: () -> any
23
- def foo: -> any
24
- end
data/smoke/class/d.rb DELETED
@@ -1,9 +0,0 @@
1
- # @type const A: A.class
2
- # @type const B: A.class constructor
3
- # @type const C: A.class noconstructor
4
-
5
- # !expects NoMethodError: type=::A.class, method=new
6
- a = A.new
7
- b = B.new
8
- # !expects NoMethodError: type=::A.class noconstructor, method=new
9
- c = C.new
data/smoke/class/e.rb DELETED
@@ -1,12 +0,0 @@
1
- class C
2
- # @implements C
3
-
4
- def foo
5
- self.class.new
6
- end
7
-
8
- def bar
9
- # !expects NoMethodError: type=::C.class noconstructor, method=new
10
- self.class.new
11
- end
12
- end
data/smoke/class/i.rbi DELETED
@@ -1,9 +0,0 @@
1
- class IncompatibleSuper
2
- def foo: () -> Integer
3
- def initialize: (name: String) -> any
4
- end
5
-
6
- class IncompatibleChild < IncompatibleSuper
7
- def initialize: () -> any
8
- def (incompatible) foo: (Object) -> String
9
- end
data/smoke/hash/e.rbi DELETED
@@ -1,3 +0,0 @@
1
- class Foo
2
- def get: <'a> ({ foo: 'a }) -> 'a
3
- end
@@ -1,7 +0,0 @@
1
- interface _Foo
2
- def foo: -> any
3
- end
4
-
5
- interface _Bar
6
- def bar: -> any
7
- end
@@ -1,6 +0,0 @@
1
- class A
2
- def foo: -> any
3
- def baz: -> any
4
- def self.bar: -> any
5
- def self.baz: -> any
6
- end
@@ -1,3 +0,0 @@
1
- class A
2
- def initialize: () -> any
3
- end
data/smoke/module/a.rbi DELETED
@@ -1,16 +0,0 @@
1
- interface _Each<'a, 'b>
2
- def each: { ('a) -> any } -> 'b
3
- end
4
-
5
- module A : _Each<Integer, A>
6
- def count: () -> Integer
7
- end
8
-
9
- module X
10
- def foo: () -> Integer
11
- end
12
-
13
- module Palette
14
- def self?.defacto_palette: -> Array<Array<Integer>>
15
- def self.nestopia_palette: -> Array<Array<Integer>>
16
- end
data/smoke/self/a.rbi DELETED
@@ -1,4 +0,0 @@
1
- class A
2
- def foo: -> any
3
- def bar: -> any
4
- end
data/smoke/super/a.rbi DELETED
@@ -1,10 +0,0 @@
1
- class A
2
- def foo: (any) -> Integer
3
- include M
4
-
5
- def baz: () -> any
6
- end
7
-
8
- module M
9
- def foo: (any) -> Object
10
- end
data/stdlib/builtin.rbi DELETED
@@ -1,787 +0,0 @@
1
- class BasicObject
2
- def __id__: -> Integer
3
- end
4
-
5
- class Object < BasicObject
6
- include Kernel
7
- def tap: { (self) -> any } -> self
8
- def to_s: -> String
9
- def hash: -> Integer
10
- def eql?: (any) -> bool
11
- def ==: (any) -> bool
12
- def ===: (any) -> bool
13
- def !=: (any) -> bool
14
- def class: -> class
15
- def is_a?: (Module) -> bool
16
- def inspect: -> String
17
- def freeze: -> self
18
- def method: (Symbol) -> Method
19
- def yield_self: <'a>{ (self) -> 'a } -> 'a
20
- def dup: -> self
21
- def send: (Symbol, *any) -> any
22
- def __send__: (Symbol, *any) -> any
23
- def instance_variable_get: (Symbol) -> any
24
- def nil?: -> bool
25
- def !: -> bool
26
- def Array: (any) -> Array<any>
27
- def Hash: (any) -> Hash<any, any>
28
- def instance_eval: <'x> { (self) -> 'x } -> 'x
29
- | (String, ?String, ?Integer) -> any
30
- def define_singleton_method: (Symbol | String, any) -> Symbol
31
- | (Symbol) { (*any) -> any } -> Symbol
32
- end
33
-
34
- class Module
35
- def attr_reader: (*any) -> any
36
- def class: -> any
37
- def module_function: (*Symbol) -> any
38
- | -> any
39
- def extend: (Module) -> any
40
- def attr_accessor: (*Symbol) -> any
41
- def attr_writer: (*Symbol) -> any
42
- def include: (Module) -> bool
43
- def prepend: (Module) -> bool
44
- end
45
-
46
- class Method
47
- end
48
-
49
- class Class < Module
50
- def class: -> Class.class
51
- def allocate: -> any
52
- end
53
-
54
- module Kernel
55
- def raise: () -> any
56
- | (String) -> any
57
- | (*any) -> any
58
-
59
- def block_given?: -> bool
60
- def enum_for: (Symbol, *any) -> any
61
- def require_relative: (*String) -> void
62
- def require: (*String) -> void
63
- def loop: { () -> void } -> void
64
- def puts: (*any) -> void
65
- def eval: (String, ? Integer?, ?String) -> any
66
- def Integer: (String, Integer) -> Integer
67
- | (_ToI | _ToInt) -> Integer
68
- end
69
-
70
- class Array<'a>
71
- include Enumerable<'a, self>
72
-
73
- def initialize: (?Integer, ?'a) -> any
74
- | (self) -> any
75
- | (Integer) { (Integer) -> 'a } -> any
76
-
77
- def *: (Integer) -> self
78
- | (String) -> String
79
- def -: (self) -> self
80
- def +: (self) -> self
81
- def <<: ('a) -> self
82
-
83
- def []: (Integer) -> 'a
84
- | (Range<Integer>) -> self?
85
- | (0, Integer) -> self
86
- | (Integer, Integer) -> self?
87
- def at: (Integer) -> 'a
88
- | (Range<Integer>) -> self?
89
- | (Integer, Integer) -> self?
90
- def []=: (Integer, 'a) -> 'a
91
- | (Integer, Integer, 'a) -> 'a
92
- | (Integer, Integer, self) -> self
93
- | (Range<Integer>, 'a) -> 'a
94
- | (Range<Integer>, self) -> self
95
-
96
- def push: (*'a) -> self
97
- def append: (*'a) -> self
98
-
99
- def clear: -> self
100
-
101
- def collect!: { ('a) -> 'a } -> self
102
- | -> Enumerator<'a, self>
103
- def map!: { ('a) -> 'a } -> self
104
- | -> Enumerator<'a, self>
105
-
106
- def combination: (?Integer) { (self) -> any } -> Array<self>
107
- | (?Integer) -> Enumerator<self, Array<self>>
108
-
109
- def empty?: -> bool
110
- def compact: -> self
111
- def compact!: -> self?
112
- def concat: (*Array<'a>) -> self
113
- | (*'a) -> self
114
- def delete: ('a) -> 'a?
115
- | <'x> ('a) { () -> 'x } -> ('a | 'x)
116
- def delete_at: (Integer) -> 'a?
117
- def delete_if: { ('a) -> any } -> self
118
- | -> Enumerator<'a, self>
119
- def reject!: { ('a) -> any } -> self?
120
- | -> Enumerator<'a, self?>
121
- def dig: (Integer, any) -> any
122
- def each: { ('a) -> any } -> self
123
- | -> Enumerator<'a, self>
124
- def each_index: { (Integer) -> any } -> self
125
- | -> Enumerator<Integer, self>
126
- def fetch: (Integer) -> 'a
127
- | (Integer, 'a) -> 'a
128
- | (Integer) { (Integer) -> 'a } -> 'a
129
- def fill: ('a) -> self
130
- | { (Integer) -> 'a } -> self
131
- | ('a, Integer, ?Integer?) -> self
132
- | ('a, Range<Integer>) -> self
133
- | (Integer, ?Integer?) { (Integer) -> 'a} -> self
134
- | (Range<Integer>) { (Integer) -> 'a } -> self
135
-
136
- def find_index: ('a) -> Integer?
137
- | { ('a) -> any } -> Integer?
138
- | -> Enumerator<'a, Integer?>
139
-
140
- def index: ('a) -> Integer?
141
- | { ('a) -> any } -> Integer?
142
- | -> Enumerator<'a, Integer?>
143
-
144
- def flatten: (?Integer?) -> Array<any>
145
- def flatten!: (?Integer?) -> self?
146
-
147
- def insert: (Integer, *'a) -> self
148
-
149
- def join: (any) -> String
150
-
151
- def keep_if: { ('a) -> any } -> self
152
- | -> Enumerator<'a, self>
153
-
154
- def last: -> 'a?
155
- | (Integer) -> self
156
-
157
- def length: -> Integer
158
- def size: -> Integer
159
-
160
- def pack: (String, ?buffer: String) -> String
161
-
162
- def permutation: (?Integer) { (self) -> any } -> Array<self>
163
- | (?Integer) -> Enumerator<self, Array<self>>
164
-
165
- def pop: -> 'a?
166
- | (Integer) -> self
167
-
168
- def unshift: (*'a) -> self
169
- def prepend: (*'a) -> self
170
-
171
- def product: (*Array<'a>) -> Array<Array<'a>>
172
- | (*Array<'a>) { (Array<'a>) -> any } -> self
173
-
174
- def rassoc: (any) -> any
175
-
176
- def repeated_combination: (Integer) { (self) -> any } -> self
177
- | (Integer) -> Enumerator<self, self>
178
-
179
- def repeated_permutation: (Integer) { (self) -> any } -> self
180
- | (Integer) -> Enumerator<self, self>
181
-
182
- def replace: (self) -> self
183
-
184
- def reverse: -> self
185
- def reverse!: -> self
186
-
187
- def rindex: ('a) -> Integer?
188
- | { ('a) -> any } -> Integer?
189
- | -> Enumerator<'a, Integer?>
190
-
191
- def rotate: (?Integer) -> self
192
-
193
- def rotate!: (?Integer) -> self
194
-
195
- def sample: (?random: any) -> 'a?
196
- | (Integer, ?random: any) -> self
197
-
198
- def select!: -> Enumerator<'a, self>
199
- | { ('a) -> any } -> self
200
-
201
- def shift: -> 'a?
202
- | (Integer) -> self
203
-
204
- def shuffle: (?random: any) -> self
205
-
206
- def shuffle!: (?random: any) -> self
207
-
208
- def slice: (Integer) -> 'a?
209
- | (Integer, Integer) -> self?
210
- | (Range<Integer>) -> self?
211
-
212
- def slice!: (Integer) -> 'a?
213
- | (Integer, Integer) -> self?
214
- | (Range<Integer>) -> self?
215
-
216
- def to_h: -> Hash<any, any>
217
-
218
- def transpose: -> self
219
-
220
- def uniq!: -> self?
221
- | { ('a) -> any } -> self?
222
-
223
- def values_at: (*Integer | Range<Integer>) -> self
224
-
225
- def zip: <'x> (Array<'x>) -> Array<any>
226
- | <'x, 'y> (Array<'x>) { ('a, 'x) -> 'y }-> Array<'y>
227
- end
228
-
229
- class Hash<'key, 'value>
230
- def []: ('key) -> 'value?
231
- def []=: ('key, 'value) -> 'value
232
- def size: -> Integer
233
- def transform_values: <'a> { ('value) -> 'a } -> Hash<'key, 'a>
234
- def each_key: { ('key) -> any } -> instance
235
- | -> Enumerator<'a, self>
236
- def self.[]: (Array<any>) -> Hash<'key, 'value>
237
- def keys: () -> Array<'key>
238
- def each: { (['key, 'value]) -> any } -> self
239
- | -> Enumerator<['key, 'value], self>
240
- def key?: ('key) -> bool
241
- def merge: (Hash<'key, 'value>) -> Hash<'key, 'value>
242
- def delete: ('key) -> 'value?
243
- def each_value: { ('value) -> void } -> self
244
- | -> Enumerator<'valud, self>
245
- def empty?: -> bool
246
-
247
- include Enumerable<['key, 'value], self>
248
- end
249
-
250
- class Symbol
251
- def self.all_symbols: -> Array<Symbol>
252
- end
253
-
254
- interface _ToS
255
- def to_s: -> String
256
- end
257
-
258
- interface _ToI
259
- def to_i: -> Integer
260
- end
261
-
262
- interface _ToInt
263
- def to_int: -> Integer
264
- end
265
-
266
- class TrueClass
267
- def !: -> bool
268
- end
269
-
270
- class FalseClass
271
- def !: -> bool
272
- end
273
-
274
- class NilClass
275
- end
276
-
277
- class Numeric
278
- def +: (Numeric) -> Numeric
279
- def /: (Numeric) -> Numeric
280
- def <=: (any) -> bool
281
- def >=: (any) -> bool
282
- def < : (any) -> bool
283
- def >: (any) -> bool
284
- def -@: -> self
285
- end
286
-
287
- class Integer < Numeric
288
- def to_i: -> Integer
289
- def to_int: -> Integer
290
- def +: (Integer) -> Integer
291
- | (Numeric) -> Numeric
292
- def ^: (Numeric) -> Integer
293
- def *: (Integer) -> Integer
294
- | (Float) -> Float
295
- | (Numeric) -> Numeric
296
- def >>: (Integer) -> Integer
297
- def step: (Integer, ?Integer) { (Integer) -> any } -> self
298
- | (Integer, ?Integer) -> Enumerator<Integer, self>
299
- def times: { (Integer) -> any } -> self
300
- def %: (Integer) -> Integer
301
- def -: (Integer) -> Integer
302
- | (Float) -> Float
303
- | (Numeric) -> Numeric
304
- def &: (Integer) -> Integer
305
- def |: (Integer) -> Integer
306
- def []: (Integer) -> Integer
307
- def <<: (Integer) -> Integer
308
- def floor: (Integer) -> Integer
309
- def **: (Integer) -> Integer
310
- def /: (Integer) -> Integer
311
- | (Float) -> Float
312
- | (Numeric) -> Numeric
313
- def ~: () -> Integer
314
- end
315
-
316
- class Float < Numeric
317
- def *: (Float) -> Float
318
- | (Integer) -> Float
319
- | (Numeric) -> Numeric
320
- def -: (Float) -> Float
321
- def +: (Float) -> Float
322
- | (Numeric) -> Numeric
323
- def round: (Integer) -> (Float | Integer)
324
- | () -> Integer
325
- def floor: -> Integer
326
- def /: (Float) -> Float
327
- | (Integer) -> Float
328
- | (Numeric) -> Numeric
329
- end
330
-
331
- Math::PI: Float
332
-
333
- class Complex < Numeric
334
- def self.polar: (Numeric, Numeric) -> instance
335
- def +: (Complex) -> Complex
336
- | (Numeric) -> Numeric
337
- def conjugate: -> Complex
338
- def *: (Complex) -> Complex
339
- | (Numeric) -> Numeric
340
- def real: -> Float
341
- end
342
-
343
- class Range<'a>
344
- def begin: -> 'a
345
- def end: -> 'a
346
- def map: <'b> { ('a) -> 'b } -> Array<'b>
347
- def all?: { ('a) -> any } -> any
348
- def max_by: { ('a) -> any } -> 'a
349
- def to_a: -> Array<'a>
350
- end
351
-
352
- class String
353
- def []: (Range<Integer>) -> String
354
- | (Integer, Integer) -> String
355
- def to_sym: -> Symbol
356
- def +: (String) -> String
357
- def to_str: -> String
358
- def size: -> Integer
359
- def bytes: -> Array<Integer>
360
- def %: (any) -> String
361
- def <<: (String) -> self
362
- def chars: -> Array<String>
363
- def slice!: (Integer) -> String
364
- | (Integer, Integer) -> String
365
- | (String) -> String
366
- | (Regexp, ?Integer) -> String
367
- | (Range<Integer>) -> String
368
- def unpack: (String) -> Array<any>
369
- def b: -> String
370
- def downcase: -> String
371
- def bytes: -> Array<Integer>
372
- def split: (String) -> Array<String>
373
- | (Regexp) -> Array<String>
374
- def gsub: (Regexp, String) -> self
375
- | (String, String) -> self
376
- | (Regexp) { (String) -> _ToS } -> String
377
- def gsub!: (Regexp, String) -> self
378
- | (String, String) -> self
379
- | (Regexp) { (String) -> _ToS } -> String
380
- def sub: (Regexp | String, String) -> self
381
- | (Regexp | String) { (String) -> _ToS } -> String
382
- def chomp: -> String
383
- | (String) -> String
384
- def *: (Integer) -> String
385
- def scan: (Regexp) { (Array<String>) -> void } -> String
386
- | (Regexp) -> Array<String>
387
- def lines: -> Array<String>
388
- def bytesize: -> Integer
389
- def start_with?: (String) -> bool
390
- def byteslice: (Integer, Integer) -> String
391
- def empty?: -> bool
392
- def length: -> Integer
393
- def force_encoding: (any) -> self
394
- def to_i: -> Integer
395
- | (Integer) -> Integer
396
- def end_with?: (*String) -> bool
397
- end
398
-
399
- interface _Iteratable<'a, 'b>
400
- def each: () { ('a) -> void } -> 'b
401
- end
402
-
403
- module Enumerable<'a, 'b> : _Iteratable<'a, 'b>
404
- def all?: -> bool
405
- | { ('a) -> any } -> bool
406
- | (any) -> bool
407
-
408
- def any?: -> bool
409
- | { ('a) -> any } -> bool
410
- | (any) -> bool
411
-
412
- def chunk: { ('a) -> any } -> Enumerator<'a, self>
413
-
414
- def chunk_while: { ('a, 'a) -> any } -> Enumerator<'a, 'b>
415
-
416
- def collect: <'x> { ('a) -> 'x } -> Array<'x>
417
- | <'x> -> Enumerator<'a, Array<'x>>
418
-
419
- alias map collect
420
-
421
- def flat_map: <'x> { ('a) -> Array<'x> } -> Array<'x>
422
- | <'x> -> Enumerator<'a, Array<'x>>
423
-
424
- def collect_concat: <'x> { ('a) -> Array<'x> } -> Array<'x>
425
- | <'x> -> Enumerator<'a, Array<'x>>
426
-
427
- def count: -> Integer
428
- | (any) -> Integer
429
- | { ('a) -> any } -> Integer
430
-
431
- def cycle: (?Integer) -> Enumerator<'a, nil>
432
- | (?Integer) { ('a) -> any } -> nil
433
-
434
- def detect: ('a) { ('a) -> any } -> 'a
435
- | { ('a) -> any } -> 'a?
436
- | -> Enumerator<'a, 'a?>
437
- | ('a) -> Enumerator<'a, 'a>
438
-
439
- def find: ('a) { ('a) -> any } -> 'a
440
- | { ('a) -> any } -> 'a?
441
- | -> Enumerator<'a, 'a?>
442
- | ('a) -> Enumerator<'a, 'a>
443
-
444
- def drop: (Integer) -> Array<'a>
445
-
446
- def drop_while: -> Enumerator<'a, Array<'a>>
447
- | { ('a) -> any } -> Array<'a>
448
-
449
- def each_cons: (Integer) -> Enumerator<Array<'a>, nil>
450
- | (Integer) { (Array<'a>) -> any } -> nil
451
-
452
- def each_entry: -> Enumerator<'a, self>
453
- | { ('a) -> any } -> self
454
-
455
- def each_slice: (Integer) -> Enumerator<Array<'a>, nil>
456
- | (Integer) { (Array<'a>) -> any } -> nil
457
-
458
- def each_with_index: { ('a, Integer) -> any } -> self
459
-
460
- def each_with_object: <'x> ('x) { ('a, 'x) -> any } -> 'x
461
-
462
- def to_a: -> Array<'a>
463
- def entries: -> Array<'a>
464
-
465
- def find_all: -> Enumerator<'a, Array<'a>>
466
- | { ('a) -> any } -> Array<'a>
467
- def select: -> Enumerator<'a, Array<'a>>
468
- | { ('a) -> any } -> Array<'a>
469
-
470
- def find_index: (any) -> Integer?
471
- | { ('a) -> any } -> Integer?
472
- | -> Enumerator<'a, Integer?>
473
-
474
- def first: () -> 'a?
475
- | (Integer) -> Array<'a>
476
-
477
- def grep: (any) -> Array<'a>
478
- | <'x> (any) { ('a) -> 'x } -> Array<'x>
479
-
480
- def grep_v: (any) -> Array<'a>
481
- | <'x> (any) { ('a) -> 'x } -> Array<'x>
482
-
483
- def group_by: <'x> { ('a) -> 'x } -> Hash<'x, Array<'a>>
484
-
485
- def member?: (any) -> bool
486
- def include?: (any) -> bool
487
-
488
- def inject: <'x> ('x) { ('x, 'a) -> 'x } -> 'x
489
- | (Symbol) -> any
490
- | (any, Symbol) -> any
491
- | { ('a, 'a) -> 'a } -> 'a
492
-
493
-
494
- def reduce: <'x> ('x) { ('x, 'a) -> 'x } -> 'x
495
- | (Symbol) -> any
496
- | (any, Symbol) -> any
497
- | { ('a, 'a) -> 'a } -> 'a
498
-
499
- def max: -> 'a?
500
- | (Integer) -> Array<'a>
501
- | { ('a, 'a) -> Integer } -> 'a?
502
- | (Integer) { ('a, 'a) -> Integer } -> Array<'a>
503
-
504
- def max_by: { ('a, 'a) -> Integer } -> 'a?
505
- | (Integer) { ('a, 'a) -> Integer } -> Array<'a>
506
-
507
- def min: -> 'a?
508
- | (Integer) -> Array<'a>
509
- | { ('a, 'a) -> Integer } -> 'a?
510
- | (Integer) { ('a, 'a) -> Integer } -> Array<'a>
511
-
512
- def min_by: { ('a, 'a) -> Integer } -> 'a?
513
- | (Integer) { ('a, 'a) -> Integer } -> Array<'a>
514
-
515
- def min_max: -> Array<'a>
516
- | { ('a, 'a) -> Integer } -> Array<'a>
517
-
518
- def min_max_by: { ('a, 'a) -> Integer } -> Array<'a>
519
-
520
- def none?: -> bool
521
- | { ('a) -> any } -> bool
522
- | (any) -> bool
523
-
524
- def one?: -> bool
525
- | { ('a) -> any } -> bool
526
- | (any) -> bool
527
-
528
- def partition: { ('a) -> any } -> Array<Array<'a>>
529
- | -> Enumerator<'a, Array<Array<'a>>>
530
-
531
- def reject: { ('a) -> any } -> Array<'a>
532
- | -> Enumerator<'a, Array<'a>>
533
-
534
- def reverse_each: { ('a) -> void } -> self
535
- | -> Enumerator<'a, self>
536
-
537
- def slice_after: (any) -> Enumerator<Array<'a>, nil>
538
- | { ('a) -> any } -> Enumerator<Array<'a>, nil>
539
-
540
- def slice_before: (any) -> Enumerator<Array<'a>, nil>
541
- | { ('a) -> any } -> Enumerator<Array<'a>, nil>
542
-
543
- def slice_when: { ('a, 'a) -> any } -> Enumerator<Array<'a>, nil>
544
-
545
- def sort: -> Array<'a>
546
- | { ('a, 'a) -> Integer } -> Array<'a>
547
-
548
- def sort_by: { ('a) -> any } -> Array<'a>
549
- | -> Enumerator<'a, Array<'a>>
550
-
551
- def sort_by!: { ('a) -> any } -> self
552
- | -> Enumerator<'a, self>
553
-
554
- def sum: () -> Numeric
555
- | (Numeric) -> Numeric
556
- | (any) -> any
557
- | (?any) { ('a) -> any } -> any
558
-
559
- def take: (Integer) -> Array<'a>
560
-
561
- def take_while: { ('a) -> any } -> Array<'a>
562
- | -> Enumerator<'a, Array<'a>>
563
-
564
-
565
- def to_h: -> Hash<any, any>
566
-
567
- def uniq: -> Array<'a>
568
- | { ('a) -> any } -> Array<'a>
569
- end
570
-
571
- class Enumerator<'a, 'b>
572
- include Enumerable<'a, 'b>
573
- def each: { ('a) -> any } -> 'b
574
- def with_object: <'x> ('x) { ('a, 'x) -> any } -> 'x
575
- def with_index: { ('a, Integer) -> any } -> 'b
576
- | -> Enumerator<['a, Integer], 'b>
577
- end
578
-
579
- class Encoding
580
- end
581
-
582
- class Regexp
583
- def self.compile: (String) -> Regexp
584
- | (String, Integer) -> Regexp
585
- | (String, bool) -> Regexp
586
- | (Regexp) -> Regexp
587
- def self.escape: (String) -> String
588
- def self.last_match: -> MatchData?
589
- | (Integer) -> String?
590
- def self.quote: (String) -> String
591
- def self.try_convert: (any) -> Regexp?
592
- def self.union: (*String) -> Regexp
593
- | (Array<String>) -> Regexp
594
- | (*Regexp) -> Regexp
595
- | (Array<Regexp>) -> Regexp
596
-
597
- def initialize: (String) -> any
598
- | (String, Integer) -> any
599
- | (String, bool) -> any
600
- | (Regexp) -> any
601
- def ===: (String) -> bool
602
- def =~: (String) -> Integer?
603
- def casefold?: -> bool
604
- def encoding: -> Encoding
605
- def fixed_encoding?: -> bool
606
- def match: (String) -> MatchData?
607
- | (String, Integer) -> MatchData?
608
- | <'a> (String) { (MatchData) -> 'a } -> ('a | nil)
609
- | <'a> (String, Integer) { (MatchData) -> 'a } -> ('a | nil)
610
- def match?: (String) -> bool
611
- | (String, Integer) -> bool
612
- def named_captures: -> Hash<String, Array<Integer>>
613
- def names: -> Array<String>
614
- def options: -> Integer
615
- def source: -> String
616
- def ~: -> Integer?
617
- end
618
-
619
- class MatchData
620
- def []: (Integer | String | Symbol) -> String?
621
- | (Integer, Integer) -> Array<String>
622
- | (Range<Integer>) -> Array<String>
623
- def begin: (Integer) -> Integer?
624
- | (String | Symbol) -> Integer
625
- def captures: -> Array<String>
626
- def end: (Integer | String | Symbol) -> Integer
627
- def length: -> Integer
628
- def named_captures: -> Hash<String, String?>
629
- def names: -> Array<String>
630
- def offset: (Integer | String | Symbol) -> [Integer, Integer]
631
- def post_match: -> String
632
- def pre_match: -> String
633
- def regexp: -> Regexp
634
- def size: -> Integer
635
- def string: -> String
636
- def to_a: -> Array<String>
637
- def values_at: (*(Integer | String | Symbol)) -> Array<String?>
638
- end
639
-
640
- class IO
641
- def gets: -> String?
642
- def puts: (*any) -> void
643
- def read: (Integer) -> String
644
- def write: (String) -> Integer
645
- def flush: () -> void
646
- end
647
-
648
- File::FNM_DOTMATCH: Integer
649
-
650
- class File < IO
651
- def self.binread: (String) -> String
652
- def self.extname: (String) -> String
653
- def self.basename: (String) -> String
654
- def self.readable?: (String) -> bool
655
- def self.binwrite: (String, String) -> void
656
- def self.read: (String) -> String
657
- | (String, Integer?) -> String?
658
- def self.fnmatch: (String, String, Integer) -> bool
659
- def path: -> String
660
- def self.write: (String, String) -> void
661
- def self.chmod: (Integer, String) -> void
662
- end
663
-
664
- class Proc
665
- def []: (*any) -> any
666
- def call: (*any) -> any
667
- def ===: (*any) -> any
668
- def yield: (*any) -> any
669
- def arity: -> Integer
670
- def binding: -> any
671
- def curry: -> Proc
672
- | (Integer) -> Proc
673
- def lambda?: -> bool
674
- def parameters: -> Array<[(:req | :opt | :rest | :keyreq | :key | :keyrest | :block), Symbol]>
675
- def source_location: -> [String, Integer]?
676
- def to_proc: -> self
677
- end
678
-
679
- STDOUT: IO
680
-
681
- class StringIO
682
- def initialize: (?String, ?String) -> any
683
- def puts: (*any) -> void
684
- def readline: () -> String
685
- | (String) -> String
686
- def write: (String) -> void
687
- def flush: () -> void
688
- def string: -> String
689
- end
690
-
691
- class Process::Status
692
- def &: (Integer) -> Integer
693
- def >>: (Integer) -> Integer
694
- def coredump: -> bool
695
- def exited?: -> bool
696
- def exitstatus: -> Integer?
697
- def pid: -> Integer
698
- def signaled?: -> bool
699
- def stopsig: -> Integer?
700
- def success?: -> bool
701
- def termsig: -> Integer?
702
- def to_i: -> Integer
703
- def to_int: -> Integer
704
- end
705
-
706
- module Marshal
707
- def self.load: (String) -> any
708
- def self.dump: (any) -> String
709
- end
710
-
711
- class Set<'a>
712
- def self.[]: <'x> (*'x) -> Set<'x>
713
-
714
- def initialize: (_Iteratable<'a, any>) -> any
715
- | <'x> (_Iteratable<'x, any>) { ('x) -> 'a } -> any
716
- | (?nil) -> any
717
-
718
- def intersection: (_Iteratable<'a, any>) -> self
719
- def &: (_Iteratable<'a, any>) -> self
720
-
721
- def union: (_Iteratable<'a, any>) -> self
722
- def +: (_Iteratable<'a, any>) -> self
723
- def |: (_Iteratable<'a, any>) -> self
724
-
725
- def difference: (_Iteratable<'a, any>) -> self
726
- def -: (_Iteratable<'a, any>) -> self
727
-
728
- def add: ('a) -> self
729
- def <<: ('a) -> self
730
- def add?: ('a) -> self?
731
-
732
- def member?: (any) -> bool
733
- def include?: (any) -> bool
734
-
735
- def ^: (_Iteratable<'a, any>) -> self
736
-
737
- def classify: <'x> { ('a) -> 'x } -> Hash<'x, self>
738
-
739
- def clear: -> self
740
-
741
- def collect!: { ('a) -> 'a } -> self
742
- alias map! collect!
743
-
744
- def delete: (any) -> self
745
- def delete?: (any) -> self?
746
-
747
- def delete_if: { ('a) -> any } -> self
748
- def reject!: { ('a) -> any } -> self
749
-
750
- def disjoint?: (self) -> bool
751
-
752
- def divide: { ('a, 'a) -> any } -> Set<self>
753
- | { ('a) -> any } -> Set<self>
754
-
755
- def each: { ('a) -> void } -> self
756
-
757
- def empty?: -> bool
758
-
759
- def flatten: -> Set<any>
760
-
761
- def intersect?: -> bool
762
-
763
- def keep_if: { ('a) -> any } -> self
764
-
765
- def size: -> Integer
766
- alias length size
767
-
768
- def merge: (_Iteratable<'a, any>) -> self
769
-
770
- def subset?: (self) -> bool
771
- def proper_subst?: (self) -> bool
772
-
773
- def superset?: (self) -> bool
774
- def proper_superset?: (self) -> bool
775
-
776
- def replace: (_Iteratable<'a, any>) -> self
777
-
778
- def reset: -> self
779
-
780
- def select!: { ('a) -> any } -> self?
781
-
782
- def subtract: (_Iteratable<'a, any>) -> self
783
-
784
- def to_a: -> Array<'a>
785
-
786
- include Enumerable<'a, self>
787
- end