rbs 3.1.3 → 3.2.0.pre.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +0 -6
- data/CHANGELOG.md +68 -0
- data/Gemfile +0 -6
- data/Gemfile.lock +12 -21
- data/README.md +1 -1
- data/Rakefile +44 -0
- data/Steepfile +3 -3
- data/core/array.rbs +0 -8
- data/core/builtin.rbs +28 -8
- data/core/constants.rbs +13 -5
- data/core/exception.rbs +1 -1
- data/core/global_variables.rbs +27 -27
- data/core/io.rbs +163 -172
- data/core/kernel.rbs +7 -4
- data/core/module.rbs +34 -32
- data/core/object.rbs +2 -2
- data/core/string_io.rbs +9 -0
- data/core/thread.rbs +25 -1
- data/core/time.rbs +3 -3
- data/docs/CONTRIBUTING.md +1 -1
- data/docs/rbs_by_example.md +16 -35
- data/docs/repo.md +1 -1
- data/docs/sigs.md +7 -7
- data/docs/stdlib.md +2 -3
- data/docs/syntax.md +40 -40
- data/lib/rbs/cli.rb +15 -4
- data/lib/rbs/collection/installer.rb +5 -2
- data/lib/rbs/collection/sources/stdlib.rb +5 -1
- data/lib/rbs/errors.rb +8 -1
- data/lib/rbs/file_finder.rb +1 -1
- data/lib/rbs/prototype/rb.rb +64 -6
- data/lib/rbs/prototype/rbi.rb +2 -6
- data/lib/rbs/prototype/runtime.rb +29 -8
- data/lib/rbs/subtractor.rb +17 -0
- data/lib/rbs/type_name.rb +4 -4
- data/lib/rbs/version.rb +1 -1
- data/rbs.gemspec +1 -1
- data/schema/decls.json +1 -1
- data/sig/errors.rbs +54 -0
- data/sig/parser.rbs +2 -2
- data/sig/prototype/rb.rbs +9 -1
- data/sig/subtractor.rbs +4 -0
- data/stdlib/logger/0/logger.rbs +1 -1
- data/stdlib/observable/0/observable.rbs +219 -0
- data/stdlib/uri/0/common.rbs +24 -0
- data/stdlib/zlib/0/buf_error.rbs +79 -0
- data/stdlib/zlib/0/data_error.rbs +79 -0
- data/stdlib/zlib/0/deflate.rbs +276 -0
- data/stdlib/zlib/0/error.rbs +89 -0
- data/stdlib/zlib/0/gzip_file/crc_error.rbs +115 -0
- data/stdlib/zlib/0/gzip_file/error.rbs +128 -0
- data/stdlib/zlib/0/gzip_file/length_error.rbs +115 -0
- data/stdlib/zlib/0/gzip_file/no_footer.rbs +114 -0
- data/stdlib/zlib/0/gzip_file.rbs +228 -0
- data/stdlib/zlib/0/gzip_reader.rbs +362 -0
- data/stdlib/zlib/0/gzip_writer.rbs +237 -0
- data/stdlib/zlib/0/inflate.rbs +249 -0
- data/stdlib/zlib/0/mem_error.rbs +79 -0
- data/stdlib/zlib/0/need_dict.rbs +82 -0
- data/stdlib/zlib/0/stream_end.rbs +80 -0
- data/stdlib/zlib/0/stream_error.rbs +80 -0
- data/stdlib/zlib/0/version_error.rbs +80 -0
- data/stdlib/zlib/0/zstream.rbs +270 -0
- metadata +24 -8
- data/stdlib/prime/0/integer-extension.rbs +0 -41
- data/stdlib/prime/0/manifest.yaml +0 -2
- data/stdlib/prime/0/prime.rbs +0 -372
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4c7d64866444cfce09f503377b3f8f13d183a37c4e90622789f15cd99d38cdae
|
4
|
+
data.tar.gz: c853c73b32d6135c4b06e6bc8593dbe4d5e44b5a4768def8b7c6de68536578a7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 87316a9512b8de5f073f5aab93f9ff99e5bcca464e1e418c6b12146c69fb04d4c450bb51543343527378dd6194e1b311db88d5cf24eb2e94da7ceaa4f751c1ed
|
7
|
+
data.tar.gz: 1065a9b77880aceb0b3595d0a7e4b99bf60f5061675b63686cac716cd8badf5477eecfe04f7e2d9f8cadd85eac9e1d06c6d4b7c89910414e37edca598c33f5b9
|
data/.github/workflows/ruby.yml
CHANGED
@@ -17,8 +17,6 @@ jobs:
|
|
17
17
|
- 3.2-dev-focal
|
18
18
|
- 3.1-dev-focal
|
19
19
|
- 3.0-dev-focal
|
20
|
-
- 2.7-dev-bionic
|
21
|
-
- 2.6-bionic
|
22
20
|
job:
|
23
21
|
- test
|
24
22
|
- stdlib_test
|
@@ -28,10 +26,6 @@ jobs:
|
|
28
26
|
exclude:
|
29
27
|
- container_tag: master-nightly-focal
|
30
28
|
job: confirm_lexer
|
31
|
-
- container_tag: 2.6-bionic
|
32
|
-
job: stdlib_test
|
33
|
-
- container_tag: 2.7-dev-bionic
|
34
|
-
job: stdlib_test
|
35
29
|
- container_tag: 3.0-dev-focal
|
36
30
|
job: stdlib_test
|
37
31
|
- container_tag: 3.1-dev-focal
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,74 @@
|
|
2
2
|
|
3
3
|
## master
|
4
4
|
|
5
|
+
## 3.2.0.pre.1 (2023-08-18)
|
6
|
+
|
7
|
+
### Signature updates
|
8
|
+
|
9
|
+
* observable ([#1424](https://github.com/ruby/rbs/pull/1424))
|
10
|
+
* uri ([#1371](https://github.com/ruby/rbs/pull/1371))
|
11
|
+
* zlib ([#1389](https://github.com/ruby/rbs/pull/1389))
|
12
|
+
* `IO` ([#1399](https://github.com/ruby/rbs/pull/1399))
|
13
|
+
* `::DATA` ([#1395](https://github.com/ruby/rbs/pull/1395))
|
14
|
+
* `$DEBUG` ([#1427](https://github.com/ruby/rbs/pull/1427))
|
15
|
+
* `ConditionVariable#wait` ([#1397](https://github.com/ruby/rbs/pull/1397))
|
16
|
+
* `Kernel::exit!` ([#1396](https://github.com/ruby/rbs/pull/1396))
|
17
|
+
* `Kernel#exec` ([#1368](https://github.com/ruby/rbs/pull/1368))
|
18
|
+
* `Kernel#p`, `Kernel#pp` ([#1342](https://github.com/ruby/rbs/pull/1342))
|
19
|
+
* `Logger.new` ([#1423](https://github.com/ruby/rbs/pull/1423))
|
20
|
+
* `Module` ([#1321](https://github.com/ruby/rbs/pull/1321))
|
21
|
+
* `Object#define_singleton_method` ([#1431](https://github.com/ruby/rbs/pull/1431))
|
22
|
+
* `Object#enum_for` ([#1327](https://github.com/ruby/rbs/pull/1327))
|
23
|
+
* `StringIO#truncate` ([#1425](https://github.com/ruby/rbs/pull/1425))
|
24
|
+
* `Thread#raise` ([#1426](https://github.com/ruby/rbs/pull/1426))
|
25
|
+
* `Time#round`, `Time#floor`, `Time#ceil` ([#1337](https://github.com/ruby/rbs/pull/1337))
|
26
|
+
* Remove `TRUE`, `FALSE`, and `NIL` constants ([#1432](https://github.com/ruby/rbs/pull/1432))
|
27
|
+
* Updated builtin.rbs's interfaces ([#1429](https://github.com/ruby/rbs/pull/1429))
|
28
|
+
* Convert `| nil` to `?` in global_variables.rbs ([#1430](https://github.com/ruby/rbs/pull/1430))
|
29
|
+
* Remove references to the transient heap ([#1374](https://github.com/ruby/rbs/pull/1374))
|
30
|
+
|
31
|
+
### Library changes
|
32
|
+
|
33
|
+
* subtract: Remove RBS file if the subtracted definition is empty ([#1385](https://github.com/ruby/rbs/pull/1385))
|
34
|
+
* subtract: Filter redundant access modifiers ([#1384](https://github.com/ruby/rbs/pull/1384))
|
35
|
+
* Fix module alias normalizations ([#1393](https://github.com/ruby/rbs/pull/1393))
|
36
|
+
* Reduce memory allocation on TypeName#initialize ([#1363](https://github.com/ruby/rbs/pull/1363))
|
37
|
+
* Fix a type error in FileFinder ([#1326](https://github.com/ruby/rbs/pull/1326))
|
38
|
+
* Add signatures about DetailedMessage ([#1323](https://github.com/ruby/rbs/pull/1323))
|
39
|
+
* Make TypeNameResolver more compatible with Ruby ([#1373](https://github.com/ruby/rbs/pull/1373))
|
40
|
+
* Drop support of Ruby 2.x ([#1364](https://github.com/ruby/rbs/pull/1364))
|
41
|
+
* Print detailed_message on parse command ([#1329](https://github.com/ruby/rbs/pull/1329))
|
42
|
+
* Relax rdoc version requirement ([#1333](https://github.com/ruby/rbs/pull/1333))
|
43
|
+
* Support keyword argument to #detailed_message ([#1328](https://github.com/ruby/rbs/pull/1328))
|
44
|
+
|
45
|
+
#### rbs prototype
|
46
|
+
|
47
|
+
* Avoid to generate anonymous or internal module ([#1421](https://github.com/ruby/rbs/pull/1421))
|
48
|
+
* Fix type name for prototype rbi ([#1386](https://github.com/ruby/rbs/pull/1386))
|
49
|
+
* Support type params for known signatures ([#1408](https://github.com/ruby/rbs/pull/1408))
|
50
|
+
* Super class should be absolute paths. ([#1415](https://github.com/ruby/rbs/pull/1415))
|
51
|
+
* prototype rb: Fix a crash by "include foo" ([#1419](https://github.com/ruby/rbs/pull/1419))
|
52
|
+
* Add `--outline` option to `prototype runtime` to skip generating method definition ([#1404](https://github.com/ruby/rbs/pull/1404))
|
53
|
+
* [rbs prototype] Follow up ivar/cvar feature ([#1361](https://github.com/ruby/rbs/pull/1361))
|
54
|
+
* prototype rb: Extract instance variables and class variables ([#1343](https://github.com/ruby/rbs/pull/1343))
|
55
|
+
|
56
|
+
#### rbs collection
|
57
|
+
|
58
|
+
* Print warning when specified gem not found ([#1367](https://github.com/ruby/rbs/pull/1367))
|
59
|
+
* Generate gem specific sources in lockfile ([#1402](https://github.com/ruby/rbs/pull/1402))
|
60
|
+
* Spec may be missing when `rbs_collection.yaml` declares dependency ([#1378](https://github.com/ruby/rbs/pull/1378))
|
61
|
+
|
62
|
+
### Miscellaneous
|
63
|
+
|
64
|
+
* Remove ruby-lsp && bundle update --bundler ([#1420](https://github.com/ruby/rbs/pull/1420))
|
65
|
+
* Delete all remaining set-related descriptions. ([#1324](https://github.com/ruby/rbs/pull/1324))
|
66
|
+
* Add customized test runner to accept minitest options ([#1392](https://github.com/ruby/rbs/pull/1392))
|
67
|
+
* Specify `rbs` syntax to code snippets in Markdown files ([#1366](https://github.com/ruby/rbs/pull/1366))
|
68
|
+
* Fix typo in parser.rbs ([#1352](https://github.com/ruby/rbs/pull/1352))
|
69
|
+
* Fix broken CI ([#1353](https://github.com/ruby/rbs/pull/1353))
|
70
|
+
* Handle connection error with Resolv_test.rb ([#1356](https://github.com/ruby/rbs/pull/1356))
|
71
|
+
* Removed Prime signature and tests ([#1355](https://github.com/ruby/rbs/pull/1355))
|
72
|
+
|
5
73
|
## 3.1.3 (2023-07-31)
|
6
74
|
|
7
75
|
### Library changes
|
data/Gemfile
CHANGED
@@ -17,17 +17,11 @@ gem "goodcheck"
|
|
17
17
|
gem "dbm"
|
18
18
|
gem 'digest'
|
19
19
|
gem 'tempfile'
|
20
|
-
gem "prime"
|
21
20
|
gem "rdoc", "~> 6.4.0"
|
22
21
|
|
23
22
|
# Test gems
|
24
23
|
gem "rbs-amber", path: "test/assets/test-gem"
|
25
24
|
|
26
|
-
group :ide, optional: true do
|
27
|
-
gem "ruby-debug-ide"
|
28
|
-
gem "debase", ">= 0.2.5.beta2"
|
29
|
-
end
|
30
|
-
|
31
25
|
group :minitest do
|
32
26
|
gem "minitest"
|
33
27
|
end
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
rbs (3.1
|
4
|
+
rbs (3.2.0.pre.1)
|
5
5
|
|
6
6
|
PATH
|
7
7
|
remote: test/assets/test-gem
|
@@ -14,13 +14,10 @@ GEM
|
|
14
14
|
addressable (2.8.4)
|
15
15
|
public_suffix (>= 2.0.2, < 6.0)
|
16
16
|
ast (2.4.2)
|
17
|
+
base64 (0.1.1)
|
17
18
|
dbm (1.1.0)
|
18
|
-
debase (0.2.5.beta2)
|
19
|
-
debase-ruby_core_source (>= 0.10.12)
|
20
|
-
debase-ruby_core_source (3.2.1)
|
21
19
|
diff-lcs (1.5.0)
|
22
20
|
digest (3.1.1)
|
23
|
-
forwardable (1.3.2)
|
24
21
|
goodcheck (3.1.0)
|
25
22
|
marcel (>= 1.0, < 2.0)
|
26
23
|
psych (>= 3.1, < 5.0)
|
@@ -29,28 +26,26 @@ GEM
|
|
29
26
|
json (2.6.3)
|
30
27
|
json-schema (4.0.0)
|
31
28
|
addressable (>= 2.8)
|
29
|
+
language_server-protocol (3.17.0.3)
|
32
30
|
marcel (1.0.2)
|
33
|
-
minitest (5.
|
31
|
+
minitest (5.19.0)
|
34
32
|
parallel (1.23.0)
|
35
33
|
parser (3.2.2.3)
|
36
34
|
ast (~> 2.4.1)
|
37
35
|
racc
|
38
36
|
power_assert (2.0.3)
|
39
|
-
prime (0.1.2)
|
40
|
-
forwardable
|
41
|
-
singleton
|
42
37
|
psych (4.0.6)
|
43
38
|
stringio
|
44
39
|
public_suffix (5.0.1)
|
45
40
|
racc (1.7.1)
|
46
41
|
rainbow (3.1.1)
|
47
42
|
rake (13.0.6)
|
48
|
-
rake-compiler (1.2.
|
43
|
+
rake-compiler (1.2.5)
|
49
44
|
rake
|
50
45
|
rdoc (6.4.0)
|
51
46
|
psych (>= 4.0.0)
|
52
47
|
regexp_parser (2.8.1)
|
53
|
-
rexml (3.2.
|
48
|
+
rexml (3.2.6)
|
54
49
|
rspec (3.12.0)
|
55
50
|
rspec-core (~> 3.12.0)
|
56
51
|
rspec-expectations (~> 3.12.0)
|
@@ -64,29 +59,28 @@ GEM
|
|
64
59
|
diff-lcs (>= 1.2.0, < 2.0)
|
65
60
|
rspec-support (~> 3.12.0)
|
66
61
|
rspec-support (3.12.0)
|
67
|
-
rubocop (1.
|
62
|
+
rubocop (1.56.0)
|
63
|
+
base64 (~> 0.1.1)
|
68
64
|
json (~> 2.3)
|
65
|
+
language_server-protocol (>= 3.17.0)
|
69
66
|
parallel (~> 1.10)
|
70
67
|
parser (>= 3.2.2.3)
|
71
68
|
rainbow (>= 2.2.2, < 4.0)
|
72
69
|
regexp_parser (>= 1.8, < 3.0)
|
73
70
|
rexml (>= 3.2.5, < 4.0)
|
74
|
-
rubocop-ast (>= 1.28.
|
71
|
+
rubocop-ast (>= 1.28.1, < 2.0)
|
75
72
|
ruby-progressbar (~> 1.7)
|
76
73
|
unicode-display_width (>= 2.4.0, < 3.0)
|
77
74
|
rubocop-ast (1.29.0)
|
78
75
|
parser (>= 3.2.1.0)
|
79
76
|
rubocop-rubycw (0.1.6)
|
80
77
|
rubocop (~> 1.0)
|
81
|
-
ruby-debug-ide (0.7.3)
|
82
|
-
rake (>= 0.8.1)
|
83
78
|
ruby-progressbar (1.13.0)
|
84
|
-
singleton (0.1.1)
|
85
79
|
stackprof (0.2.25)
|
86
80
|
stringio (3.0.7)
|
87
81
|
strong_json (2.1.2)
|
88
82
|
tempfile (0.1.3)
|
89
|
-
test-unit (3.
|
83
|
+
test-unit (3.6.1)
|
90
84
|
power_assert
|
91
85
|
unicode-display_width (2.4.2)
|
92
86
|
|
@@ -96,13 +90,11 @@ PLATFORMS
|
|
96
90
|
|
97
91
|
DEPENDENCIES
|
98
92
|
dbm
|
99
|
-
debase (>= 0.2.5.beta2)
|
100
93
|
digest
|
101
94
|
goodcheck
|
102
95
|
json
|
103
96
|
json-schema
|
104
97
|
minitest
|
105
|
-
prime
|
106
98
|
rake
|
107
99
|
rake-compiler
|
108
100
|
rbs!
|
@@ -111,10 +103,9 @@ DEPENDENCIES
|
|
111
103
|
rspec
|
112
104
|
rubocop
|
113
105
|
rubocop-rubycw
|
114
|
-
ruby-debug-ide
|
115
106
|
stackprof
|
116
107
|
tempfile
|
117
108
|
test-unit
|
118
109
|
|
119
110
|
BUNDLED WITH
|
120
|
-
2.4.
|
111
|
+
2.4.18
|
data/README.md
CHANGED
data/Rakefile
CHANGED
@@ -310,3 +310,47 @@ NOTES
|
|
310
310
|
end
|
311
311
|
end
|
312
312
|
end
|
313
|
+
|
314
|
+
|
315
|
+
desc "Generate changelog template from GH pull requests"
|
316
|
+
task :changelog do
|
317
|
+
major, minor, patch, pre = RBS::VERSION.split(".", 4)
|
318
|
+
major = major.to_i
|
319
|
+
minor = minor.to_i
|
320
|
+
patch = patch.to_i
|
321
|
+
|
322
|
+
if patch == 0
|
323
|
+
milestone = "RBS #{major}.#{minor}"
|
324
|
+
else
|
325
|
+
milestone = "RBS #{major}.#{minor}.x"
|
326
|
+
end
|
327
|
+
|
328
|
+
puts "🔍 Finding pull requests that is associated to milestone `#{milestone}`..."
|
329
|
+
|
330
|
+
command = [
|
331
|
+
"gh",
|
332
|
+
"pr",
|
333
|
+
"list",
|
334
|
+
"--limit=10000",
|
335
|
+
"--json",
|
336
|
+
"url,title,number",
|
337
|
+
"--search" ,
|
338
|
+
"milestone:\"#{milestone}\" is:merged sort:updated-desc -label:Released"
|
339
|
+
]
|
340
|
+
|
341
|
+
require "open3"
|
342
|
+
output, status = Open3.capture2(*command)
|
343
|
+
raise status.inspect unless status.success?
|
344
|
+
|
345
|
+
require "json"
|
346
|
+
json = JSON.parse(output, symbolize_names: true)
|
347
|
+
|
348
|
+
unless json.empty?
|
349
|
+
puts
|
350
|
+
json.each do |line|
|
351
|
+
puts "* #{line[:title]} ([##{line[:number]}](#{line[:url]}))"
|
352
|
+
end
|
353
|
+
else
|
354
|
+
puts " (🤑 There is no *unreleased* pull request associated to the milestone.)"
|
355
|
+
end
|
356
|
+
end
|
data/Steepfile
CHANGED
@@ -9,7 +9,7 @@ target :lib do
|
|
9
9
|
"lib/rbs/test.rb"
|
10
10
|
)
|
11
11
|
|
12
|
-
library "
|
12
|
+
library "pathname", "json", "logger", "monitor", "tsort", "uri", 'dbm', 'pstore', 'singleton', 'shellwords', 'fileutils', 'find', 'digest', 'abbrev'
|
13
13
|
signature 'stdlib/yaml/0'
|
14
14
|
signature "stdlib/strscan/0/"
|
15
15
|
signature "stdlib/optparse/0/"
|
@@ -31,7 +31,7 @@ end
|
|
31
31
|
# check "app/models/**/*.rb" # Glob
|
32
32
|
# # ignore "lib/templates/*.rb"
|
33
33
|
#
|
34
|
-
# # library "pathname", "
|
34
|
+
# # library "pathname", "uri" # Standard libraries
|
35
35
|
# # library "strong_json" # Gems
|
36
36
|
# end
|
37
37
|
|
@@ -40,6 +40,6 @@ end
|
|
40
40
|
#
|
41
41
|
# check "spec"
|
42
42
|
#
|
43
|
-
# # library "pathname", "
|
43
|
+
# # library "pathname", "uri" # Standard libraries
|
44
44
|
# # library "rspec"
|
45
45
|
# end
|
data/core/array.rbs
CHANGED
@@ -3920,14 +3920,6 @@ class Array[unchecked out Elem] < Object
|
|
3920
3920
|
def initialize_copy: (self other_ary) -> void
|
3921
3921
|
end
|
3922
3922
|
|
3923
|
-
interface _ToA[T]
|
3924
|
-
def to_a: () -> Array[T]
|
3925
|
-
end
|
3926
|
-
|
3927
|
-
interface _ToAry[T]
|
3928
|
-
def to_ary: () -> ::Array[T]
|
3929
|
-
end
|
3930
|
-
|
3931
3923
|
interface _Rand
|
3932
3924
|
def rand: (::Integer max) -> ::Integer
|
3933
3925
|
end
|
data/core/builtin.rbs
CHANGED
@@ -1,3 +1,15 @@
|
|
1
|
+
interface _ToC
|
2
|
+
def to_c: () -> Complex
|
3
|
+
end
|
4
|
+
|
5
|
+
interface _ToR
|
6
|
+
def to_r: () -> Rational
|
7
|
+
end
|
8
|
+
|
9
|
+
interface _ToF
|
10
|
+
def to_f: () -> Float
|
11
|
+
end
|
12
|
+
|
1
13
|
interface _ToI
|
2
14
|
def to_i: () -> Integer
|
3
15
|
end
|
@@ -6,26 +18,34 @@ interface _ToInt
|
|
6
18
|
def to_int: () -> Integer
|
7
19
|
end
|
8
20
|
|
9
|
-
interface _ToR
|
10
|
-
def to_r: () -> Rational
|
11
|
-
end
|
12
|
-
|
13
21
|
interface _ToS
|
14
22
|
def to_s: () -> String
|
15
23
|
end
|
16
24
|
|
17
|
-
interface _ToF
|
18
|
-
def to_f: () -> Float
|
19
|
-
end
|
20
|
-
|
21
25
|
interface _ToStr
|
22
26
|
def to_str: () -> String
|
23
27
|
end
|
24
28
|
|
29
|
+
interface _ToSym
|
30
|
+
def to_sym: () -> Symbol
|
31
|
+
end
|
32
|
+
|
33
|
+
interface _ToH[K, V]
|
34
|
+
def to_h: () -> Hash[K, V]
|
35
|
+
end
|
36
|
+
|
25
37
|
interface _ToHash[K, V]
|
26
38
|
def to_hash: () -> Hash[K, V]
|
27
39
|
end
|
28
40
|
|
41
|
+
interface _ToA[T]
|
42
|
+
def to_a: () -> Array[T]
|
43
|
+
end
|
44
|
+
|
45
|
+
interface _ToAry[T]
|
46
|
+
def to_ary: () -> Array[T]
|
47
|
+
end
|
48
|
+
|
29
49
|
interface _ToProc
|
30
50
|
def to_proc: () -> Proc
|
31
51
|
end
|
data/core/constants.rbs
CHANGED
@@ -15,9 +15,19 @@
|
|
15
15
|
|
16
16
|
::CROSS_COMPILING: NilClass
|
17
17
|
|
18
|
-
|
19
|
-
|
20
|
-
|
18
|
+
# <!-- rdoc-file=ruby.c -->
|
19
|
+
# DATA is a File that contains the data section of the executed file. To create
|
20
|
+
# a data section use `__END__`:
|
21
|
+
#
|
22
|
+
# $ cat t.rb
|
23
|
+
# puts DATA.gets
|
24
|
+
# __END__
|
25
|
+
# hello world!
|
26
|
+
#
|
27
|
+
# $ ruby t.rb
|
28
|
+
# hello world!
|
29
|
+
#
|
30
|
+
::DATA: File
|
21
31
|
|
22
32
|
# <!-- rdoc-file=version.c -->
|
23
33
|
# The copyright string for ruby
|
@@ -84,5 +94,3 @@
|
|
84
94
|
# The Binding of the top level scope
|
85
95
|
#
|
86
96
|
::TOPLEVEL_BINDING: Binding
|
87
|
-
|
88
|
-
::TRUE: TrueClass
|
data/core/exception.rbs
CHANGED
@@ -230,7 +230,7 @@ class Exception < Object
|
|
230
230
|
# sequences to express essential information; the message should be readable
|
231
231
|
# even if all escape sequences are ignored.
|
232
232
|
#
|
233
|
-
def detailed_message: () -> String
|
233
|
+
def detailed_message: (?highlight: boolish, **untyped) -> String
|
234
234
|
|
235
235
|
# <!--
|
236
236
|
# rdoc-file=error.c
|
data/core/global_variables.rbs
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# The Exception object set by Kernel#raise.
|
2
|
-
$!: Exception
|
2
|
+
$!: Exception?
|
3
3
|
|
4
4
|
# The array contains the module names loaded by require.
|
5
5
|
$": Array[String]
|
@@ -8,22 +8,22 @@ $": Array[String]
|
|
8
8
|
$$: Integer
|
9
9
|
|
10
10
|
# The string matched by the last successful match.
|
11
|
-
$&: String
|
11
|
+
$&: String?
|
12
12
|
|
13
13
|
# The string to the right of the last successful match.
|
14
|
-
$': String
|
14
|
+
$': String?
|
15
15
|
|
16
16
|
# The same as ARGV.
|
17
17
|
$*: Array[String]
|
18
18
|
|
19
19
|
# The highest group matched by the last successful match.
|
20
|
-
$+: String
|
20
|
+
$+: String?
|
21
21
|
|
22
22
|
# The output field separator for Kernel#print and Array#join. Non-nil $, will be deprecated.
|
23
|
-
$,: String
|
23
|
+
$,: String?
|
24
24
|
|
25
25
|
# The input record separator, newline by default.
|
26
|
-
$-0: String
|
26
|
+
$-0: String?
|
27
27
|
|
28
28
|
# The default separator for String#split. Non-nil $; will be deprecated.
|
29
29
|
$-F: Regexp | String | nil
|
@@ -45,7 +45,7 @@ $-a: bool
|
|
45
45
|
# backtrace). Setting this to a true value enables debug output as
|
46
46
|
# if <tt>-d</tt> were given on the command line. Setting this to a false
|
47
47
|
# value disables debug output.
|
48
|
-
$-d:
|
48
|
+
$-d: boolish
|
49
49
|
|
50
50
|
# In in-place-edit mode, this variable holds the extension, otherwise +nil+.
|
51
51
|
$-i: String?
|
@@ -60,49 +60,49 @@ $-p: bool
|
|
60
60
|
# Setting this to a true value enables warnings as if <tt>-w</tt> or <tt>-v</tt> were given
|
61
61
|
# on the command line. Setting this to +nil+ disables warnings,
|
62
62
|
# including from Kernel#warn.
|
63
|
-
$-v: bool
|
63
|
+
$-v: bool?
|
64
64
|
|
65
65
|
# The verbose flag, which is set by the <tt>-w</tt> or <tt>-v</tt> switch.
|
66
66
|
# Setting this to a true value enables warnings as if <tt>-w</tt> or <tt>-v</tt> were given
|
67
67
|
# on the command line. Setting this to +nil+ disables warnings,
|
68
68
|
# including from Kernel#warn.
|
69
|
-
$-w: bool
|
69
|
+
$-w: bool?
|
70
70
|
|
71
71
|
# The current input line number of the last file that was read.
|
72
72
|
$.: Integer
|
73
73
|
|
74
74
|
# The input record separator, newline by default. Aliased to $-0.
|
75
|
-
$/: String
|
75
|
+
$/: String?
|
76
76
|
|
77
77
|
# Contains the name of the script being executed. May be assignable.
|
78
78
|
$0: String
|
79
79
|
|
80
80
|
# The Nth group of the last successful match. May be > 1.
|
81
|
-
$1: String
|
81
|
+
$1: String?
|
82
82
|
|
83
83
|
# The Nth group of the last successful match. May be > 1.
|
84
|
-
$2: String
|
84
|
+
$2: String?
|
85
85
|
|
86
86
|
# The Nth group of the last successful match. May be > 1.
|
87
|
-
$3: String
|
87
|
+
$3: String?
|
88
88
|
|
89
89
|
# The Nth group of the last successful match. May be > 1.
|
90
|
-
$4: String
|
90
|
+
$4: String?
|
91
91
|
|
92
92
|
# The Nth group of the last successful match. May be > 1.
|
93
|
-
$5: String
|
93
|
+
$5: String?
|
94
94
|
|
95
95
|
# The Nth group of the last successful match. May be > 1.
|
96
|
-
$6: String
|
96
|
+
$6: String?
|
97
97
|
|
98
98
|
# The Nth group of the last successful match. May be > 1.
|
99
|
-
$7: String
|
99
|
+
$7: String?
|
100
100
|
|
101
101
|
# The Nth group of the last successful match. May be > 1.
|
102
|
-
$8: String
|
102
|
+
$8: String?
|
103
103
|
|
104
104
|
# The Nth group of the last successful match. May be > 1.
|
105
|
-
$9: String
|
105
|
+
$9: String?
|
106
106
|
|
107
107
|
# Load path for searching Ruby scripts and extension libraries used
|
108
108
|
# by Kernel#load and Kernel#require.
|
@@ -124,17 +124,17 @@ $=: bool
|
|
124
124
|
$>: IO
|
125
125
|
|
126
126
|
# The status of the last executed child process (thread-local).
|
127
|
-
$?: Process::Status
|
127
|
+
$?: Process::Status?
|
128
128
|
|
129
129
|
# The same as <code>$!.backtrace</code>.
|
130
|
-
$@: Array[String]
|
130
|
+
$@: Array[String]?
|
131
131
|
|
132
132
|
# The debug flag, which is set by the <tt>-d</tt> switch. Enabling debug
|
133
133
|
# output prints each exception raised to $stderr (but not its
|
134
134
|
# backtrace). Setting this to a true value enables debug output as
|
135
135
|
# if <tt>-d</tt> were given on the command line. Setting this to a false
|
136
136
|
# value disables debug output. Aliased to $-d.
|
137
|
-
$DEBUG:
|
137
|
+
$DEBUG: boolish
|
138
138
|
|
139
139
|
# Current input filename from ARGF. Same as ARGF.filename.
|
140
140
|
$FILENAME: String
|
@@ -160,16 +160,16 @@ $PROGRAM_NAME: String
|
|
160
160
|
# Setting this to a true value enables warnings as if <tt>-w</tt> or <tt>-v</tt> were given
|
161
161
|
# on the command line. Setting this to +nil+ disables warnings,
|
162
162
|
# including from Kernel#warn. Aliased to $-v and $-w.
|
163
|
-
$VERBOSE: bool
|
163
|
+
$VERBOSE: bool?
|
164
164
|
|
165
165
|
# The output record separator for Kernel#print and IO#write. Default is +nil+.
|
166
|
-
$\: String
|
166
|
+
$\: String?
|
167
167
|
|
168
168
|
# The last input line of string by gets or readline.
|
169
|
-
$_: String
|
169
|
+
$_: String?
|
170
170
|
|
171
171
|
# The string to the left of the last successful match.
|
172
|
-
$`: String
|
172
|
+
$`: String?
|
173
173
|
|
174
174
|
# The current standard error output.
|
175
175
|
$stderr: IO
|
@@ -181,4 +181,4 @@ $stdin: IO
|
|
181
181
|
$stdout: IO
|
182
182
|
|
183
183
|
# The information about the last match in the current scope (thread-local and frame-local).
|
184
|
-
$~: MatchData
|
184
|
+
$~: MatchData?
|