rbs 4.0.0.dev.4 → 4.0.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/dependabot.yml +14 -14
- data/.github/workflows/bundle-update.yml +60 -0
- data/.github/workflows/c-check.yml +18 -11
- data/.github/workflows/comments.yml +5 -3
- data/.github/workflows/dependabot.yml +2 -2
- data/.github/workflows/ruby.yml +27 -34
- data/.github/workflows/rust.yml +95 -0
- data/.github/workflows/typecheck.yml +2 -2
- data/.github/workflows/windows.yml +2 -2
- data/.rubocop.yml +1 -1
- data/CHANGELOG.md +323 -0
- data/README.md +1 -1
- data/Rakefile +43 -33
- data/Steepfile +1 -0
- data/config.yml +426 -24
- data/core/array.rbs +307 -227
- data/core/basic_object.rbs +9 -8
- data/core/binding.rbs +0 -2
- data/core/builtin.rbs +2 -2
- data/core/class.rbs +6 -5
- data/core/comparable.rbs +55 -34
- data/core/complex.rbs +104 -78
- data/core/dir.rbs +61 -49
- data/core/encoding.rbs +12 -15
- data/core/enumerable.rbs +179 -87
- data/core/enumerator/arithmetic_sequence.rbs +70 -0
- data/core/enumerator.rbs +65 -2
- data/core/errno.rbs +11 -2
- data/core/errors.rbs +58 -29
- data/core/exception.rbs +13 -13
- data/core/fiber.rbs +74 -54
- data/core/file.rbs +280 -177
- data/core/file_test.rbs +3 -3
- data/core/float.rbs +257 -92
- data/core/gc.rbs +425 -281
- data/core/hash.rbs +1045 -739
- data/core/integer.rbs +135 -137
- data/core/io/buffer.rbs +53 -42
- data/core/io/wait.rbs +13 -35
- data/core/io.rbs +192 -144
- data/core/kernel.rbs +216 -155
- data/core/marshal.rbs +4 -4
- data/core/match_data.rbs +15 -13
- data/core/math.rbs +107 -66
- data/core/method.rbs +69 -33
- data/core/module.rbs +244 -106
- data/core/nil_class.rbs +7 -6
- data/core/numeric.rbs +74 -63
- data/core/object.rbs +9 -11
- data/core/object_space.rbs +30 -23
- data/core/pathname.rbs +1322 -0
- data/core/proc.rbs +95 -58
- data/core/process.rbs +222 -202
- data/core/ractor.rbs +371 -515
- data/core/random.rbs +21 -3
- data/core/range.rbs +159 -57
- data/core/rational.rbs +60 -89
- data/core/rbs/unnamed/argf.rbs +60 -53
- data/core/rbs/unnamed/env_class.rbs +19 -14
- data/core/rbs/unnamed/main_class.rbs +123 -0
- data/core/rbs/unnamed/random.rbs +11 -118
- data/core/regexp.rbs +258 -214
- data/core/ruby.rbs +53 -0
- data/core/ruby_vm.rbs +38 -34
- data/core/rubygems/config_file.rbs +5 -5
- data/core/rubygems/errors.rbs +4 -71
- data/core/rubygems/requirement.rbs +5 -5
- data/core/rubygems/rubygems.rbs +16 -82
- data/core/rubygems/version.rbs +2 -3
- data/core/set.rbs +490 -360
- data/core/signal.rbs +26 -16
- data/core/string.rbs +3234 -1285
- data/core/struct.rbs +27 -26
- data/core/symbol.rbs +41 -34
- data/core/thread.rbs +135 -67
- data/core/time.rbs +81 -50
- data/core/trace_point.rbs +41 -35
- data/core/true_class.rbs +2 -2
- data/core/unbound_method.rbs +24 -16
- data/core/warning.rbs +7 -7
- data/docs/aliases.md +79 -0
- data/docs/collection.md +3 -3
- data/docs/config.md +171 -0
- data/docs/encoding.md +56 -0
- data/docs/gem.md +0 -1
- data/docs/inline.md +576 -0
- data/docs/sigs.md +3 -3
- data/docs/syntax.md +46 -16
- data/docs/type_fingerprint.md +21 -0
- data/exe/rbs +1 -1
- data/ext/rbs_extension/ast_translation.c +544 -116
- data/ext/rbs_extension/ast_translation.h +3 -0
- data/ext/rbs_extension/class_constants.c +16 -2
- data/ext/rbs_extension/class_constants.h +8 -0
- data/ext/rbs_extension/extconf.rb +5 -1
- data/ext/rbs_extension/legacy_location.c +33 -56
- data/ext/rbs_extension/legacy_location.h +37 -0
- data/ext/rbs_extension/main.c +44 -35
- data/include/rbs/ast.h +448 -173
- data/include/rbs/defines.h +27 -0
- data/include/rbs/lexer.h +30 -11
- data/include/rbs/location.h +25 -44
- data/include/rbs/parser.h +6 -6
- data/include/rbs/string.h +0 -2
- data/include/rbs/util/rbs_allocator.h +34 -13
- data/include/rbs/util/rbs_assert.h +12 -1
- data/include/rbs/util/rbs_constant_pool.h +0 -3
- data/include/rbs/util/rbs_encoding.h +2 -0
- data/include/rbs/util/rbs_unescape.h +2 -1
- data/include/rbs.h +8 -0
- data/lib/rbs/ast/annotation.rb +1 -1
- data/lib/rbs/ast/comment.rb +1 -1
- data/lib/rbs/ast/declarations.rb +10 -10
- data/lib/rbs/ast/members.rb +14 -14
- data/lib/rbs/ast/ruby/annotations.rb +293 -3
- data/lib/rbs/ast/ruby/comment_block.rb +24 -0
- data/lib/rbs/ast/ruby/declarations.rb +198 -3
- data/lib/rbs/ast/ruby/helpers/constant_helper.rb +4 -0
- data/lib/rbs/ast/ruby/members.rb +532 -22
- data/lib/rbs/ast/type_param.rb +24 -4
- data/lib/rbs/buffer.rb +20 -15
- data/lib/rbs/cli/diff.rb +16 -15
- data/lib/rbs/cli/validate.rb +38 -106
- data/lib/rbs/cli.rb +52 -19
- data/lib/rbs/collection/config/lockfile_generator.rb +14 -2
- data/lib/rbs/collection/sources/git.rb +1 -0
- data/lib/rbs/definition.rb +1 -1
- data/lib/rbs/definition_builder/ancestor_builder.rb +62 -9
- data/lib/rbs/definition_builder/method_builder.rb +20 -0
- data/lib/rbs/definition_builder.rb +147 -25
- data/lib/rbs/diff.rb +7 -1
- data/lib/rbs/environment.rb +227 -74
- data/lib/rbs/environment_loader.rb +0 -6
- data/lib/rbs/errors.rb +27 -18
- data/lib/rbs/inline_parser.rb +342 -6
- data/lib/rbs/location_aux.rb +1 -1
- data/lib/rbs/locator.rb +5 -1
- data/lib/rbs/method_type.rb +5 -3
- data/lib/rbs/parser_aux.rb +20 -7
- data/lib/rbs/prototype/helpers.rb +57 -0
- data/lib/rbs/prototype/rb.rb +3 -28
- data/lib/rbs/prototype/rbi.rb +3 -20
- data/lib/rbs/prototype/runtime.rb +8 -0
- data/lib/rbs/resolver/constant_resolver.rb +2 -2
- data/lib/rbs/resolver/type_name_resolver.rb +116 -38
- data/lib/rbs/subtractor.rb +3 -1
- data/lib/rbs/test/type_check.rb +19 -2
- data/lib/rbs/type_name.rb +1 -1
- data/lib/rbs/types.rb +88 -78
- data/lib/rbs/unit_test/type_assertions.rb +35 -8
- data/lib/rbs/validator.rb +2 -2
- data/lib/rbs/version.rb +1 -1
- data/lib/rbs.rb +1 -2
- data/lib/rdoc/discover.rb +1 -1
- data/lib/rdoc_plugin/parser.rb +1 -1
- data/rbs.gemspec +4 -3
- data/rust/.gitignore +1 -0
- data/rust/Cargo.lock +378 -0
- data/rust/Cargo.toml +7 -0
- data/rust/ruby-rbs/Cargo.toml +22 -0
- data/rust/ruby-rbs/build.rs +764 -0
- data/rust/ruby-rbs/examples/locations.rs +60 -0
- data/rust/ruby-rbs/src/lib.rs +1 -0
- data/rust/ruby-rbs/src/node/mod.rs +742 -0
- data/rust/ruby-rbs/tests/sanity.rs +47 -0
- data/rust/ruby-rbs/vendor/rbs/config.yml +1 -0
- data/rust/ruby-rbs-sys/Cargo.toml +23 -0
- data/rust/ruby-rbs-sys/build.rs +204 -0
- data/rust/ruby-rbs-sys/src/lib.rs +50 -0
- data/rust/ruby-rbs-sys/vendor/rbs/include +1 -0
- data/rust/ruby-rbs-sys/vendor/rbs/src +1 -0
- data/rust/ruby-rbs-sys/wrapper.h +1 -0
- data/schema/typeParam.json +17 -1
- data/sig/ast/ruby/annotations.rbs +315 -4
- data/sig/ast/ruby/comment_block.rbs +8 -0
- data/sig/ast/ruby/declarations.rbs +102 -4
- data/sig/ast/ruby/members.rbs +108 -2
- data/sig/cli/diff.rbs +5 -11
- data/sig/cli/validate.rbs +12 -8
- data/sig/cli.rbs +18 -18
- data/sig/definition.rbs +6 -1
- data/sig/definition_builder.rbs +2 -0
- data/sig/environment.rbs +70 -12
- data/sig/errors.rbs +13 -14
- data/sig/inline_parser.rbs +39 -2
- data/sig/locator.rbs +0 -2
- data/sig/manifest.yaml +0 -1
- data/sig/method_builder.rbs +3 -1
- data/sig/parser.rbs +31 -13
- data/sig/prototype/helpers.rbs +2 -0
- data/sig/resolver/type_name_resolver.rbs +35 -7
- data/sig/source.rbs +3 -3
- data/sig/type_param.rbs +13 -8
- data/sig/types.rbs +6 -7
- data/sig/unit_test/spy.rbs +0 -8
- data/sig/unit_test/type_assertions.rbs +11 -0
- data/src/ast.c +410 -153
- data/src/lexer.c +1392 -1313
- data/src/lexer.re +3 -0
- data/src/lexstate.c +58 -37
- data/src/location.c +8 -48
- data/src/parser.c +977 -516
- data/src/string.c +0 -48
- data/src/util/rbs_allocator.c +89 -71
- data/src/util/rbs_assert.c +1 -1
- data/src/util/rbs_buffer.c +2 -2
- data/src/util/rbs_constant_pool.c +10 -14
- data/src/util/rbs_encoding.c +4 -8
- data/src/util/rbs_unescape.c +56 -20
- data/stdlib/bigdecimal/0/big_decimal.rbs +116 -98
- data/stdlib/bigdecimal-math/0/big_math.rbs +169 -8
- data/stdlib/cgi/0/core.rbs +9 -393
- data/stdlib/cgi/0/manifest.yaml +1 -0
- data/stdlib/cgi-escape/0/escape.rbs +171 -0
- data/stdlib/coverage/0/coverage.rbs +7 -4
- data/stdlib/date/0/date.rbs +92 -79
- data/stdlib/date/0/date_time.rbs +25 -24
- data/stdlib/delegate/0/delegator.rbs +10 -7
- data/stdlib/did_you_mean/0/did_you_mean.rbs +17 -16
- data/stdlib/digest/0/digest.rbs +110 -0
- data/stdlib/erb/0/erb.rbs +748 -347
- data/stdlib/etc/0/etc.rbs +55 -50
- data/stdlib/fileutils/0/fileutils.rbs +158 -139
- data/stdlib/forwardable/0/forwardable.rbs +13 -10
- data/stdlib/io-console/0/io-console.rbs +2 -2
- data/stdlib/json/0/json.rbs +217 -136
- data/stdlib/monitor/0/monitor.rbs +3 -3
- data/stdlib/net-http/0/net-http.rbs +162 -134
- data/stdlib/objspace/0/objspace.rbs +17 -34
- data/stdlib/open-uri/0/open-uri.rbs +48 -8
- data/stdlib/open3/0/open3.rbs +469 -10
- data/stdlib/openssl/0/openssl.rbs +475 -357
- data/stdlib/optparse/0/optparse.rbs +26 -17
- data/stdlib/pathname/0/pathname.rbs +11 -1381
- data/stdlib/pp/0/pp.rbs +9 -8
- data/stdlib/prettyprint/0/prettyprint.rbs +7 -7
- data/stdlib/pstore/0/pstore.rbs +35 -30
- data/stdlib/psych/0/psych.rbs +65 -12
- data/stdlib/psych/0/store.rbs +2 -4
- data/stdlib/pty/0/pty.rbs +9 -6
- data/stdlib/random-formatter/0/random-formatter.rbs +277 -0
- data/stdlib/rdoc/0/code_object.rbs +2 -1
- data/stdlib/rdoc/0/parser.rbs +1 -1
- data/stdlib/rdoc/0/rdoc.rbs +1 -1
- data/stdlib/rdoc/0/store.rbs +1 -1
- data/stdlib/resolv/0/resolv.rbs +25 -68
- data/stdlib/ripper/0/ripper.rbs +22 -19
- data/stdlib/securerandom/0/manifest.yaml +2 -0
- data/stdlib/securerandom/0/securerandom.rbs +7 -20
- data/stdlib/shellwords/0/shellwords.rbs +2 -2
- data/stdlib/singleton/0/singleton.rbs +3 -0
- data/stdlib/socket/0/addrinfo.rbs +7 -7
- data/stdlib/socket/0/basic_socket.rbs +3 -3
- data/stdlib/socket/0/ip_socket.rbs +10 -8
- data/stdlib/socket/0/socket.rbs +23 -10
- data/stdlib/socket/0/tcp_server.rbs +1 -1
- data/stdlib/socket/0/tcp_socket.rbs +11 -3
- data/stdlib/socket/0/udp_socket.rbs +1 -1
- data/stdlib/socket/0/unix_server.rbs +1 -1
- data/stdlib/stringio/0/stringio.rbs +1177 -85
- data/stdlib/strscan/0/string_scanner.rbs +27 -25
- data/stdlib/tempfile/0/tempfile.rbs +25 -21
- data/stdlib/time/0/time.rbs +8 -6
- data/stdlib/timeout/0/timeout.rbs +63 -7
- data/stdlib/tsort/0/cyclic.rbs +3 -0
- data/stdlib/tsort/0/tsort.rbs +7 -6
- data/stdlib/uri/0/common.rbs +42 -20
- data/stdlib/uri/0/file.rbs +3 -3
- data/stdlib/uri/0/generic.rbs +26 -18
- data/stdlib/uri/0/http.rbs +2 -2
- data/stdlib/uri/0/ldap.rbs +2 -2
- data/stdlib/uri/0/mailto.rbs +3 -3
- data/stdlib/uri/0/rfc2396_parser.rbs +12 -12
- data/stdlib/zlib/0/deflate.rbs +4 -3
- data/stdlib/zlib/0/gzip_reader.rbs +6 -6
- data/stdlib/zlib/0/gzip_writer.rbs +14 -12
- data/stdlib/zlib/0/inflate.rbs +1 -1
- data/stdlib/zlib/0/need_dict.rbs +1 -1
- data/stdlib/zlib/0/zstream.rbs +1 -0
- metadata +50 -6
data/core/rational.rbs
CHANGED
|
@@ -53,15 +53,16 @@ class Rational < Numeric
|
|
|
53
53
|
|
|
54
54
|
# <!--
|
|
55
55
|
# rdoc-file=rational.c
|
|
56
|
-
# -
|
|
56
|
+
# - self * other -> numeric
|
|
57
57
|
# -->
|
|
58
|
-
#
|
|
58
|
+
# Returns the numeric product of `self` and `other`:
|
|
59
59
|
#
|
|
60
|
-
# Rational(
|
|
61
|
-
# Rational(
|
|
62
|
-
# Rational(
|
|
63
|
-
# Rational(
|
|
64
|
-
# Rational(
|
|
60
|
+
# Rational(9, 8) * 4 #=> (9/2)
|
|
61
|
+
# Rational(20, 9) * 9.8 #=> 21.77777777777778
|
|
62
|
+
# Rational(9, 8) * Complex(1, 2) # => ((9/8)+(9/4)*i)
|
|
63
|
+
# Rational(2, 3) * Rational(2, 3) #=> (4/9)
|
|
64
|
+
# Rational(900) * Rational(1) #=> (900/1)
|
|
65
|
+
# Rational(-2, 9) * Rational(-9, 2) #=> (1/1)
|
|
65
66
|
#
|
|
66
67
|
def *: (Integer) -> Rational
|
|
67
68
|
| (Rational) -> Rational
|
|
@@ -69,9 +70,9 @@ class Rational < Numeric
|
|
|
69
70
|
|
|
70
71
|
# <!--
|
|
71
72
|
# rdoc-file=rational.c
|
|
72
|
-
# -
|
|
73
|
+
# - self ** exponent -> numeric
|
|
73
74
|
# -->
|
|
74
|
-
#
|
|
75
|
+
# Returns `self` raised to the power `exponent`:
|
|
75
76
|
#
|
|
76
77
|
# Rational(2) ** Rational(3) #=> (8/1)
|
|
77
78
|
# Rational(10) ** -2 #=> (1/100)
|
|
@@ -85,27 +86,35 @@ class Rational < Numeric
|
|
|
85
86
|
|
|
86
87
|
# <!--
|
|
87
88
|
# rdoc-file=rational.c
|
|
88
|
-
# -
|
|
89
|
+
# - self + other -> numeric
|
|
89
90
|
# -->
|
|
90
|
-
#
|
|
91
|
+
# Returns the sum of `self` and `other`:
|
|
91
92
|
#
|
|
92
|
-
# Rational(2, 3)
|
|
93
|
-
# Rational(
|
|
94
|
-
# Rational(
|
|
95
|
-
#
|
|
96
|
-
# Rational(
|
|
93
|
+
# Rational(2, 3) + 0 # => (2/3)
|
|
94
|
+
# Rational(2, 3) + 1 # => (5/3)
|
|
95
|
+
# Rational(2, 3) + -1 # => (-1/3)
|
|
96
|
+
#
|
|
97
|
+
# Rational(2, 3) + Complex(1, 0) # => ((5/3)+0i)
|
|
98
|
+
#
|
|
99
|
+
# Rational(2, 3) + Rational(1, 1) # => (5/3)
|
|
100
|
+
# Rational(2, 3) + Rational(3, 2) # => (13/6)
|
|
101
|
+
# Rational(2, 3) + Rational(3.0, 2.0) # => (13/6)
|
|
102
|
+
# Rational(2, 3) + Rational(3.1, 2.1) # => (30399297484750849/14186338826217063)
|
|
103
|
+
#
|
|
104
|
+
# For a computation involving Floats, the result may be inexact (see Float#+):
|
|
105
|
+
#
|
|
106
|
+
# Rational(2, 3) + 1.0 # => 1.6666666666666665
|
|
107
|
+
# Rational(2, 3) + Complex(1.0, 0.0) # => (1.6666666666666665+0.0i)
|
|
97
108
|
#
|
|
98
109
|
def +: (Float) -> Float
|
|
99
110
|
| (Complex) -> Complex
|
|
100
111
|
| (Numeric) -> Rational
|
|
101
112
|
|
|
102
|
-
def +@: () -> Rational
|
|
103
|
-
|
|
104
113
|
# <!--
|
|
105
114
|
# rdoc-file=rational.c
|
|
106
|
-
# -
|
|
115
|
+
# - self - other -> numeric
|
|
107
116
|
# -->
|
|
108
|
-
#
|
|
117
|
+
# Returns the difference of `self` and `other`:
|
|
109
118
|
#
|
|
110
119
|
# Rational(2, 3) - Rational(2, 3) #=> (0/1)
|
|
111
120
|
# Rational(900) - Rational(1) #=> (899/1)
|
|
@@ -119,18 +128,20 @@ class Rational < Numeric
|
|
|
119
128
|
|
|
120
129
|
# <!--
|
|
121
130
|
# rdoc-file=rational.c
|
|
122
|
-
# - -
|
|
131
|
+
# - -self -> rational
|
|
123
132
|
# -->
|
|
124
|
-
#
|
|
133
|
+
# Returns `self`, negated:
|
|
134
|
+
#
|
|
135
|
+
# -(1/3r) # => (-1/3)
|
|
136
|
+
# -(-1/3r) # => (1/3)
|
|
125
137
|
#
|
|
126
138
|
def -@: () -> Rational
|
|
127
139
|
|
|
128
140
|
# <!--
|
|
129
141
|
# rdoc-file=rational.c
|
|
130
|
-
# -
|
|
131
|
-
# - rat.quo(numeric) -> numeric
|
|
142
|
+
# - self / other -> numeric
|
|
132
143
|
# -->
|
|
133
|
-
#
|
|
144
|
+
# Returns the quotient of `self` and `other`:
|
|
134
145
|
#
|
|
135
146
|
# Rational(2, 3) / Rational(2, 3) #=> (1/1)
|
|
136
147
|
# Rational(900) / Rational(1) #=> (900/1)
|
|
@@ -144,20 +155,29 @@ class Rational < Numeric
|
|
|
144
155
|
|
|
145
156
|
# <!--
|
|
146
157
|
# rdoc-file=rational.c
|
|
147
|
-
# -
|
|
158
|
+
# - self <=> other -> -1, 0, 1, or nil
|
|
148
159
|
# -->
|
|
149
|
-
#
|
|
150
|
-
#
|
|
160
|
+
# Compares `self` and `other`.
|
|
161
|
+
#
|
|
162
|
+
# Returns:
|
|
163
|
+
#
|
|
164
|
+
# * <code>-1</code>, if `self` is less than `other`.
|
|
165
|
+
# * `0`, if the two values are the same.
|
|
166
|
+
# * `1`, if `self` is greater than `other`.
|
|
167
|
+
# * `nil`, if the two values are incomparable.
|
|
151
168
|
#
|
|
152
|
-
#
|
|
169
|
+
# Examples:
|
|
153
170
|
#
|
|
154
|
-
# Rational(2, 3) <=> Rational(
|
|
155
|
-
# Rational(
|
|
156
|
-
# Rational(2,
|
|
157
|
-
# Rational(
|
|
158
|
-
# Rational(
|
|
171
|
+
# Rational(2, 3) <=> Rational(4, 3) # => -1
|
|
172
|
+
# Rational(2, 1) <=> Rational(2, 1) # => 0
|
|
173
|
+
# Rational(2, 1) <=> 2 # => 0
|
|
174
|
+
# Rational(2, 1) <=> 2.0 # => 0
|
|
175
|
+
# Rational(2, 1) <=> Complex(2, 0) # => 0
|
|
176
|
+
# Rational(4, 3) <=> Rational(2, 3) # => 1
|
|
177
|
+
# Rational(4, 3) <=> :foo # => nil
|
|
159
178
|
#
|
|
160
|
-
#
|
|
179
|
+
# Class Rational includes module Comparable, each of whose methods uses
|
|
180
|
+
# Rational#<=> for comparison.
|
|
161
181
|
#
|
|
162
182
|
def <=>: (Integer | Rational) -> Integer
|
|
163
183
|
| (untyped) -> Integer?
|
|
@@ -188,12 +208,6 @@ class Rational < Numeric
|
|
|
188
208
|
#
|
|
189
209
|
def abs: () -> Rational
|
|
190
210
|
|
|
191
|
-
def abs2: () -> Rational
|
|
192
|
-
|
|
193
|
-
def angle: () -> (Integer | Float)
|
|
194
|
-
|
|
195
|
-
alias arg angle
|
|
196
|
-
|
|
197
211
|
# <!--
|
|
198
212
|
# rdoc-file=rational.c
|
|
199
213
|
# - rat.ceil([ndigits]) -> integer or rational
|
|
@@ -202,7 +216,7 @@ class Rational < Numeric
|
|
|
202
216
|
# `ndigits` decimal digits (default: 0).
|
|
203
217
|
#
|
|
204
218
|
# When the precision is negative, the returned value is an integer with at least
|
|
205
|
-
#
|
|
219
|
+
# <code>ndigits.abs</code> trailing zeros.
|
|
206
220
|
#
|
|
207
221
|
# Returns a rational when `ndigits` is positive, otherwise returns an integer.
|
|
208
222
|
#
|
|
@@ -222,10 +236,6 @@ class Rational < Numeric
|
|
|
222
236
|
|
|
223
237
|
def coerce: (Numeric) -> [ Numeric, Numeric ]
|
|
224
238
|
|
|
225
|
-
def conj: () -> Rational
|
|
226
|
-
|
|
227
|
-
def conjugate: () -> Rational
|
|
228
|
-
|
|
229
239
|
# <!--
|
|
230
240
|
# rdoc-file=rational.c
|
|
231
241
|
# - rat.denominator -> integer
|
|
@@ -239,15 +249,9 @@ class Rational < Numeric
|
|
|
239
249
|
#
|
|
240
250
|
def denominator: () -> Integer
|
|
241
251
|
|
|
242
|
-
def div: (Numeric) -> Integer
|
|
243
|
-
|
|
244
252
|
def divmod: (Integer | Float | Rational) -> [ Integer, Rational ]
|
|
245
253
|
| (Numeric) -> [ Numeric, Numeric ]
|
|
246
254
|
|
|
247
|
-
def dup: () -> self
|
|
248
|
-
|
|
249
|
-
def eql?: (untyped) -> bool
|
|
250
|
-
|
|
251
255
|
# <!--
|
|
252
256
|
# rdoc-file=rational.c
|
|
253
257
|
# - rat.fdiv(numeric) -> float
|
|
@@ -260,8 +264,6 @@ class Rational < Numeric
|
|
|
260
264
|
#
|
|
261
265
|
def fdiv: (Numeric) -> Float
|
|
262
266
|
|
|
263
|
-
def finite?: () -> bool
|
|
264
|
-
|
|
265
267
|
# <!--
|
|
266
268
|
# rdoc-file=rational.c
|
|
267
269
|
# - rat.floor([ndigits]) -> integer or rational
|
|
@@ -270,7 +272,7 @@ class Rational < Numeric
|
|
|
270
272
|
# `ndigits` decimal digits (default: 0).
|
|
271
273
|
#
|
|
272
274
|
# When the precision is negative, the returned value is an integer with at least
|
|
273
|
-
#
|
|
275
|
+
# <code>ndigits.abs</code> trailing zeros.
|
|
274
276
|
#
|
|
275
277
|
# Returns a rational when `ndigits` is positive, otherwise returns an integer.
|
|
276
278
|
#
|
|
@@ -295,14 +297,6 @@ class Rational < Numeric
|
|
|
295
297
|
#
|
|
296
298
|
def hash: () -> Integer
|
|
297
299
|
|
|
298
|
-
def i: () -> Complex
|
|
299
|
-
|
|
300
|
-
def imag: () -> Integer
|
|
301
|
-
|
|
302
|
-
def imaginary: () -> Integer
|
|
303
|
-
|
|
304
|
-
def infinite?: () -> Integer?
|
|
305
|
-
|
|
306
300
|
# <!--
|
|
307
301
|
# rdoc-file=rational.c
|
|
308
302
|
# - rat.inspect -> string
|
|
@@ -315,8 +309,6 @@ class Rational < Numeric
|
|
|
315
309
|
#
|
|
316
310
|
def inspect: () -> String
|
|
317
311
|
|
|
318
|
-
def integer?: () -> bool
|
|
319
|
-
|
|
320
312
|
# <!-- rdoc-file=rational.c -->
|
|
321
313
|
# Returns the absolute value of `rat`.
|
|
322
314
|
#
|
|
@@ -336,8 +328,6 @@ class Rational < Numeric
|
|
|
336
328
|
#
|
|
337
329
|
def negative?: () -> bool
|
|
338
330
|
|
|
339
|
-
def nonzero?: () -> self?
|
|
340
|
-
|
|
341
331
|
# <!--
|
|
342
332
|
# rdoc-file=rational.c
|
|
343
333
|
# - rat.numerator -> integer
|
|
@@ -351,8 +341,6 @@ class Rational < Numeric
|
|
|
351
341
|
#
|
|
352
342
|
def numerator: () -> Integer
|
|
353
343
|
|
|
354
|
-
alias phase angle
|
|
355
|
-
|
|
356
344
|
def polar: () -> [ Rational, Integer | Float ]
|
|
357
345
|
|
|
358
346
|
# <!--
|
|
@@ -364,7 +352,7 @@ class Rational < Numeric
|
|
|
364
352
|
def positive?: () -> bool
|
|
365
353
|
|
|
366
354
|
# <!-- rdoc-file=rational.c -->
|
|
367
|
-
#
|
|
355
|
+
# Returns the quotient of `self` and `other`:
|
|
368
356
|
#
|
|
369
357
|
# Rational(2, 3) / Rational(2, 3) #=> (1/1)
|
|
370
358
|
# Rational(900) / Rational(1) #=> (900/1)
|
|
@@ -391,14 +379,8 @@ class Rational < Numeric
|
|
|
391
379
|
#
|
|
392
380
|
def rationalize: (?Numeric eps) -> Rational
|
|
393
381
|
|
|
394
|
-
def real: () -> Rational
|
|
395
|
-
|
|
396
|
-
def real?: () -> true
|
|
397
|
-
|
|
398
382
|
def rect: () -> [ Rational, Numeric ]
|
|
399
383
|
|
|
400
|
-
alias rectangular rect
|
|
401
|
-
|
|
402
384
|
def remainder: (Float) -> Float
|
|
403
385
|
| (Numeric) -> Rational
|
|
404
386
|
|
|
@@ -410,7 +392,7 @@ class Rational < Numeric
|
|
|
410
392
|
# decimal digits (default: 0).
|
|
411
393
|
#
|
|
412
394
|
# When the precision is negative, the returned value is an integer with at least
|
|
413
|
-
#
|
|
395
|
+
# <code>ndigits.abs</code> trailing zeros.
|
|
414
396
|
#
|
|
415
397
|
# Returns a rational when `ndigits` is positive, otherwise returns an integer.
|
|
416
398
|
#
|
|
@@ -440,13 +422,6 @@ class Rational < Numeric
|
|
|
440
422
|
def round: (?half: :up | :down | :even) -> Integer
|
|
441
423
|
| (Integer digits, ?half: :up | :down | :even) -> (Integer | Rational)
|
|
442
424
|
|
|
443
|
-
def step: (?Numeric limit, ?Numeric step) { (Rational) -> void } -> self
|
|
444
|
-
| (?Numeric limit, ?Numeric step) -> Enumerator[Rational, self]
|
|
445
|
-
| (?by: Numeric, ?to: Numeric) { (Rational) -> void } -> self
|
|
446
|
-
| (?by: Numeric, ?to: Numeric) -> Enumerator[Rational, self]
|
|
447
|
-
|
|
448
|
-
def to_c: () -> Complex
|
|
449
|
-
|
|
450
425
|
# <!--
|
|
451
426
|
# rdoc-file=rational.c
|
|
452
427
|
# - rat.to_f -> float
|
|
@@ -476,8 +451,6 @@ class Rational < Numeric
|
|
|
476
451
|
#
|
|
477
452
|
def to_i: () -> Integer
|
|
478
453
|
|
|
479
|
-
alias to_int to_i
|
|
480
|
-
|
|
481
454
|
# <!--
|
|
482
455
|
# rdoc-file=rational.c
|
|
483
456
|
# - rat.to_r -> self
|
|
@@ -509,7 +482,7 @@ class Rational < Numeric
|
|
|
509
482
|
# digits (default: 0).
|
|
510
483
|
#
|
|
511
484
|
# When the precision is negative, the returned value is an integer with at least
|
|
512
|
-
#
|
|
485
|
+
# <code>ndigits.abs</code> trailing zeros.
|
|
513
486
|
#
|
|
514
487
|
# Returns a rational when `ndigits` is positive, otherwise returns an integer.
|
|
515
488
|
#
|
|
@@ -526,6 +499,4 @@ class Rational < Numeric
|
|
|
526
499
|
#
|
|
527
500
|
def truncate: () -> Integer
|
|
528
501
|
| (Integer ndigits) -> (Integer | Rational)
|
|
529
|
-
|
|
530
|
-
def zero?: () -> bool
|
|
531
502
|
end
|
data/core/rbs/unnamed/argf.rbs
CHANGED
|
@@ -4,7 +4,7 @@ module RBS
|
|
|
4
4
|
# ## ARGF and `ARGV`
|
|
5
5
|
#
|
|
6
6
|
# The ARGF object works with the array at global variable `ARGV` to make
|
|
7
|
-
#
|
|
7
|
+
# <code>$stdin</code> and file streams available in the Ruby program:
|
|
8
8
|
#
|
|
9
9
|
# * **ARGV** may be thought of as the **argument vector** array.
|
|
10
10
|
#
|
|
@@ -13,9 +13,9 @@ module RBS
|
|
|
13
13
|
#
|
|
14
14
|
# * **ARGF** may be thought of as the **argument files** object.
|
|
15
15
|
#
|
|
16
|
-
# It can access file streams and/or the
|
|
17
|
-
# finds in `ARGV`. This provides a convenient way for the command
|
|
18
|
-
# specify streams for a Ruby program to read.
|
|
16
|
+
# It can access file streams and/or the <code>$stdin</code> stream, based on
|
|
17
|
+
# what it finds in `ARGV`. This provides a convenient way for the command
|
|
18
|
+
# line to specify streams for a Ruby program to read.
|
|
19
19
|
#
|
|
20
20
|
# ## Reading
|
|
21
21
|
#
|
|
@@ -24,16 +24,16 @@ module RBS
|
|
|
24
24
|
#
|
|
25
25
|
# ### Simplest Case
|
|
26
26
|
#
|
|
27
|
-
# When the *very first* ARGF read occurs with an empty `ARGV` (
|
|
28
|
-
# is
|
|
27
|
+
# When the *very first* ARGF read occurs with an empty `ARGV` (<code>[]</code>),
|
|
28
|
+
# the source is <code>$stdin</code>:
|
|
29
29
|
#
|
|
30
|
-
# * File
|
|
30
|
+
# * File <code>t.rb</code>:
|
|
31
31
|
#
|
|
32
32
|
# p ['ARGV', ARGV]
|
|
33
33
|
# p ['ARGF.read', ARGF.read]
|
|
34
34
|
#
|
|
35
|
-
# * Commands and outputs (see below for the content of files
|
|
36
|
-
#
|
|
35
|
+
# * Commands and outputs (see below for the content of files
|
|
36
|
+
# <code>foo.txt</code> and <code>bar.txt</code>):
|
|
37
37
|
#
|
|
38
38
|
# $ echo "Open the pod bay doors, Hal." | ruby t.rb
|
|
39
39
|
# ["ARGV", []]
|
|
@@ -45,7 +45,8 @@ module RBS
|
|
|
45
45
|
#
|
|
46
46
|
# ### About the Examples
|
|
47
47
|
#
|
|
48
|
-
# Many examples here assume the existence of files
|
|
48
|
+
# Many examples here assume the existence of files <code>foo.txt</code> and
|
|
49
|
+
# <code>bar.txt</code>:
|
|
49
50
|
#
|
|
50
51
|
# $ cat foo.txt
|
|
51
52
|
# Foo 0
|
|
@@ -66,19 +67,20 @@ module RBS
|
|
|
66
67
|
# one of:
|
|
67
68
|
#
|
|
68
69
|
# * The string path to a file that may be opened as a stream.
|
|
69
|
-
# * The character
|
|
70
|
+
# * The character <code>'-'</code>, meaning stream <code>$stdin</code>.
|
|
70
71
|
#
|
|
71
72
|
# Each element that is *not* one of these should be removed from `ARGV` before
|
|
72
73
|
# ARGF accesses that source.
|
|
73
74
|
#
|
|
74
75
|
# In the following example:
|
|
75
76
|
#
|
|
76
|
-
# * Filepaths
|
|
77
|
-
#
|
|
77
|
+
# * Filepaths <code>foo.txt</code> and <code>bar.txt</code> may be retained as
|
|
78
|
+
# potential sources.
|
|
79
|
+
# * Options <code>--xyzzy</code> and <code>--mojo</code> should be removed.
|
|
78
80
|
#
|
|
79
81
|
# Example:
|
|
80
82
|
#
|
|
81
|
-
# * File
|
|
83
|
+
# * File <code>t.rb</code>:
|
|
82
84
|
#
|
|
83
85
|
# # Print arguments (and options, if any) found on command line.
|
|
84
86
|
# p ['ARGV', ARGV]
|
|
@@ -90,10 +92,10 @@ module RBS
|
|
|
90
92
|
#
|
|
91
93
|
# ARGF's stream access considers the elements of `ARGV`, left to right:
|
|
92
94
|
#
|
|
93
|
-
# * File
|
|
95
|
+
# * File <code>t.rb</code>:
|
|
94
96
|
#
|
|
95
97
|
# p "ARGV: #{ARGV}"
|
|
96
|
-
# p "
|
|
98
|
+
# p "Read: #{ARGF.read}" # Read everything from all specified streams.
|
|
97
99
|
#
|
|
98
100
|
# * Command and output:
|
|
99
101
|
#
|
|
@@ -112,7 +114,7 @@ module RBS
|
|
|
112
114
|
# Each element in `ARGV` is removed when its corresponding source is accessed;
|
|
113
115
|
# when all sources have been accessed, the array is empty:
|
|
114
116
|
#
|
|
115
|
-
# * File
|
|
117
|
+
# * File <code>t.rb</code>:
|
|
116
118
|
#
|
|
117
119
|
# until ARGV.empty? && ARGF.eof?
|
|
118
120
|
# p "ARGV: #{ARGV}"
|
|
@@ -142,7 +144,7 @@ module RBS
|
|
|
142
144
|
# This program prints what it reads from files at the paths specified on the
|
|
143
145
|
# command line:
|
|
144
146
|
#
|
|
145
|
-
# * File
|
|
147
|
+
# * File <code>t.rb</code>:
|
|
146
148
|
#
|
|
147
149
|
# p ['ARGV', ARGV]
|
|
148
150
|
# # Read and print all content from the specified sources.
|
|
@@ -154,11 +156,12 @@ module RBS
|
|
|
154
156
|
# ["ARGV", [foo.txt, bar.txt]
|
|
155
157
|
# ["ARGF.read", "Foo 0\nFoo 1\nBar 0\nBar 1\nBar 2\nBar 3\n"]
|
|
156
158
|
#
|
|
157
|
-
# #### Specifying
|
|
159
|
+
# #### Specifying <code>$stdin</code> in `ARGV`
|
|
158
160
|
#
|
|
159
|
-
# To specify stream
|
|
161
|
+
# To specify stream <code>$stdin</code> in `ARGV`, us the character
|
|
162
|
+
# <code>'-'</code>:
|
|
160
163
|
#
|
|
161
|
-
# * File
|
|
164
|
+
# * File <code>t.rb</code>:
|
|
162
165
|
#
|
|
163
166
|
# p ['ARGV', ARGV]
|
|
164
167
|
# p ['ARGF.read', ARGF.read]
|
|
@@ -169,8 +172,9 @@ module RBS
|
|
|
169
172
|
# ["ARGV", ["-"]]
|
|
170
173
|
# ["ARGF.read", "Open the pod bay doors, Hal.\n"]
|
|
171
174
|
#
|
|
172
|
-
# When no character
|
|
173
|
-
# [Specifying $stdin in
|
|
175
|
+
# When no character <code>'-'</code> is given, stream <code>$stdin</code> is
|
|
176
|
+
# ignored (exception: see [Specifying $stdin in
|
|
177
|
+
# ARGV](rdoc-ref:ARGF@Specifying+-24stdin+in+ARGV)):
|
|
174
178
|
#
|
|
175
179
|
# * Command and output:
|
|
176
180
|
#
|
|
@@ -181,7 +185,7 @@ module RBS
|
|
|
181
185
|
# #### Mixtures and Repetitions in `ARGV`
|
|
182
186
|
#
|
|
183
187
|
# For an ARGF reader, `ARGV` may contain any mixture of filepaths and character
|
|
184
|
-
#
|
|
188
|
+
# <code>'-'</code>, including repetitions.
|
|
185
189
|
#
|
|
186
190
|
# #### Modifications to `ARGV`
|
|
187
191
|
#
|
|
@@ -208,13 +212,13 @@ module RBS
|
|
|
208
212
|
# ### About Enumerable
|
|
209
213
|
#
|
|
210
214
|
# ARGF includes module Enumerable. Virtually all methods in Enumerable call
|
|
211
|
-
# method
|
|
215
|
+
# method <code>#each</code> in the including class.
|
|
212
216
|
#
|
|
213
217
|
# **Note well**: In ARGF, method #each returns data from the *sources*, *not*
|
|
214
|
-
# from `ARGV`; therefore, for example,
|
|
215
|
-
# from the sources, not an array of the strings from `ARGV`:
|
|
218
|
+
# from `ARGV`; therefore, for example, <code>ARGF#entries</code> returns an
|
|
219
|
+
# array of lines from the sources, not an array of the strings from `ARGV`:
|
|
216
220
|
#
|
|
217
|
-
# * File
|
|
221
|
+
# * File <code>t.rb</code>:
|
|
218
222
|
#
|
|
219
223
|
# p ['ARGV', ARGV]
|
|
220
224
|
# p ['ARGF.entries', ARGF.entries]
|
|
@@ -521,8 +525,8 @@ module RBS
|
|
|
521
525
|
# rdoc-file=io.c
|
|
522
526
|
# - ARGF.file -> IO or File object
|
|
523
527
|
# -->
|
|
524
|
-
# Returns the current file as an IO or File object.
|
|
525
|
-
# the current file is STDIN.
|
|
528
|
+
# Returns the current file as an IO or File object. <code>$stdin</code> is
|
|
529
|
+
# returned when the current file is STDIN.
|
|
526
530
|
#
|
|
527
531
|
# For example:
|
|
528
532
|
#
|
|
@@ -630,8 +634,9 @@ module RBS
|
|
|
630
634
|
# -->
|
|
631
635
|
# Returns the next line from the current file in ARGF.
|
|
632
636
|
#
|
|
633
|
-
# By default lines are assumed to be separated by
|
|
634
|
-
# character as a separator, supply it as a String for the *sep*
|
|
637
|
+
# By default lines are assumed to be separated by <code>$/</code>; to use a
|
|
638
|
+
# different character as a separator, supply it as a String for the *sep*
|
|
639
|
+
# argument.
|
|
635
640
|
#
|
|
636
641
|
# The optional *limit* argument specifies how many characters of each line to
|
|
637
642
|
# return. By default all characters are returned.
|
|
@@ -647,7 +652,7 @@ module RBS
|
|
|
647
652
|
# -->
|
|
648
653
|
# Returns the file extension appended to the names of backup copies of modified
|
|
649
654
|
# files under in-place edit mode. This value can be set using ARGF.inplace_mode=
|
|
650
|
-
# or passing the
|
|
655
|
+
# or passing the <code>-i</code> switch to the Ruby binary.
|
|
651
656
|
#
|
|
652
657
|
%a{annotate:rdoc:copy:ARGF#inplace_mode}
|
|
653
658
|
def inplace_mode: () -> String?
|
|
@@ -668,8 +673,9 @@ module RBS
|
|
|
668
673
|
# print line.sub("foo","bar")
|
|
669
674
|
# end
|
|
670
675
|
#
|
|
671
|
-
# First,
|
|
672
|
-
# line of
|
|
676
|
+
# First, <em>file.txt.bak</em> is created as a backup copy of <em>file.txt</em>.
|
|
677
|
+
# Then, each line of <em>file.txt</em> has the first occurrence of "foo"
|
|
678
|
+
# replaced with "bar".
|
|
673
679
|
#
|
|
674
680
|
%a{annotate:rdoc:copy:ARGF#inplace_mode=}
|
|
675
681
|
def inplace_mode=: (String) -> self
|
|
@@ -684,10 +690,10 @@ module RBS
|
|
|
684
690
|
# object.
|
|
685
691
|
#
|
|
686
692
|
# If ARGF.set_encoding has been called with two encoding names, the second is
|
|
687
|
-
# returned. Otherwise, if
|
|
688
|
-
# is returned. Failing that, if a default external encoding was
|
|
689
|
-
# command-line, that value is used. If the encoding is unknown,
|
|
690
|
-
# returned.
|
|
693
|
+
# returned. Otherwise, if <code>Encoding.default_external</code> has been set,
|
|
694
|
+
# that value is returned. Failing that, if a default external encoding was
|
|
695
|
+
# specified on the command-line, that value is used. If the encoding is unknown,
|
|
696
|
+
# `nil` is returned.
|
|
691
697
|
#
|
|
692
698
|
%a{annotate:rdoc:copy:ARGF#internal_encoding}
|
|
693
699
|
def internal_encoding: () -> Encoding
|
|
@@ -778,15 +784,15 @@ module RBS
|
|
|
778
784
|
# - print(*objects) -> nil
|
|
779
785
|
# -->
|
|
780
786
|
# Writes the given objects to the stream; returns `nil`. Appends the output
|
|
781
|
-
# record separator
|
|
782
|
-
# [Line IO](rdoc-ref:IO@Line+IO).
|
|
787
|
+
# record separator <code>$OUTPUT_RECORD_SEPARATOR</code> (<code>$\</code>), if
|
|
788
|
+
# it is not `nil`. See [Line IO](rdoc-ref:IO@Line+IO).
|
|
783
789
|
#
|
|
784
790
|
# With argument `objects` given, for each object:
|
|
785
791
|
#
|
|
786
792
|
# * Converts via its method `to_s` if not a string.
|
|
787
793
|
# * Writes to the stream.
|
|
788
794
|
# * If not the last object, writes the output field separator
|
|
789
|
-
#
|
|
795
|
+
# <code>$OUTPUT_FIELD_SEPARATOR</code> (<code>$,</code>) if it is not `nil`.
|
|
790
796
|
#
|
|
791
797
|
# With default separators:
|
|
792
798
|
#
|
|
@@ -818,8 +824,8 @@ module RBS
|
|
|
818
824
|
#
|
|
819
825
|
# "0,0.0,0/1,0+0i,zero,zero\n"
|
|
820
826
|
#
|
|
821
|
-
# With no argument given, writes the content of
|
|
822
|
-
# recent user input):
|
|
827
|
+
# With no argument given, writes the content of <code>$_</code> (which is
|
|
828
|
+
# usually the most recent user input):
|
|
823
829
|
#
|
|
824
830
|
# f = File.open('t.tmp', 'w+')
|
|
825
831
|
# gets # Sets $_ to the most recent user input.
|
|
@@ -836,7 +842,7 @@ module RBS
|
|
|
836
842
|
# Formats and writes `objects` to the stream.
|
|
837
843
|
#
|
|
838
844
|
# For details on `format_string`, see [Format
|
|
839
|
-
# Specifications](rdoc-ref:format_specifications.rdoc).
|
|
845
|
+
# Specifications](rdoc-ref:language/format_specifications.rdoc).
|
|
840
846
|
#
|
|
841
847
|
%a{annotate:rdoc:copy:ARGF#printf}
|
|
842
848
|
def printf: (String format_string, *untyped args) -> nil
|
|
@@ -871,13 +877,13 @@ module RBS
|
|
|
871
877
|
# newline sequence. If called without arguments, writes a newline. See [Line
|
|
872
878
|
# IO](rdoc-ref:IO@Line+IO).
|
|
873
879
|
#
|
|
874
|
-
# Note that each added newline is the character
|
|
875
|
-
# record separator (<tt
|
|
880
|
+
# Note that each added newline is the character <code>"\n"<//tt>, not the output
|
|
881
|
+
# record separator (<tt>$\</code>).
|
|
876
882
|
#
|
|
877
883
|
# Treatment for each object:
|
|
878
884
|
#
|
|
879
885
|
# * String: writes the string.
|
|
880
|
-
# * Neither string nor array: writes
|
|
886
|
+
# * Neither string nor array: writes <code>object.to_s</code>.
|
|
881
887
|
# * Array: writes each element of the array; arrays may be nested.
|
|
882
888
|
#
|
|
883
889
|
# To keep these examples brief, we define this helper method:
|
|
@@ -930,7 +936,7 @@ module RBS
|
|
|
930
936
|
# conversion is applied, if applicable. A string is returned even if EOF is
|
|
931
937
|
# encountered before any data is read.
|
|
932
938
|
#
|
|
933
|
-
# If *length* is zero, it returns an empty string (
|
|
939
|
+
# If *length* is zero, it returns an empty string (<code>""</code>).
|
|
934
940
|
#
|
|
935
941
|
# If the optional *outbuf* argument is present, it must reference a String,
|
|
936
942
|
# which will receive the data. The *outbuf* will contain only the received data
|
|
@@ -1015,8 +1021,9 @@ module RBS
|
|
|
1015
1021
|
# -->
|
|
1016
1022
|
# Returns the next line from the current file in ARGF.
|
|
1017
1023
|
#
|
|
1018
|
-
# By default lines are assumed to be separated by
|
|
1019
|
-
# character as a separator, supply it as a String for the *sep*
|
|
1024
|
+
# By default lines are assumed to be separated by <code>$/</code>; to use a
|
|
1025
|
+
# different character as a separator, supply it as a String for the *sep*
|
|
1026
|
+
# argument.
|
|
1020
1027
|
#
|
|
1021
1028
|
# The optional *limit* argument specifies how many characters of each line to
|
|
1022
1029
|
# return. By default all characters are returned.
|
|
@@ -1041,7 +1048,7 @@ module RBS
|
|
|
1041
1048
|
# lines = ARGF.readlines
|
|
1042
1049
|
# lines[0] #=> "This is line one\n"
|
|
1043
1050
|
#
|
|
1044
|
-
# See
|
|
1051
|
+
# See <code>IO.readlines</code> for a full description of all options.
|
|
1045
1052
|
#
|
|
1046
1053
|
%a{annotate:rdoc:copy:ARGF#readlines}
|
|
1047
1054
|
def readlines: (?String sep, ?Integer limit, ?chomp: boolish) -> ::Array[String]
|
|
@@ -1161,7 +1168,7 @@ module RBS
|
|
|
1161
1168
|
# lines = ARGF.readlines
|
|
1162
1169
|
# lines[0] #=> "This is line one\n"
|
|
1163
1170
|
#
|
|
1164
|
-
# See
|
|
1171
|
+
# See <code>IO.readlines</code> for a full description of all options.
|
|
1165
1172
|
#
|
|
1166
1173
|
%a{annotate:rdoc:copy:ARGF#to_a}
|
|
1167
1174
|
def to_a: (?String sep, ?Integer limit) -> ::Array[String]
|