rbs 4.0.0.dev.5 → 4.0.1.dev.1
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/.clang-format +1 -0
- data/.github/workflows/c-check.yml +8 -4
- data/.github/workflows/comments.yml +3 -1
- data/.github/workflows/dependabot.yml +1 -1
- data/.github/workflows/ruby.yml +10 -0
- data/.github/workflows/rust.yml +95 -0
- data/CHANGELOG.md +323 -0
- data/Rakefile +12 -29
- data/Steepfile +1 -0
- data/config.yml +393 -37
- data/core/array.rbs +218 -188
- data/core/basic_object.rbs +9 -8
- data/core/class.rbs +6 -5
- data/core/comparable.rbs +45 -31
- data/core/complex.rbs +52 -40
- data/core/dir.rbs +57 -45
- data/core/encoding.rbs +5 -5
- data/core/enumerable.rbs +96 -91
- data/core/enumerator.rbs +4 -3
- data/core/errno.rbs +3 -2
- data/core/errors.rbs +31 -29
- data/core/exception.rbs +12 -12
- data/core/fiber.rbs +36 -36
- data/core/file.rbs +186 -113
- data/core/file_test.rbs +2 -2
- data/core/float.rbs +41 -32
- data/core/gc.rbs +78 -70
- data/core/hash.rbs +70 -60
- data/core/integer.rbs +32 -28
- data/core/io/buffer.rbs +36 -36
- data/core/io/wait.rbs +7 -7
- data/core/io.rbs +120 -135
- data/core/kernel.rbs +189 -139
- data/core/marshal.rbs +3 -3
- data/core/match_data.rbs +14 -12
- data/core/math.rbs +69 -67
- data/core/method.rbs +6 -6
- data/core/module.rbs +146 -85
- data/core/nil_class.rbs +4 -3
- data/core/numeric.rbs +35 -32
- data/core/object.rbs +6 -8
- data/core/object_space.rbs +11 -10
- data/core/pathname.rbs +131 -81
- data/core/proc.rbs +65 -33
- data/core/process.rbs +219 -201
- data/core/ractor.rbs +15 -11
- data/core/random.rbs +4 -3
- data/core/range.rbs +52 -47
- data/core/rational.rbs +5 -5
- data/core/rbs/unnamed/argf.rbs +58 -51
- data/core/rbs/unnamed/env_class.rbs +18 -13
- data/core/rbs/unnamed/main_class.rbs +123 -0
- data/core/rbs/unnamed/random.rbs +7 -5
- data/core/regexp.rbs +236 -197
- data/core/ruby.rbs +1 -1
- data/core/ruby_vm.rbs +32 -30
- data/core/rubygems/config_file.rbs +5 -5
- data/core/rubygems/errors.rbs +1 -1
- data/core/rubygems/requirement.rbs +5 -5
- data/core/rubygems/rubygems.rbs +5 -3
- data/core/set.rbs +17 -16
- data/core/signal.rbs +2 -2
- data/core/string.rbs +311 -292
- data/core/struct.rbs +26 -25
- data/core/symbol.rbs +25 -24
- data/core/thread.rbs +40 -34
- data/core/time.rbs +47 -42
- data/core/trace_point.rbs +34 -31
- data/core/true_class.rbs +2 -2
- data/core/unbound_method.rbs +10 -10
- data/core/warning.rbs +7 -7
- data/docs/collection.md +1 -1
- data/docs/config.md +171 -0
- data/docs/inline.md +110 -4
- data/docs/syntax.md +13 -12
- data/ext/rbs_extension/ast_translation.c +489 -135
- data/ext/rbs_extension/class_constants.c +8 -0
- data/ext/rbs_extension/class_constants.h +4 -0
- data/ext/rbs_extension/legacy_location.c +28 -51
- data/ext/rbs_extension/legacy_location.h +37 -0
- data/ext/rbs_extension/main.c +12 -20
- data/include/rbs/ast.h +423 -195
- data/include/rbs/lexer.h +2 -2
- data/include/rbs/location.h +25 -44
- data/include/rbs/parser.h +2 -2
- data/include/rbs/util/rbs_constant_pool.h +0 -3
- data/include/rbs.h +8 -0
- data/lib/rbs/ast/ruby/annotations.rb +157 -4
- data/lib/rbs/ast/ruby/members.rb +374 -22
- data/lib/rbs/cli/validate.rb +5 -60
- data/lib/rbs/collection/config/lockfile_generator.rb +6 -2
- data/lib/rbs/definition_builder.rb +60 -27
- data/lib/rbs/errors.rb +0 -11
- data/lib/rbs/inline_parser.rb +1 -1
- data/lib/rbs/parser_aux.rb +20 -7
- data/lib/rbs/prototype/helpers.rb +57 -0
- data/lib/rbs/prototype/rb.rb +1 -26
- data/lib/rbs/prototype/rbi.rb +1 -20
- data/lib/rbs/test/type_check.rb +3 -0
- data/lib/rbs/types.rb +62 -52
- data/lib/rbs/unit_test/type_assertions.rb +35 -8
- data/lib/rbs/version.rb +1 -1
- data/lib/rbs.rb +0 -1
- data/rbs.gemspec +1 -1
- 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/sig/ast/ruby/annotations.rbs +191 -4
- data/sig/ast/ruby/members.rbs +21 -1
- data/sig/cli/validate.rbs +1 -6
- data/sig/definition_builder.rbs +2 -0
- data/sig/errors.rbs +0 -8
- data/sig/method_types.rbs +1 -1
- data/sig/parser.rbs +17 -13
- data/sig/prototype/helpers.rbs +2 -0
- data/sig/types.rbs +10 -11
- data/sig/unit_test/spy.rbs +0 -8
- data/sig/unit_test/type_assertions.rbs +11 -0
- data/src/ast.c +339 -161
- data/src/lexstate.c +1 -1
- data/src/location.c +7 -47
- data/src/parser.c +674 -480
- data/src/util/rbs_constant_pool.c +0 -4
- data/stdlib/bigdecimal/0/big_decimal.rbs +16 -16
- data/stdlib/cgi-escape/0/escape.rbs +4 -4
- data/stdlib/coverage/0/coverage.rbs +4 -3
- data/stdlib/date/0/date.rbs +33 -28
- data/stdlib/date/0/date_time.rbs +24 -23
- data/stdlib/did_you_mean/0/did_you_mean.rbs +17 -16
- data/stdlib/erb/0/erb.rbs +64 -53
- data/stdlib/etc/0/etc.rbs +55 -50
- data/stdlib/fileutils/0/fileutils.rbs +138 -125
- data/stdlib/forwardable/0/forwardable.rbs +10 -10
- data/stdlib/io-console/0/io-console.rbs +2 -2
- data/stdlib/json/0/json.rbs +135 -108
- data/stdlib/monitor/0/monitor.rbs +3 -3
- data/stdlib/net-http/0/net-http.rbs +159 -134
- data/stdlib/objspace/0/objspace.rbs +8 -7
- data/stdlib/open-uri/0/open-uri.rbs +8 -8
- data/stdlib/open3/0/open3.rbs +36 -35
- data/stdlib/openssl/0/openssl.rbs +144 -129
- data/stdlib/optparse/0/optparse.rbs +18 -14
- data/stdlib/pathname/0/pathname.rbs +2 -2
- 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 +61 -8
- data/stdlib/psych/0/store.rbs +2 -4
- data/stdlib/pty/0/pty.rbs +9 -6
- data/stdlib/random-formatter/0/random-formatter.rbs +2 -2
- data/stdlib/ripper/0/ripper.rbs +20 -17
- data/stdlib/securerandom/0/securerandom.rbs +1 -1
- data/stdlib/shellwords/0/shellwords.rbs +2 -2
- 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 +10 -9
- data/stdlib/socket/0/tcp_server.rbs +1 -1
- data/stdlib/socket/0/tcp_socket.rbs +1 -1
- data/stdlib/socket/0/udp_socket.rbs +1 -1
- data/stdlib/socket/0/unix_server.rbs +1 -1
- data/stdlib/stringio/0/stringio.rbs +55 -54
- data/stdlib/strscan/0/string_scanner.rbs +46 -44
- data/stdlib/tempfile/0/tempfile.rbs +24 -20
- data/stdlib/time/0/time.rbs +7 -5
- data/stdlib/tsort/0/tsort.rbs +7 -6
- data/stdlib/uri/0/common.rbs +26 -18
- data/stdlib/uri/0/file.rbs +2 -2
- data/stdlib/uri/0/generic.rbs +2 -2
- 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 +6 -5
- data/stdlib/zlib/0/deflate.rbs +4 -3
- data/stdlib/zlib/0/gzip_reader.rbs +4 -4
- 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
- metadata +23 -5
- data/.github/workflows/valgrind.yml +0 -42
|
@@ -35,8 +35,8 @@ module Zlib
|
|
|
35
35
|
# Be careful of the footer of the gzip file. A gzip file has the checksum of
|
|
36
36
|
# pre-compressed data in its footer. GzipReader checks all uncompressed data
|
|
37
37
|
# against that checksum at the following cases, and if it fails, raises
|
|
38
|
-
#
|
|
39
|
-
#
|
|
38
|
+
# <code>Zlib::GzipFile::NoFooter</code>, <code>Zlib::GzipFile::CRCError</code>,
|
|
39
|
+
# or <code>Zlib::GzipFile::LengthError</code> exception.
|
|
40
40
|
#
|
|
41
41
|
# * When an reading request is received beyond the end of file (the end of
|
|
42
42
|
# compressed data). That is, when Zlib::GzipReader#read,
|
|
@@ -282,8 +282,8 @@ module Zlib
|
|
|
282
282
|
# `read` method that behaves same as the IO#read.
|
|
283
283
|
#
|
|
284
284
|
# The `options` hash may be used to set the encoding of the data.
|
|
285
|
-
#
|
|
286
|
-
# IO::new.
|
|
285
|
+
# <code>:external_encoding</code>, <code>:internal_encoding</code> and
|
|
286
|
+
# <code>:encoding</code> may be set as in IO::new.
|
|
287
287
|
#
|
|
288
288
|
# If the gzip file header is incorrect, raises an Zlib::GzipFile::Error
|
|
289
289
|
# exception.
|
|
@@ -38,7 +38,8 @@ module Zlib
|
|
|
38
38
|
# returns a GzipWriter object associated with that file. Further details of
|
|
39
39
|
# this method are found in Zlib::GzipWriter.new and Zlib::GzipFile.wrap.
|
|
40
40
|
#
|
|
41
|
-
def self.open: (String filename
|
|
41
|
+
def self.open: (String filename, ?Integer level, ?Integer strategy, **untyped opts) -> instance
|
|
42
|
+
| (String filename, ?Integer level, ?Integer strategy, **untyped opts) { (instance gz) -> void } -> nil
|
|
42
43
|
|
|
43
44
|
# <!--
|
|
44
45
|
# rdoc-file=ext/zlib/zlib.c
|
|
@@ -61,10 +62,11 @@ module Zlib
|
|
|
61
62
|
# - flush(flush=nil)
|
|
62
63
|
# -->
|
|
63
64
|
# Flushes all the internal buffers of the GzipWriter object. The meaning of
|
|
64
|
-
# `flush` is same as in Zlib::Deflate#deflate.
|
|
65
|
-
# `flush` is omitted. It is no use giving flush
|
|
65
|
+
# `flush` is same as in Zlib::Deflate#deflate. <code>Zlib::SYNC_FLUSH</code> is
|
|
66
|
+
# used if `flush` is omitted. It is no use giving flush
|
|
67
|
+
# <code>Zlib::NO_FLUSH</code>.
|
|
66
68
|
#
|
|
67
|
-
def flush: (?Integer flush) ->
|
|
69
|
+
def flush: (?Integer flush) -> self
|
|
68
70
|
|
|
69
71
|
# <!--
|
|
70
72
|
# rdoc-file=ext/zlib/zlib.c
|
|
@@ -74,16 +76,16 @@ module Zlib
|
|
|
74
76
|
#
|
|
75
77
|
# Setting the mtime in the gzip header does not effect the mtime of the file
|
|
76
78
|
# generated. Different utilities that expand the gzipped files may use the mtime
|
|
77
|
-
# header. For example the gunzip utility can use the
|
|
78
|
-
# the resultant file's mtime to the value in the header. By default
|
|
79
|
-
# will set the mtime of the expanded file to the mtime of the gzipped
|
|
80
|
-
# the mtime in the header.
|
|
79
|
+
# header. For example the gunzip utility can use the <code>-N</code> flag which
|
|
80
|
+
# will set the resultant file's mtime to the value in the header. By default
|
|
81
|
+
# many tools will set the mtime of the expanded file to the mtime of the gzipped
|
|
82
|
+
# file, not the mtime in the header.
|
|
81
83
|
#
|
|
82
84
|
# If you do not set an mtime, the default value will be the time when
|
|
83
85
|
# compression started. Setting a value of 0 indicates no time stamp is
|
|
84
86
|
# available.
|
|
85
87
|
#
|
|
86
|
-
def mtime=: (
|
|
88
|
+
def mtime=: (Time | Integer) -> void
|
|
87
89
|
|
|
88
90
|
# <!--
|
|
89
91
|
# rdoc-file=ext/zlib/zlib.c
|
|
@@ -158,9 +160,9 @@ module Zlib
|
|
|
158
160
|
# that behaves the same as IO#write.
|
|
159
161
|
#
|
|
160
162
|
# The `options` hash may be used to set the encoding of the data.
|
|
161
|
-
#
|
|
162
|
-
# IO::new.
|
|
163
|
+
# <code>:external_encoding</code>, <code>:internal_encoding</code> and
|
|
164
|
+
# <code>:encoding</code> may be set as in IO::new.
|
|
163
165
|
#
|
|
164
|
-
def initialize: (_Writer io, Integer level, Integer strategy, **untyped opts) -> void
|
|
166
|
+
def initialize: (_Writer io, ?Integer? level, ?Integer? strategy, **untyped opts) -> void
|
|
165
167
|
end
|
|
166
168
|
end
|
data/stdlib/zlib/0/inflate.rbs
CHANGED
data/stdlib/zlib/0/need_dict.rbs
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rbs
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 4.0.
|
|
4
|
+
version: 4.0.1.dev.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Soutaro Matsumoto
|
|
@@ -29,14 +29,14 @@ dependencies:
|
|
|
29
29
|
requirements:
|
|
30
30
|
- - ">="
|
|
31
31
|
- !ruby/object:Gem::Version
|
|
32
|
-
version: 1.
|
|
32
|
+
version: 1.6.0
|
|
33
33
|
type: :runtime
|
|
34
34
|
prerelease: false
|
|
35
35
|
version_requirements: !ruby/object:Gem::Requirement
|
|
36
36
|
requirements:
|
|
37
37
|
- - ">="
|
|
38
38
|
- !ruby/object:Gem::Version
|
|
39
|
-
version: 1.
|
|
39
|
+
version: 1.6.0
|
|
40
40
|
- !ruby/object:Gem::Dependency
|
|
41
41
|
name: tsort
|
|
42
42
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -69,8 +69,8 @@ files:
|
|
|
69
69
|
- ".github/workflows/comments.yml"
|
|
70
70
|
- ".github/workflows/dependabot.yml"
|
|
71
71
|
- ".github/workflows/ruby.yml"
|
|
72
|
+
- ".github/workflows/rust.yml"
|
|
72
73
|
- ".github/workflows/typecheck.yml"
|
|
73
|
-
- ".github/workflows/valgrind.yml"
|
|
74
74
|
- ".github/workflows/windows.yml"
|
|
75
75
|
- ".gitignore"
|
|
76
76
|
- ".rubocop.yml"
|
|
@@ -136,6 +136,7 @@ files:
|
|
|
136
136
|
- core/rb_config.rbs
|
|
137
137
|
- core/rbs/unnamed/argf.rbs
|
|
138
138
|
- core/rbs/unnamed/env_class.rbs
|
|
139
|
+
- core/rbs/unnamed/main_class.rbs
|
|
139
140
|
- core/rbs/unnamed/random.rbs
|
|
140
141
|
- core/refinement.rbs
|
|
141
142
|
- core/regexp.rbs
|
|
@@ -172,6 +173,7 @@ files:
|
|
|
172
173
|
- docs/aliases.md
|
|
173
174
|
- docs/architecture.md
|
|
174
175
|
- docs/collection.md
|
|
176
|
+
- docs/config.md
|
|
175
177
|
- docs/data_and_struct.md
|
|
176
178
|
- docs/encoding.md
|
|
177
179
|
- docs/gem.md
|
|
@@ -313,6 +315,22 @@ files:
|
|
|
313
315
|
- lib/rdoc/discover.rb
|
|
314
316
|
- lib/rdoc_plugin/parser.rb
|
|
315
317
|
- rbs.gemspec
|
|
318
|
+
- rust/.gitignore
|
|
319
|
+
- rust/Cargo.lock
|
|
320
|
+
- rust/Cargo.toml
|
|
321
|
+
- rust/ruby-rbs-sys/Cargo.toml
|
|
322
|
+
- rust/ruby-rbs-sys/build.rs
|
|
323
|
+
- rust/ruby-rbs-sys/src/lib.rs
|
|
324
|
+
- rust/ruby-rbs-sys/vendor/rbs/include
|
|
325
|
+
- rust/ruby-rbs-sys/vendor/rbs/src
|
|
326
|
+
- rust/ruby-rbs-sys/wrapper.h
|
|
327
|
+
- rust/ruby-rbs/Cargo.toml
|
|
328
|
+
- rust/ruby-rbs/build.rs
|
|
329
|
+
- rust/ruby-rbs/examples/locations.rs
|
|
330
|
+
- rust/ruby-rbs/src/lib.rs
|
|
331
|
+
- rust/ruby-rbs/src/node/mod.rs
|
|
332
|
+
- rust/ruby-rbs/tests/sanity.rs
|
|
333
|
+
- rust/ruby-rbs/vendor/rbs/config.yml
|
|
316
334
|
- schema/annotation.json
|
|
317
335
|
- schema/comment.json
|
|
318
336
|
- schema/decls.json
|
|
@@ -622,7 +640,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
622
640
|
- !ruby/object:Gem::Version
|
|
623
641
|
version: '0'
|
|
624
642
|
requirements: []
|
|
625
|
-
rubygems_version:
|
|
643
|
+
rubygems_version: 4.0.3
|
|
626
644
|
specification_version: 4
|
|
627
645
|
summary: Type signature for Ruby.
|
|
628
646
|
test_files: []
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
name: Valgrind
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches:
|
|
6
|
-
- master
|
|
7
|
-
paths:
|
|
8
|
-
- "ext/**"
|
|
9
|
-
- "include/**"
|
|
10
|
-
- "src/**"
|
|
11
|
-
pull_request:
|
|
12
|
-
paths:
|
|
13
|
-
- "ext/**"
|
|
14
|
-
- "include/**"
|
|
15
|
-
- "src/**"
|
|
16
|
-
merge_group: {}
|
|
17
|
-
|
|
18
|
-
jobs:
|
|
19
|
-
valgrind:
|
|
20
|
-
runs-on: ubuntu-latest
|
|
21
|
-
steps:
|
|
22
|
-
- uses: actions/checkout@v6
|
|
23
|
-
- uses: ruby/setup-ruby@v1
|
|
24
|
-
with:
|
|
25
|
-
ruby-version: "3.4"
|
|
26
|
-
bundler-cache: none
|
|
27
|
-
- name: Set working directory as safe
|
|
28
|
-
run: git config --global --add safe.directory $(pwd)
|
|
29
|
-
- name: Install dependencies
|
|
30
|
-
run: |
|
|
31
|
-
sudo apt-get update
|
|
32
|
-
sudo apt-get install -y libdb-dev curl autoconf automake m4 libtool python3 valgrind
|
|
33
|
-
- name: Update rubygems & bundler
|
|
34
|
-
run: |
|
|
35
|
-
ruby -v
|
|
36
|
-
gem update --system
|
|
37
|
-
- name: bin/setup
|
|
38
|
-
run: |
|
|
39
|
-
bin/setup
|
|
40
|
-
- run: bundle exec rake test:valgrind
|
|
41
|
-
env:
|
|
42
|
-
RUBY_FREE_AT_EXIT: 1
|