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
@@ -0,0 +1,193 @@
|
|
1
|
+
# Descendants of class [Exception](Exception) are used
|
2
|
+
# to communicate between
|
3
|
+
# [Kernel\#raise](https://ruby-doc.org/core-2.6.3/Kernel.html#method-i-raise)
|
4
|
+
# and `rescue` statements in `begin ... end` blocks.
|
5
|
+
# [Exception](Exception) objects carry information
|
6
|
+
# about the exception – its type (the exception’s class name), an optional
|
7
|
+
# descriptive string, and optional traceback information.
|
8
|
+
# [Exception](Exception) subclasses may add additional
|
9
|
+
# information like
|
10
|
+
# [NameError\#name](https://ruby-doc.org/core-2.6.3/NameError.html#method-i-name)
|
11
|
+
# .
|
12
|
+
#
|
13
|
+
# Programs may make subclasses of
|
14
|
+
# [Exception](Exception), typically of
|
15
|
+
# [StandardError](https://ruby-doc.org/core-2.6.3/StandardError.html) or
|
16
|
+
# [RuntimeError](https://ruby-doc.org/core-2.6.3/RuntimeError.html), to
|
17
|
+
# provide custom classes and add additional information. See the subclass
|
18
|
+
# list below for defaults for `raise` and `rescue` .
|
19
|
+
#
|
20
|
+
# When an exception has been raised but not yet handled (in `rescue`,
|
21
|
+
# `ensure`, `at_exit` and `END` blocks) the global variable `$!` will
|
22
|
+
# contain the current exception and `$@` contains the current exception’s
|
23
|
+
# backtrace.
|
24
|
+
#
|
25
|
+
# It is recommended that a library should have one subclass of
|
26
|
+
# [StandardError](https://ruby-doc.org/core-2.6.3/StandardError.html) or
|
27
|
+
# [RuntimeError](https://ruby-doc.org/core-2.6.3/RuntimeError.html) and
|
28
|
+
# have specific exception types inherit from it. This allows the user to
|
29
|
+
# rescue a generic exception type to catch all exceptions the library may
|
30
|
+
# raise even if future versions of the library add new exception
|
31
|
+
# subclasses.
|
32
|
+
#
|
33
|
+
# For example:
|
34
|
+
#
|
35
|
+
# ```ruby
|
36
|
+
# class MyLibrary
|
37
|
+
# class Error < RuntimeError
|
38
|
+
# end
|
39
|
+
#
|
40
|
+
# class WidgetError < Error
|
41
|
+
# end
|
42
|
+
#
|
43
|
+
# class FrobError < Error
|
44
|
+
# end
|
45
|
+
#
|
46
|
+
# end
|
47
|
+
# ```
|
48
|
+
#
|
49
|
+
# To handle both WidgetError and FrobError the library user can rescue
|
50
|
+
# MyLibrary::Error.
|
51
|
+
#
|
52
|
+
# The built-in subclasses of [Exception](Exception)
|
53
|
+
# are:
|
54
|
+
#
|
55
|
+
# - [NoMemoryError](https://ruby-doc.org/core-2.6.3/NoMemoryError.html)
|
56
|
+
#
|
57
|
+
# - [ScriptError](https://ruby-doc.org/core-2.6.3/ScriptError.html)
|
58
|
+
#
|
59
|
+
# - [LoadError](https://ruby-doc.org/core-2.6.3/LoadError.html)
|
60
|
+
#
|
61
|
+
# - [NotImplementedError](https://ruby-doc.org/core-2.6.3/NotImplementedError.html)
|
62
|
+
#
|
63
|
+
# - [SyntaxError](https://ruby-doc.org/core-2.6.3/SyntaxError.html)
|
64
|
+
#
|
65
|
+
# - [SecurityError](https://ruby-doc.org/core-2.6.3/SecurityError.html)
|
66
|
+
#
|
67
|
+
# - [SignalException](https://ruby-doc.org/core-2.6.3/SignalException.html)
|
68
|
+
#
|
69
|
+
# - [Interrupt](https://ruby-doc.org/core-2.6.3/Interrupt.html)
|
70
|
+
#
|
71
|
+
# - [StandardError](https://ruby-doc.org/core-2.6.3/StandardError.html)
|
72
|
+
# -- default for `rescue`
|
73
|
+
#
|
74
|
+
# - [ArgumentError](https://ruby-doc.org/core-2.6.3/ArgumentError.html)
|
75
|
+
#
|
76
|
+
# - [UncaughtThrowError](https://ruby-doc.org/core-2.6.3/UncaughtThrowError.html)
|
77
|
+
#
|
78
|
+
# - [EncodingError](https://ruby-doc.org/core-2.6.3/EncodingError.html)
|
79
|
+
#
|
80
|
+
# - [FiberError](https://ruby-doc.org/core-2.6.3/FiberError.html)
|
81
|
+
#
|
82
|
+
# - [IOError](https://ruby-doc.org/core-2.6.3/IOError.html)
|
83
|
+
#
|
84
|
+
# - [EOFError](https://ruby-doc.org/core-2.6.3/EOFError.html)
|
85
|
+
#
|
86
|
+
# - [IndexError](https://ruby-doc.org/core-2.6.3/IndexError.html)
|
87
|
+
#
|
88
|
+
# - [KeyError](https://ruby-doc.org/core-2.6.3/KeyError.html)
|
89
|
+
#
|
90
|
+
# - [StopIteration](https://ruby-doc.org/core-2.6.3/StopIteration.html)
|
91
|
+
#
|
92
|
+
# - [LocalJumpError](https://ruby-doc.org/core-2.6.3/LocalJumpError.html)
|
93
|
+
#
|
94
|
+
# - [NameError](https://ruby-doc.org/core-2.6.3/NameError.html)
|
95
|
+
#
|
96
|
+
# - [NoMethodError](https://ruby-doc.org/core-2.6.3/NoMethodError.html)
|
97
|
+
#
|
98
|
+
# - [RangeError](https://ruby-doc.org/core-2.6.3/RangeError.html)
|
99
|
+
#
|
100
|
+
# - [FloatDomainError](https://ruby-doc.org/core-2.6.3/FloatDomainError.html)
|
101
|
+
#
|
102
|
+
# - [RegexpError](https://ruby-doc.org/core-2.6.3/RegexpError.html)
|
103
|
+
#
|
104
|
+
# - [RuntimeError](https://ruby-doc.org/core-2.6.3/RuntimeError.html)
|
105
|
+
# -- default for `raise`
|
106
|
+
#
|
107
|
+
# - [FrozenError](https://ruby-doc.org/core-2.6.3/FrozenError.html)
|
108
|
+
#
|
109
|
+
# - [SystemCallError](https://ruby-doc.org/core-2.6.3/SystemCallError.html)
|
110
|
+
#
|
111
|
+
# - Errno::\*
|
112
|
+
#
|
113
|
+
# - [ThreadError](https://ruby-doc.org/core-2.6.3/ThreadError.html)
|
114
|
+
#
|
115
|
+
# - [TypeError](https://ruby-doc.org/core-2.6.3/TypeError.html)
|
116
|
+
#
|
117
|
+
# - [ZeroDivisionError](https://ruby-doc.org/core-2.6.3/ZeroDivisionError.html)
|
118
|
+
#
|
119
|
+
# - [SystemExit](https://ruby-doc.org/core-2.6.3/SystemExit.html)
|
120
|
+
#
|
121
|
+
# - [SystemStackError](https://ruby-doc.org/core-2.6.3/SystemStackError.html)
|
122
|
+
#
|
123
|
+
# - fatal – impossible to rescue
|
124
|
+
class Exception < Object
|
125
|
+
def self.to_tty?: () -> bool
|
126
|
+
|
127
|
+
def self.exception: (?String msg) -> self
|
128
|
+
|
129
|
+
def ==: (untyped arg0) -> bool
|
130
|
+
|
131
|
+
# Returns any backtrace associated with the exception. The backtrace is an
|
132
|
+
# array of strings, each containing either “filename:lineNo: in \`method”‘
|
133
|
+
# or “filename:lineNo.”
|
134
|
+
#
|
135
|
+
# ```ruby
|
136
|
+
# def a
|
137
|
+
# raise "boom"
|
138
|
+
# end
|
139
|
+
#
|
140
|
+
# def b
|
141
|
+
# a()
|
142
|
+
# end
|
143
|
+
#
|
144
|
+
# begin
|
145
|
+
# b()
|
146
|
+
# rescue => detail
|
147
|
+
# print detail.backtrace.join("\n")
|
148
|
+
# end
|
149
|
+
# ```
|
150
|
+
#
|
151
|
+
# *produces:*
|
152
|
+
#
|
153
|
+
# prog.rb:2:in `a'
|
154
|
+
# prog.rb:6:in `b'
|
155
|
+
# prog.rb:10
|
156
|
+
def backtrace: () -> ::Array[String]?
|
157
|
+
|
158
|
+
# Returns any backtrace associated with the exception. This method is
|
159
|
+
# similar to
|
160
|
+
# [\#backtrace](Exception.downloaded.ruby_doc#method-i-backtrace), but
|
161
|
+
# the backtrace is an array of
|
162
|
+
# [Thread::Backtrace::Location](https://ruby-doc.org/core-2.6.3/Thread/Backtrace/Location.html)
|
163
|
+
# .
|
164
|
+
#
|
165
|
+
# Now, this method is not affected by
|
166
|
+
# [\#set\_backtrace](Exception.downloaded.ruby_doc#method-i-set_backtrace)
|
167
|
+
# .
|
168
|
+
def backtrace_locations: () -> ::Array[Thread::Backtrace::Location]?
|
169
|
+
|
170
|
+
# Returns the previous exception ($\!) at the time this exception was
|
171
|
+
# raised. This is useful for wrapping exceptions and retaining the
|
172
|
+
# original exception information.
|
173
|
+
def cause: () -> Exception?
|
174
|
+
|
175
|
+
def exception: (?String arg0) -> Exception
|
176
|
+
|
177
|
+
def initialize: (?String arg0) -> void
|
178
|
+
|
179
|
+
# Return this exception’s class name and message.
|
180
|
+
def inspect: () -> String
|
181
|
+
|
182
|
+
# Returns the result of invoking `exception.to_s` . Normally this returns
|
183
|
+
# the exception’s message or name.
|
184
|
+
def message: () -> String
|
185
|
+
|
186
|
+
def set_backtrace: (String | ::Array[String] arg0) -> ::Array[String]
|
187
|
+
|
188
|
+
# Returns exception’s message (or the name of the exception if no message
|
189
|
+
# is set).
|
190
|
+
def to_s: () -> String
|
191
|
+
|
192
|
+
def full_message: (?highlight: bool, ?order: :top | :bottom) -> String
|
193
|
+
end
|
@@ -0,0 +1,40 @@
|
|
1
|
+
# The global value `false` is the only instance of class FalseClass and
|
2
|
+
# represents a logically false value in boolean expressions. The class provides
|
3
|
+
# operators allowing `false` to participate correctly in logical expressions.
|
4
|
+
#
|
5
|
+
class FalseClass
|
6
|
+
public
|
7
|
+
|
8
|
+
def !: () -> bool
|
9
|
+
|
10
|
+
# And---Returns `false`. *obj* is always evaluated as it is the argument to a
|
11
|
+
# method call---there is no short-circuit evaluation in this case.
|
12
|
+
#
|
13
|
+
def &: (untyped obj) -> bool
|
14
|
+
|
15
|
+
# Case Equality -- For class Object, effectively the same as calling `#==`, but
|
16
|
+
# typically overridden by descendants to provide meaningful semantics in `case`
|
17
|
+
# statements.
|
18
|
+
#
|
19
|
+
def ===: (false) -> true
|
20
|
+
| (untyped obj) -> bool
|
21
|
+
|
22
|
+
# Exclusive Or---If *obj* is `nil` or `false`, returns `false`; otherwise,
|
23
|
+
# returns `true`.
|
24
|
+
#
|
25
|
+
def ^: (nil) -> false
|
26
|
+
| (false) -> false
|
27
|
+
| (untyped obj) -> bool
|
28
|
+
|
29
|
+
alias inspect to_s
|
30
|
+
|
31
|
+
# The string representation of `false` is "false".
|
32
|
+
#
|
33
|
+
def to_s: () -> "false"
|
34
|
+
|
35
|
+
# Or---Returns `false` if *obj* is `nil` or `false`; `true` otherwise.
|
36
|
+
#
|
37
|
+
def |: (nil) -> false
|
38
|
+
| (false) -> false
|
39
|
+
| (untyped obj) -> bool
|
40
|
+
end
|
@@ -0,0 +1,68 @@
|
|
1
|
+
# Fibers are primitives for implementing light weight cooperative
|
2
|
+
# concurrency in Ruby. Basically they are a means of creating code blocks
|
3
|
+
# that can be paused and resumed, much like threads. The main difference
|
4
|
+
# is that they are never preempted and that the scheduling must be done by
|
5
|
+
# the programmer and not the VM.
|
6
|
+
#
|
7
|
+
# As opposed to other stackless light weight concurrency models, each
|
8
|
+
# fiber comes with a stack. This enables the fiber to be paused from
|
9
|
+
# deeply nested function calls within the fiber block. See the ruby(1)
|
10
|
+
# manpage to configure the size of the fiber stack(s).
|
11
|
+
#
|
12
|
+
# When a fiber is created it will not run automatically. Rather it must be
|
13
|
+
# explicitly asked to run using the `Fiber#resume` method. The code
|
14
|
+
# running inside the fiber can give up control by calling `Fiber.yield` in
|
15
|
+
# which case it yields control back to caller (the caller of the
|
16
|
+
# `Fiber#resume` ).
|
17
|
+
#
|
18
|
+
# Upon yielding or termination the [Fiber](Fiber)
|
19
|
+
# returns the value of the last executed expression
|
20
|
+
#
|
21
|
+
# For instance:
|
22
|
+
#
|
23
|
+
# ```ruby
|
24
|
+
# fiber = Fiber.new do
|
25
|
+
# Fiber.yield 1
|
26
|
+
# 2
|
27
|
+
# end
|
28
|
+
#
|
29
|
+
# puts fiber.resume
|
30
|
+
# puts fiber.resume
|
31
|
+
# puts fiber.resume
|
32
|
+
# ```
|
33
|
+
#
|
34
|
+
# *produces*
|
35
|
+
#
|
36
|
+
# 1
|
37
|
+
# 2
|
38
|
+
# FiberError: dead fiber called
|
39
|
+
#
|
40
|
+
# The `Fiber#resume` method accepts an arbitrary number of parameters, if
|
41
|
+
# it is the first call to `resume` then they will be passed as block
|
42
|
+
# arguments. Otherwise they will be the return value of the call to
|
43
|
+
# `Fiber.yield`
|
44
|
+
#
|
45
|
+
# Example:
|
46
|
+
#
|
47
|
+
# ```ruby
|
48
|
+
# fiber = Fiber.new do |first|
|
49
|
+
# second = Fiber.yield first + 2
|
50
|
+
# end
|
51
|
+
#
|
52
|
+
# puts fiber.resume 10
|
53
|
+
# puts fiber.resume 14
|
54
|
+
# puts fiber.resume 18
|
55
|
+
# ```
|
56
|
+
#
|
57
|
+
# *produces*
|
58
|
+
#
|
59
|
+
# 12
|
60
|
+
# 14
|
61
|
+
# FiberError: dead fiber called
|
62
|
+
class Fiber < Object
|
63
|
+
def self.yield: (*untyped args) -> untyped
|
64
|
+
|
65
|
+
def initialize: () { () -> void } -> Fiber
|
66
|
+
|
67
|
+
def resume: (*untyped args) -> untyped
|
68
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# Raised when an invalid operation is attempted on a
|
2
|
+
# [Fiber](https://ruby-doc.org/core-2.6.3/Fiber.html), in particular when
|
3
|
+
# attempting to call/resume a dead fiber, attempting to yield from the
|
4
|
+
# root fiber, or calling a fiber across threads.
|
5
|
+
#
|
6
|
+
# ```ruby
|
7
|
+
# fiber = Fiber.new{}
|
8
|
+
# fiber.resume #=> nil
|
9
|
+
# fiber.resume #=> FiberError: dead fiber called
|
10
|
+
# ```
|
11
|
+
class FiberError < StandardError
|
12
|
+
end
|
@@ -0,0 +1,476 @@
|
|
1
|
+
# A `File` is an abstraction of any file object accessible by the program
|
2
|
+
# and is closely associated with class `IO` . `File` includes the methods
|
3
|
+
# of module `FileTest` as class methods, allowing you to write (for
|
4
|
+
# example) `File.exist?("foo")` .
|
5
|
+
#
|
6
|
+
# In the description of [File](File) methods,
|
7
|
+
# *permission bits* are a platform-specific set of bits that indicate
|
8
|
+
# permissions of a file. On Unix-based systems, permissions are viewed as
|
9
|
+
# a set of three octets, for the owner, the group, and the rest of the
|
10
|
+
# world. For each of these entities, permissions may be set to read,
|
11
|
+
# write, or execute the file:
|
12
|
+
#
|
13
|
+
# The permission bits `0644` (in octal) would thus be interpreted as
|
14
|
+
# read/write for owner, and read-only for group and other. Higher-order
|
15
|
+
# bits may also be used to indicate the type of file (plain, directory,
|
16
|
+
# pipe, socket, and so on) and various other special features. If the
|
17
|
+
# permissions are for a directory, the meaning of the execute bit changes;
|
18
|
+
# when set the directory can be searched.
|
19
|
+
#
|
20
|
+
# On non-Posix operating systems, there may be only the ability to make a
|
21
|
+
# file read-only or read-write. In this case, the remaining permission
|
22
|
+
# bits will be synthesized to resemble typical values. For instance, on
|
23
|
+
# Windows NT the default permission bits are `0644`, which means
|
24
|
+
# read/write for owner, read-only for all others. The only change that can
|
25
|
+
# be made is to make the file read-only, which is reported as `0444` .
|
26
|
+
#
|
27
|
+
# Various constants for the methods in [File](File)
|
28
|
+
# can be found in
|
29
|
+
# [File::Constants](https://ruby-doc.org/core-2.6.3/File/Constants.html).
|
30
|
+
class File < IO
|
31
|
+
def self.absolute_path: (String file, ?String dir) -> String
|
32
|
+
|
33
|
+
def self.atime: (untyped file) -> Time
|
34
|
+
|
35
|
+
def self.basename: (String file, ?String suffix) -> String
|
36
|
+
|
37
|
+
def self.binread: (String arg0) -> String
|
38
|
+
| (String arg0, ?Integer arg1) -> String
|
39
|
+
| (String arg0, ?Integer arg1, ?Integer arg2) -> String
|
40
|
+
|
41
|
+
def self.birthtime: (untyped file) -> Time
|
42
|
+
|
43
|
+
def self.blockdev?: (String | IO file) -> bool
|
44
|
+
|
45
|
+
def self.chardev?: (String | IO file) -> bool
|
46
|
+
|
47
|
+
def self.chmod: (Integer mode, *String files) -> Integer
|
48
|
+
|
49
|
+
def self.chown: (Integer owner, Integer group, *String files) -> Integer
|
50
|
+
|
51
|
+
def self.ctime: (untyped file) -> Time
|
52
|
+
|
53
|
+
def self.delete: (*String files) -> Integer
|
54
|
+
|
55
|
+
def self.directory?: (String | IO file) -> bool
|
56
|
+
|
57
|
+
def self.dirname: (String file) -> String
|
58
|
+
|
59
|
+
def self.executable?: (String file) -> bool
|
60
|
+
|
61
|
+
def self.executable_real?: (String file) -> bool
|
62
|
+
|
63
|
+
def self.exist?: (untyped file) -> bool
|
64
|
+
|
65
|
+
def self.expand_path: (untyped file, ?untyped dir) -> String
|
66
|
+
|
67
|
+
def self.extname: (String path) -> String
|
68
|
+
|
69
|
+
def self.file?: (String | IO file) -> bool
|
70
|
+
|
71
|
+
def self.fnmatch: (String pattern, String path, ?Integer flags) -> bool
|
72
|
+
|
73
|
+
def self.`ftype`: (String file) -> String
|
74
|
+
|
75
|
+
def self.grpowned?: (String | IO file) -> bool
|
76
|
+
|
77
|
+
def self.identical?: (String | IO file_1, String | IO file_2) -> bool
|
78
|
+
|
79
|
+
def self.join: (*untyped arg0) -> String
|
80
|
+
|
81
|
+
def self.lchmod: (Integer mode, *String files) -> Integer
|
82
|
+
|
83
|
+
def self.lchown: (Integer owner, Integer group, *String files) -> Integer
|
84
|
+
|
85
|
+
def self.link: (String old, String new) -> Integer
|
86
|
+
|
87
|
+
def self.lstat: (String file) -> File::Stat
|
88
|
+
|
89
|
+
def self.mtime: (untyped file) -> Time
|
90
|
+
|
91
|
+
def self.owned?: (String file) -> bool
|
92
|
+
|
93
|
+
def self.path: (String path) -> String
|
94
|
+
|
95
|
+
def self.pipe?: (String file) -> bool
|
96
|
+
|
97
|
+
def self.readable?: (String file) -> bool
|
98
|
+
|
99
|
+
def self.readable_real?: (String file) -> bool
|
100
|
+
|
101
|
+
def self.readlink: (String link) -> String
|
102
|
+
|
103
|
+
def self.realdirpath: (String pathname, ?String dir) -> String
|
104
|
+
|
105
|
+
def self.realpath: (String pathname, ?String dir) -> String
|
106
|
+
|
107
|
+
def self.rename: (String old, String new) -> Integer
|
108
|
+
|
109
|
+
def self.setgid?: (String file) -> bool
|
110
|
+
|
111
|
+
def self.setuid?: (String file) -> bool
|
112
|
+
|
113
|
+
def self.size: (String | IO file) -> Integer
|
114
|
+
|
115
|
+
def self.size?: (String | IO file) -> Integer?
|
116
|
+
|
117
|
+
def self.socket?: (String | IO file) -> bool
|
118
|
+
|
119
|
+
def self.split: (String file) -> [ String, String ]
|
120
|
+
|
121
|
+
def self.stat: (untyped file) -> File::Stat
|
122
|
+
|
123
|
+
def self.sticky?: (String file) -> bool
|
124
|
+
|
125
|
+
def self.symlink: (String old, String new) -> Integer
|
126
|
+
|
127
|
+
def self.symlink?: (String file) -> bool
|
128
|
+
|
129
|
+
def self.truncate: (String file, Integer arg0) -> Integer
|
130
|
+
|
131
|
+
def self.umask: (?Integer arg0) -> Integer
|
132
|
+
|
133
|
+
def self.utime: (Time atime, Time mtime, *String files) -> Integer
|
134
|
+
|
135
|
+
def self.world_readable?: (String | IO file) -> Integer?
|
136
|
+
|
137
|
+
def self.world_writable?: (String | IO file) -> Integer?
|
138
|
+
|
139
|
+
def self.writable?: (String file) -> Integer?
|
140
|
+
|
141
|
+
def self.writable_real?: (String file) -> Integer?
|
142
|
+
|
143
|
+
def self.zero?: (String | IO file) -> Integer?
|
144
|
+
|
145
|
+
# Returns the last access time (a `Time` object) for *file* , or epoch if
|
146
|
+
# *file* has not been accessed.
|
147
|
+
#
|
148
|
+
# ```ruby
|
149
|
+
# File.new("testfile").atime #=> Wed Dec 31 18:00:00 CST 1969
|
150
|
+
# ```
|
151
|
+
def atime: () -> Time
|
152
|
+
|
153
|
+
# Returns the birth time for *file* .
|
154
|
+
#
|
155
|
+
# ```ruby
|
156
|
+
# File.new("testfile").birthtime #=> Wed Apr 09 08:53:14 CDT 2003
|
157
|
+
# ```
|
158
|
+
#
|
159
|
+
# If the platform doesn’t have birthtime, raises
|
160
|
+
# [NotImplementedError](https://ruby-doc.org/core-2.6.3/NotImplementedError.html)
|
161
|
+
# .
|
162
|
+
def birthtime: () -> Time
|
163
|
+
|
164
|
+
def chmod: (Integer mode) -> Integer
|
165
|
+
|
166
|
+
def chown: (Integer owner, Integer group) -> Integer
|
167
|
+
|
168
|
+
# Returns the change time for *file* (that is, the time directory
|
169
|
+
# information about the file was changed, not the file itself).
|
170
|
+
#
|
171
|
+
# Note that on Windows (NTFS), returns creation time (birth time).
|
172
|
+
#
|
173
|
+
# ```ruby
|
174
|
+
# File.new("testfile").ctime #=> Wed Apr 09 08:53:14 CDT 2003
|
175
|
+
# ```
|
176
|
+
def ctime: () -> Time
|
177
|
+
|
178
|
+
def flock: (Integer arg0) -> (Integer | TrueClass | FalseClass)
|
179
|
+
|
180
|
+
def initialize: (String file, ?String mode, ?String perm, ?Integer opt) -> void
|
181
|
+
|
182
|
+
# Same as `IO#stat`, but does not follow the last symbolic link. Instead,
|
183
|
+
# reports on the link itself.
|
184
|
+
#
|
185
|
+
# ```ruby
|
186
|
+
# File.symlink("testfile", "link2test") #=> 0
|
187
|
+
# File.stat("testfile").size #=> 66
|
188
|
+
# f = File.new("link2test")
|
189
|
+
# f.lstat.size #=> 8
|
190
|
+
# f.stat.size #=> 66
|
191
|
+
# ```
|
192
|
+
def lstat: () -> File::Stat
|
193
|
+
|
194
|
+
# Returns the modification time for *file* .
|
195
|
+
#
|
196
|
+
# ```ruby
|
197
|
+
# File.new("testfile").mtime #=> Wed Apr 09 08:53:14 CDT 2003
|
198
|
+
# ```
|
199
|
+
def mtime: () -> Time
|
200
|
+
|
201
|
+
# Returns the pathname used to create *file* as a string. Does not
|
202
|
+
# normalize the name.
|
203
|
+
#
|
204
|
+
# The pathname may not point to the file corresponding to *file* . For
|
205
|
+
# instance, the pathname becomes void when the file has been moved or
|
206
|
+
# deleted.
|
207
|
+
#
|
208
|
+
# This method raises `IOError` for a *file* created using
|
209
|
+
# `File::Constants::TMPFILE` because they don’t have a pathname.
|
210
|
+
#
|
211
|
+
# ```ruby
|
212
|
+
# File.new("testfile").path #=> "testfile"
|
213
|
+
# File.new("/tmp/../tmp/xxx", "w").path #=> "/tmp/../tmp/xxx"
|
214
|
+
# ```
|
215
|
+
def path: () -> String
|
216
|
+
|
217
|
+
# Returns the size of *file* in bytes.
|
218
|
+
#
|
219
|
+
# ```ruby
|
220
|
+
# File.new("testfile").size #=> 66
|
221
|
+
# ```
|
222
|
+
def size: () -> Integer
|
223
|
+
|
224
|
+
def truncate: (Integer arg0) -> Integer
|
225
|
+
|
226
|
+
def self.fnmatch?: (String pattern, String path, ?Integer flags) -> bool
|
227
|
+
|
228
|
+
def self.unlink: (*String files) -> Integer
|
229
|
+
|
230
|
+
# Returns the pathname used to create *file* as a string. Does not
|
231
|
+
# normalize the name.
|
232
|
+
#
|
233
|
+
# The pathname may not point to the file corresponding to *file* . For
|
234
|
+
# instance, the pathname becomes void when the file has been moved or
|
235
|
+
# deleted.
|
236
|
+
#
|
237
|
+
# This method raises `IOError` for a *file* created using
|
238
|
+
# `File::Constants::TMPFILE` because they don’t have a pathname.
|
239
|
+
#
|
240
|
+
# ```ruby
|
241
|
+
# File.new("testfile").path #=> "testfile"
|
242
|
+
# File.new("/tmp/../tmp/xxx", "w").path #=> "/tmp/../tmp/xxx"
|
243
|
+
# ```
|
244
|
+
def to_path: () -> String
|
245
|
+
end
|
246
|
+
|
247
|
+
File::ALT_SEPARATOR: NilClass
|
248
|
+
|
249
|
+
File::APPEND: Integer
|
250
|
+
|
251
|
+
File::BINARY: Integer
|
252
|
+
|
253
|
+
File::CREAT: Integer
|
254
|
+
|
255
|
+
File::DIRECT: Integer
|
256
|
+
|
257
|
+
File::DSYNC: Integer
|
258
|
+
|
259
|
+
File::EXCL: Integer
|
260
|
+
|
261
|
+
File::FNM_CASEFOLD: Integer
|
262
|
+
|
263
|
+
File::FNM_DOTMATCH: Integer
|
264
|
+
|
265
|
+
File::FNM_EXTGLOB: Integer
|
266
|
+
|
267
|
+
File::FNM_NOESCAPE: Integer
|
268
|
+
|
269
|
+
File::FNM_PATHNAME: Integer
|
270
|
+
|
271
|
+
File::FNM_SHORTNAME: Integer
|
272
|
+
|
273
|
+
File::FNM_SYSCASE: Integer
|
274
|
+
|
275
|
+
File::LOCK_EX: Integer
|
276
|
+
|
277
|
+
File::LOCK_NB: Integer
|
278
|
+
|
279
|
+
File::LOCK_SH: Integer
|
280
|
+
|
281
|
+
File::LOCK_UN: Integer
|
282
|
+
|
283
|
+
File::NOATIME: Integer
|
284
|
+
|
285
|
+
File::NOCTTY: Integer
|
286
|
+
|
287
|
+
File::NOFOLLOW: Integer
|
288
|
+
|
289
|
+
File::NONBLOCK: Integer
|
290
|
+
|
291
|
+
File::NULL: String
|
292
|
+
|
293
|
+
File::PATH_SEPARATOR: String
|
294
|
+
|
295
|
+
File::RDONLY: Integer
|
296
|
+
|
297
|
+
File::RDWR: Integer
|
298
|
+
|
299
|
+
File::RSYNC: Integer
|
300
|
+
|
301
|
+
File::SEEK_CUR: Integer
|
302
|
+
|
303
|
+
File::SEEK_DATA: Integer
|
304
|
+
|
305
|
+
File::SEEK_END: Integer
|
306
|
+
|
307
|
+
File::SEEK_HOLE: Integer
|
308
|
+
|
309
|
+
File::SEEK_SET: Integer
|
310
|
+
|
311
|
+
File::SEPARATOR: String
|
312
|
+
|
313
|
+
File::SHARE_DELETE: Integer
|
314
|
+
|
315
|
+
File::SYNC: Integer
|
316
|
+
|
317
|
+
File::TMPFILE: Integer
|
318
|
+
|
319
|
+
File::TRUNC: Integer
|
320
|
+
|
321
|
+
File::WRONLY: Integer
|
322
|
+
|
323
|
+
module File::Constants
|
324
|
+
end
|
325
|
+
|
326
|
+
File::Constants::APPEND: Integer
|
327
|
+
|
328
|
+
File::Constants::BINARY: Integer
|
329
|
+
|
330
|
+
File::Constants::CREAT: Integer
|
331
|
+
|
332
|
+
File::Constants::DIRECT: Integer
|
333
|
+
|
334
|
+
File::Constants::DSYNC: Integer
|
335
|
+
|
336
|
+
File::Constants::EXCL: Integer
|
337
|
+
|
338
|
+
File::Constants::FNM_CASEFOLD: Integer
|
339
|
+
|
340
|
+
File::Constants::FNM_DOTMATCH: Integer
|
341
|
+
|
342
|
+
File::Constants::FNM_EXTGLOB: Integer
|
343
|
+
|
344
|
+
File::Constants::FNM_NOESCAPE: Integer
|
345
|
+
|
346
|
+
File::Constants::FNM_PATHNAME: Integer
|
347
|
+
|
348
|
+
File::Constants::FNM_SHORTNAME: Integer
|
349
|
+
|
350
|
+
File::Constants::FNM_SYSCASE: Integer
|
351
|
+
|
352
|
+
File::Constants::LOCK_EX: Integer
|
353
|
+
|
354
|
+
File::Constants::LOCK_NB: Integer
|
355
|
+
|
356
|
+
File::Constants::LOCK_SH: Integer
|
357
|
+
|
358
|
+
File::Constants::LOCK_UN: Integer
|
359
|
+
|
360
|
+
File::Constants::NOATIME: Integer
|
361
|
+
|
362
|
+
File::Constants::NOCTTY: Integer
|
363
|
+
|
364
|
+
File::Constants::NOFOLLOW: Integer
|
365
|
+
|
366
|
+
File::Constants::NONBLOCK: Integer
|
367
|
+
|
368
|
+
File::Constants::NULL: String
|
369
|
+
|
370
|
+
File::Constants::RDONLY: Integer
|
371
|
+
|
372
|
+
File::Constants::RDWR: Integer
|
373
|
+
|
374
|
+
File::Constants::RSYNC: Integer
|
375
|
+
|
376
|
+
File::Constants::SHARE_DELETE: Integer
|
377
|
+
|
378
|
+
File::Constants::SYNC: Integer
|
379
|
+
|
380
|
+
File::Constants::TMPFILE: Integer
|
381
|
+
|
382
|
+
File::Constants::TRUNC: Integer
|
383
|
+
|
384
|
+
File::Constants::WRONLY: Integer
|
385
|
+
|
386
|
+
class File::Stat < Object
|
387
|
+
include Comparable
|
388
|
+
|
389
|
+
def <=>: (File::Stat other) -> Integer?
|
390
|
+
|
391
|
+
def atime: () -> Time
|
392
|
+
|
393
|
+
def birthtime: () -> Time
|
394
|
+
|
395
|
+
def blksize: () -> Integer?
|
396
|
+
|
397
|
+
def blockdev?: () -> bool
|
398
|
+
|
399
|
+
def blocks: () -> Integer?
|
400
|
+
|
401
|
+
def chardev?: () -> bool
|
402
|
+
|
403
|
+
def ctime: () -> Time
|
404
|
+
|
405
|
+
def dev: () -> Integer
|
406
|
+
|
407
|
+
def dev_major: () -> Integer
|
408
|
+
|
409
|
+
def dev_minor: () -> Integer
|
410
|
+
|
411
|
+
def directory?: () -> bool
|
412
|
+
|
413
|
+
def executable?: () -> bool
|
414
|
+
|
415
|
+
def executable_real?: () -> bool
|
416
|
+
|
417
|
+
def file?: () -> bool
|
418
|
+
|
419
|
+
def `ftype`: () -> String
|
420
|
+
|
421
|
+
def gid: () -> Integer
|
422
|
+
|
423
|
+
def grpowned?: () -> bool
|
424
|
+
|
425
|
+
def initialize: (String file) -> Object
|
426
|
+
|
427
|
+
def ino: () -> Integer
|
428
|
+
|
429
|
+
def inspect: () -> String
|
430
|
+
|
431
|
+
def mode: () -> Integer
|
432
|
+
|
433
|
+
def mtime: () -> Time
|
434
|
+
|
435
|
+
def nlink: () -> Integer
|
436
|
+
|
437
|
+
def owned?: () -> bool
|
438
|
+
|
439
|
+
def pipe?: () -> bool
|
440
|
+
|
441
|
+
def rdev: () -> Integer?
|
442
|
+
|
443
|
+
def rdev_major: () -> Integer
|
444
|
+
|
445
|
+
def rdev_minor: () -> Integer
|
446
|
+
|
447
|
+
def read: (?Integer length, ?String outbuf) -> String
|
448
|
+
|
449
|
+
def readable?: () -> bool
|
450
|
+
|
451
|
+
def readable_real?: () -> bool
|
452
|
+
|
453
|
+
def setgid?: () -> bool
|
454
|
+
|
455
|
+
def setuid?: () -> bool
|
456
|
+
|
457
|
+
def size: () -> Integer
|
458
|
+
|
459
|
+
def socket?: () -> bool
|
460
|
+
|
461
|
+
def sticky?: () -> bool
|
462
|
+
|
463
|
+
def symlink?: () -> bool
|
464
|
+
|
465
|
+
def uid: () -> Integer
|
466
|
+
|
467
|
+
def world_readable?: () -> Integer?
|
468
|
+
|
469
|
+
def world_writable?: () -> Integer?
|
470
|
+
|
471
|
+
def writable?: () -> bool
|
472
|
+
|
473
|
+
def writable_real?: () -> bool
|
474
|
+
|
475
|
+
def zero?: () -> bool
|
476
|
+
end
|