steep 0.11.1 → 0.12.0
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.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +27 -0
- data/.gitmodules +3 -0
- data/CHANGELOG.md +5 -0
- data/README.md +48 -90
- data/Rakefile +10 -6
- data/Steepfile +1 -0
- data/bin/setup +1 -0
- data/bin/smoke_runner.rb +9 -14
- data/exe/rbs +3 -0
- data/exe/ruby-signature +3 -0
- data/exe/steep +1 -0
- data/lib/steep.rb +32 -26
- data/lib/steep/annotation_parser.rb +167 -0
- data/lib/steep/ast/annotation/collection.rb +7 -7
- data/lib/steep/ast/types.rb +60 -0
- data/lib/steep/ast/types/any.rb +1 -1
- data/lib/steep/ast/types/factory.rb +535 -0
- data/lib/steep/ast/types/name.rb +3 -3
- data/lib/steep/ast/types/var.rb +1 -1
- data/lib/steep/cli.rb +56 -240
- data/lib/steep/drivers/annotations.rb +36 -19
- data/lib/steep/drivers/check.rb +55 -91
- data/lib/steep/drivers/init.rb +54 -0
- data/lib/steep/drivers/langserver.rb +241 -150
- data/lib/steep/drivers/print_project.rb +56 -0
- data/lib/steep/drivers/signature_error_printer.rb +25 -0
- data/lib/steep/drivers/trace_printer.rb +25 -0
- data/lib/steep/drivers/utils/driver_helper.rb +26 -0
- data/lib/steep/drivers/validate.rb +18 -38
- data/lib/steep/drivers/vendor.rb +46 -0
- data/lib/steep/drivers/watch.rb +78 -140
- data/lib/steep/errors.rb +22 -13
- data/lib/steep/interface/interface.rb +91 -0
- data/lib/steep/interface/method.rb +0 -4
- data/lib/steep/interface/method_type.rb +362 -2
- data/lib/steep/interface/substitution.rb +22 -0
- data/lib/steep/project.rb +25 -233
- data/lib/steep/project/dsl.rb +132 -0
- data/lib/steep/project/file.rb +93 -76
- data/lib/steep/project/file_loader.rb +63 -0
- data/lib/steep/project/options.rb +7 -0
- data/lib/steep/project/target.rb +190 -0
- data/lib/steep/signature/errors.rb +25 -77
- data/lib/steep/signature/validator.rb +122 -0
- data/lib/steep/source.rb +12 -7
- data/lib/steep/subtyping/check.rb +357 -633
- data/lib/steep/subtyping/constraints.rb +2 -2
- data/lib/steep/subtyping/trace.rb +23 -0
- data/lib/steep/type_construction.rb +509 -455
- data/lib/steep/type_inference/constant_env.rb +16 -24
- data/lib/steep/type_inference/type_env.rb +26 -18
- data/lib/steep/version.rb +1 -1
- data/sample/Steepfile +6 -0
- data/sample/lib/conference.rb +12 -0
- data/sample/sig/conference.rbs +6 -0
- data/smoke/alias/Steepfile +4 -0
- data/smoke/alias/a.rb +2 -2
- data/smoke/alias/{a.rbi → a.rbs} +1 -1
- data/smoke/and/Steepfile +4 -0
- data/smoke/array/Steepfile +4 -0
- data/smoke/array/a.rb +2 -2
- data/smoke/array/b.rb +4 -4
- data/smoke/array/c.rb +2 -2
- data/smoke/block/Steepfile +5 -0
- data/smoke/block/{a.rbi → a.rbs} +1 -1
- data/smoke/block/{c.rbi → c.rbs} +0 -0
- data/smoke/block/d.rb +6 -6
- data/smoke/case/Steepfile +4 -0
- data/smoke/case/a.rb +4 -3
- data/smoke/class/Steepfile +4 -0
- data/smoke/class/a.rb +1 -4
- data/smoke/class/a.rbs +24 -0
- data/smoke/class/h.rb +6 -2
- data/smoke/class/{h.rbi → h.rbs} +1 -2
- data/smoke/class/i.rb +1 -2
- data/smoke/class/i.rbs +9 -0
- data/smoke/const/Steepfile +4 -0
- data/smoke/dstr/Steepfile +4 -0
- data/smoke/ensure/Steepfile +4 -0
- data/smoke/ensure/a.rb +1 -1
- data/smoke/enumerator/Steepfile +4 -0
- data/smoke/enumerator/a.rb +7 -7
- data/smoke/enumerator/b.rb +6 -6
- data/smoke/extension/Steepfile +4 -0
- data/smoke/extension/{a.rbi → a.rbs} +2 -2
- data/smoke/extension/{e.rbi → e.rbs} +2 -2
- data/smoke/hash/Steepfile +4 -0
- data/smoke/hash/{a.rbi → a.rbs} +0 -0
- data/smoke/hash/b.rb +2 -2
- data/smoke/hash/c.rb +1 -1
- data/smoke/hash/e.rbs +3 -0
- data/smoke/hash/f.rb +1 -1
- data/smoke/hello/Steepfile +4 -0
- data/smoke/hello/hello.rbs +7 -0
- data/smoke/if/Steepfile +4 -0
- data/smoke/implements/Steepfile +4 -0
- data/smoke/implements/a.rbs +6 -0
- data/smoke/initialize/Steepfile +4 -0
- data/smoke/initialize/a.rbs +3 -0
- data/smoke/integer/Steepfile +4 -0
- data/smoke/integer/a.rb +5 -3
- data/smoke/interface/Steepfile +4 -0
- data/smoke/interface/{a.rbi → a.rbs} +0 -0
- data/smoke/kwbegin/Steepfile +4 -0
- data/smoke/lambda/Steepfile +4 -0
- data/smoke/lambda/a.rb +9 -2
- data/smoke/literal/Steepfile +4 -0
- data/smoke/literal/{literal_methods.rbi → literal_methods.rbs} +0 -0
- data/smoke/map/Steepfile +4 -0
- data/smoke/map/a.rb +1 -1
- data/smoke/method/Steepfile +4 -0
- data/smoke/method/{a.rbi → a.rbs} +0 -0
- data/smoke/method/b.rb +1 -4
- data/smoke/method/d.rb +1 -0
- data/smoke/method/d.rbs +3 -0
- data/smoke/module/Steepfile +4 -0
- data/smoke/module/a.rb +1 -1
- data/smoke/module/a.rbs +16 -0
- data/smoke/module/c.rb +1 -1
- data/smoke/regexp/Steepfile +4 -0
- data/smoke/regexp/a.rb +2 -2
- data/smoke/regexp/b.rb +16 -16
- data/smoke/regression/Steepfile +5 -0
- data/smoke/regression/array.rb +2 -2
- data/smoke/regression/hash.rb +2 -2
- data/smoke/regression/poly_new.rb +2 -0
- data/smoke/regression/poly_new.rbs +4 -0
- data/smoke/regression/set_divide.rb +2 -2
- data/smoke/rescue/Steepfile +4 -0
- data/smoke/rescue/a.rb +1 -1
- data/smoke/self/Steepfile +4 -0
- data/smoke/self/a.rbs +4 -0
- data/smoke/skip/Steepfile +4 -0
- data/smoke/stdout/Steepfile +4 -0
- data/smoke/stdout/{a.rbi → a.rbs} +1 -1
- data/smoke/super/Steepfile +4 -0
- data/smoke/super/a.rbs +10 -0
- data/smoke/type_case/Steepfile +4 -0
- data/smoke/type_case/a.rb +1 -1
- data/smoke/yield/Steepfile +4 -0
- data/smoke/yield/a.rb +2 -2
- data/steep.gemspec +14 -7
- data/vendor/ruby-signature/.github/workflows/ruby.yml +27 -0
- data/vendor/ruby-signature/.gitignore +12 -0
- data/vendor/ruby-signature/.rubocop.yml +15 -0
- data/vendor/ruby-signature/BSDL +22 -0
- data/vendor/ruby-signature/COPYING +56 -0
- data/vendor/ruby-signature/Gemfile +6 -0
- data/vendor/ruby-signature/README.md +93 -0
- data/vendor/ruby-signature/Rakefile +66 -0
- data/vendor/ruby-signature/bin/annotate-with-rdoc +156 -0
- data/vendor/ruby-signature/bin/console +14 -0
- data/vendor/ruby-signature/bin/query-rdoc +103 -0
- data/vendor/ruby-signature/bin/setup +10 -0
- data/vendor/ruby-signature/bin/sort +88 -0
- data/vendor/ruby-signature/bin/test_runner.rb +17 -0
- data/vendor/ruby-signature/docs/CONTRIBUTING.md +97 -0
- data/vendor/ruby-signature/docs/sigs.md +148 -0
- data/vendor/ruby-signature/docs/stdlib.md +152 -0
- data/vendor/ruby-signature/docs/syntax.md +528 -0
- data/vendor/ruby-signature/exe/rbs +3 -0
- data/vendor/ruby-signature/exe/ruby-signature +7 -0
- data/vendor/ruby-signature/lib/ruby/signature.rb +64 -0
- data/vendor/ruby-signature/lib/ruby/signature/ast/annotation.rb +29 -0
- data/vendor/ruby-signature/lib/ruby/signature/ast/comment.rb +29 -0
- data/vendor/ruby-signature/lib/ruby/signature/ast/declarations.rb +391 -0
- data/vendor/ruby-signature/lib/ruby/signature/ast/members.rb +364 -0
- data/vendor/ruby-signature/lib/ruby/signature/buffer.rb +52 -0
- data/vendor/ruby-signature/lib/ruby/signature/builtin_names.rb +54 -0
- data/vendor/ruby-signature/lib/ruby/signature/cli.rb +534 -0
- data/vendor/ruby-signature/lib/ruby/signature/constant.rb +28 -0
- data/vendor/ruby-signature/lib/ruby/signature/constant_table.rb +152 -0
- data/vendor/ruby-signature/lib/ruby/signature/definition.rb +172 -0
- data/vendor/ruby-signature/lib/ruby/signature/definition_builder.rb +921 -0
- data/vendor/ruby-signature/lib/ruby/signature/environment.rb +283 -0
- data/vendor/ruby-signature/lib/ruby/signature/environment_loader.rb +138 -0
- data/vendor/ruby-signature/lib/ruby/signature/environment_walker.rb +126 -0
- data/vendor/ruby-signature/lib/ruby/signature/errors.rb +189 -0
- data/vendor/ruby-signature/lib/ruby/signature/location.rb +104 -0
- data/vendor/ruby-signature/lib/ruby/signature/method_type.rb +125 -0
- data/vendor/ruby-signature/lib/ruby/signature/namespace.rb +93 -0
- data/vendor/ruby-signature/lib/ruby/signature/parser.y +1343 -0
- data/vendor/ruby-signature/lib/ruby/signature/prototype/rb.rb +441 -0
- data/vendor/ruby-signature/lib/ruby/signature/prototype/rbi.rb +579 -0
- data/vendor/ruby-signature/lib/ruby/signature/prototype/runtime.rb +383 -0
- data/vendor/ruby-signature/lib/ruby/signature/substitution.rb +48 -0
- data/vendor/ruby-signature/lib/ruby/signature/test.rb +28 -0
- data/vendor/ruby-signature/lib/ruby/signature/test/errors.rb +63 -0
- data/vendor/ruby-signature/lib/ruby/signature/test/hook.rb +290 -0
- data/vendor/ruby-signature/lib/ruby/signature/test/setup.rb +58 -0
- data/vendor/ruby-signature/lib/ruby/signature/test/spy.rb +324 -0
- data/vendor/ruby-signature/lib/ruby/signature/test/test_helper.rb +185 -0
- data/vendor/ruby-signature/lib/ruby/signature/test/type_check.rb +256 -0
- data/vendor/ruby-signature/lib/ruby/signature/type_name.rb +72 -0
- data/vendor/ruby-signature/lib/ruby/signature/types.rb +932 -0
- data/vendor/ruby-signature/lib/ruby/signature/variance_calculator.rb +140 -0
- data/vendor/ruby-signature/lib/ruby/signature/vendorer.rb +49 -0
- data/vendor/ruby-signature/lib/ruby/signature/version.rb +5 -0
- data/vendor/ruby-signature/lib/ruby/signature/writer.rb +271 -0
- data/vendor/ruby-signature/ruby-signature.gemspec +45 -0
- data/vendor/ruby-signature/stdlib/abbrev/abbrev.rbs +3 -0
- data/vendor/ruby-signature/stdlib/base64/base64.rbs +15 -0
- data/vendor/ruby-signature/stdlib/builtin/array.rbs +1997 -0
- data/vendor/ruby-signature/stdlib/builtin/basic_object.rbs +280 -0
- data/vendor/ruby-signature/stdlib/builtin/binding.rbs +177 -0
- data/vendor/ruby-signature/stdlib/builtin/builtin.rbs +35 -0
- data/vendor/ruby-signature/stdlib/builtin/class.rbs +145 -0
- data/vendor/ruby-signature/stdlib/builtin/comparable.rbs +116 -0
- data/vendor/ruby-signature/stdlib/builtin/complex.rbs +400 -0
- data/vendor/ruby-signature/stdlib/builtin/constants.rbs +37 -0
- data/vendor/ruby-signature/stdlib/builtin/data.rbs +5 -0
- data/vendor/ruby-signature/stdlib/builtin/deprecated.rbs +2 -0
- data/vendor/ruby-signature/stdlib/builtin/dir.rbs +419 -0
- data/vendor/ruby-signature/stdlib/builtin/encoding.rbs +606 -0
- data/vendor/ruby-signature/stdlib/builtin/enumerable.rbs +404 -0
- data/vendor/ruby-signature/stdlib/builtin/enumerator.rbs +260 -0
- data/vendor/ruby-signature/stdlib/builtin/errno.rbs +781 -0
- data/vendor/ruby-signature/stdlib/builtin/errors.rbs +582 -0
- data/vendor/ruby-signature/stdlib/builtin/exception.rbs +193 -0
- data/vendor/ruby-signature/stdlib/builtin/false_class.rbs +40 -0
- data/vendor/ruby-signature/stdlib/builtin/fiber.rbs +68 -0
- data/vendor/ruby-signature/stdlib/builtin/fiber_error.rbs +12 -0
- data/vendor/ruby-signature/stdlib/builtin/file.rbs +476 -0
- data/vendor/ruby-signature/stdlib/builtin/file_test.rbs +59 -0
- data/vendor/ruby-signature/stdlib/builtin/float.rbs +696 -0
- data/vendor/ruby-signature/stdlib/builtin/gc.rbs +121 -0
- data/vendor/ruby-signature/stdlib/builtin/hash.rbs +1029 -0
- data/vendor/ruby-signature/stdlib/builtin/integer.rbs +710 -0
- data/vendor/ruby-signature/stdlib/builtin/io.rbs +683 -0
- data/vendor/ruby-signature/stdlib/builtin/kernel.rbs +574 -0
- data/vendor/ruby-signature/stdlib/builtin/marshal.rbs +135 -0
- data/vendor/ruby-signature/stdlib/builtin/match_data.rbs +141 -0
- data/vendor/ruby-signature/stdlib/builtin/math.rbs +66 -0
- data/vendor/ruby-signature/stdlib/builtin/method.rbs +182 -0
- data/vendor/ruby-signature/stdlib/builtin/module.rbs +248 -0
- data/vendor/ruby-signature/stdlib/builtin/nil_class.rbs +82 -0
- data/vendor/ruby-signature/stdlib/builtin/numeric.rbs +409 -0
- data/vendor/ruby-signature/stdlib/builtin/object.rbs +824 -0
- data/vendor/ruby-signature/stdlib/builtin/proc.rbs +426 -0
- data/vendor/ruby-signature/stdlib/builtin/process.rbs +354 -0
- data/vendor/ruby-signature/stdlib/builtin/random.rbs +93 -0
- data/vendor/ruby-signature/stdlib/builtin/range.rbs +226 -0
- data/vendor/ruby-signature/stdlib/builtin/rational.rbs +424 -0
- data/vendor/ruby-signature/stdlib/builtin/rb_config.rbs +10 -0
- data/vendor/ruby-signature/stdlib/builtin/regexp.rbs +131 -0
- data/vendor/ruby-signature/stdlib/builtin/ruby_vm.rbs +14 -0
- data/vendor/ruby-signature/stdlib/builtin/signal.rbs +55 -0
- data/vendor/ruby-signature/stdlib/builtin/string.rbs +770 -0
- data/vendor/ruby-signature/stdlib/builtin/string_io.rbs +13 -0
- data/vendor/ruby-signature/stdlib/builtin/struct.rbs +40 -0
- data/vendor/ruby-signature/stdlib/builtin/symbol.rbs +230 -0
- data/vendor/ruby-signature/stdlib/builtin/thread.rbs +1112 -0
- data/vendor/ruby-signature/stdlib/builtin/thread_group.rbs +23 -0
- data/vendor/ruby-signature/stdlib/builtin/time.rbs +739 -0
- data/vendor/ruby-signature/stdlib/builtin/trace_point.rbs +91 -0
- data/vendor/ruby-signature/stdlib/builtin/true_class.rbs +46 -0
- data/vendor/ruby-signature/stdlib/builtin/unbound_method.rbs +159 -0
- data/vendor/ruby-signature/stdlib/builtin/warning.rbs +17 -0
- data/vendor/ruby-signature/stdlib/erb/erb.rbs +18 -0
- data/vendor/ruby-signature/stdlib/find/find.rbs +44 -0
- data/vendor/ruby-signature/stdlib/pathname/pathname.rbs +21 -0
- data/vendor/ruby-signature/stdlib/prime/integer-extension.rbs +23 -0
- data/vendor/ruby-signature/stdlib/prime/prime.rbs +188 -0
- data/vendor/ruby-signature/stdlib/securerandom/securerandom.rbs +9 -0
- data/vendor/ruby-signature/stdlib/set/set.rbs +77 -0
- data/vendor/ruby-signature/stdlib/tmpdir/tmpdir.rbs +53 -0
- metadata +244 -54
- data/.travis.yml +0 -7
- data/lib/steep/ast/signature/alias.rb +0 -19
- data/lib/steep/ast/signature/class.rb +0 -33
- data/lib/steep/ast/signature/const.rb +0 -17
- data/lib/steep/ast/signature/env.rb +0 -138
- data/lib/steep/ast/signature/extension.rb +0 -21
- data/lib/steep/ast/signature/gvar.rb +0 -17
- data/lib/steep/ast/signature/interface.rb +0 -31
- data/lib/steep/ast/signature/members.rb +0 -115
- data/lib/steep/ast/signature/module.rb +0 -21
- data/lib/steep/drivers/print_interface.rb +0 -94
- data/lib/steep/drivers/scaffold.rb +0 -321
- data/lib/steep/drivers/utils/each_signature.rb +0 -31
- data/lib/steep/interface/abstract.rb +0 -68
- data/lib/steep/interface/builder.rb +0 -637
- data/lib/steep/interface/instantiated.rb +0 -163
- data/lib/steep/interface/ivar_chain.rb +0 -26
- data/lib/steep/parser.y +0 -1278
- data/lib/steep/project/listener.rb +0 -53
- data/smoke/class/a.rbi +0 -24
- data/smoke/class/d.rb +0 -9
- data/smoke/class/e.rb +0 -12
- data/smoke/class/i.rbi +0 -9
- data/smoke/hash/e.rbi +0 -3
- data/smoke/hello/hello.rbi +0 -7
- data/smoke/implements/a.rbi +0 -6
- data/smoke/initialize/a.rbi +0 -3
- data/smoke/module/a.rbi +0 -16
- data/smoke/self/a.rbi +0 -4
- data/smoke/super/a.rbi +0 -10
- 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
data/smoke/class/i.rbi
DELETED
data/smoke/hash/e.rbi
DELETED
data/smoke/hello/hello.rbi
DELETED
data/smoke/implements/a.rbi
DELETED
data/smoke/initialize/a.rbi
DELETED
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
data/smoke/super/a.rbi
DELETED
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
|