rbs 3.9.4 → 4.1.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 +75 -0
- data/.clangd +2 -0
- data/.dockerignore +37 -0
- data/.github/dependabot.yml +16 -14
- data/.github/workflows/bundle-update.yml +63 -0
- data/.github/workflows/c-check.yml +66 -0
- data/.github/workflows/comments.yml +5 -3
- data/.github/workflows/dependabot.yml +2 -2
- data/.github/workflows/jruby.yml +79 -0
- data/.github/workflows/release-gems.yml +164 -0
- data/.github/workflows/ruby.yml +84 -30
- data/.github/workflows/rust.yml +186 -0
- data/.github/workflows/truffleruby.yml +54 -0
- data/.github/workflows/typecheck.yml +5 -2
- data/.github/workflows/wasm.yml +55 -0
- data/.github/workflows/windows.yml +9 -3
- data/.gitignore +16 -0
- data/.rubocop.yml +2 -2
- data/CHANGELOG.md +430 -0
- data/Dockerfile.jruby +53 -0
- data/README.md +41 -4
- data/Rakefile +777 -60
- data/Steepfile +11 -0
- data/config.yml +660 -62
- data/core/array.rbs +541 -398
- data/core/basic_object.rbs +9 -8
- data/core/binding.rbs +0 -2
- data/core/builtin.rbs +9 -8
- data/core/class.rbs +11 -8
- 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 +297 -196
- data/core/enumerator/arithmetic_sequence.rbs +70 -0
- data/core/enumerator/product.rbs +5 -5
- data/core/enumerator.rbs +91 -28
- 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 +260 -1151
- data/core/file_constants.rbs +463 -0
- data/core/file_stat.rbs +534 -0
- data/core/file_test.rbs +3 -3
- data/core/float.rbs +257 -116
- data/core/gc.rbs +425 -281
- data/core/hash.rbs +1151 -829
- data/core/integer.rbs +156 -195
- data/core/io/buffer.rbs +53 -42
- data/core/io/wait.rbs +13 -35
- data/core/io.rbs +220 -154
- data/core/kernel.rbs +239 -163
- data/core/marshal.rbs +4 -4
- data/core/match_data.rbs +16 -14
- data/core/math.rbs +107 -66
- data/core/method.rbs +69 -33
- data/core/module.rbs +302 -150
- data/core/nil_class.rbs +7 -6
- data/core/numeric.rbs +77 -63
- data/core/object.rbs +9 -11
- data/core/object_space/weak_key_map.rbs +7 -7
- data/core/object_space.rbs +30 -23
- data/core/pathname.rbs +1312 -0
- data/core/proc.rbs +95 -58
- data/core/process.rbs +222 -202
- data/core/ractor.rbs +364 -518
- data/core/random.rbs +21 -3
- data/core/range.rbs +181 -79
- data/core/rational.rbs +60 -89
- data/core/rbs/ops.rbs +154 -0
- data/core/rbs/unnamed/argf.rbs +63 -56
- 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 +78 -34
- data/core/rubygems/config_file.rbs +5 -5
- data/core/rubygems/errors.rbs +6 -70
- data/core/rubygems/requirement.rbs +5 -15
- data/core/rubygems/rubygems.rbs +18 -81
- data/core/rubygems/specification.rbs +8 -0
- data/core/rubygems/version.rbs +2 -163
- data/core/set.rbs +493 -363
- data/core/signal.rbs +26 -16
- data/core/string.rbs +3234 -1285
- data/core/struct.rbs +43 -42
- data/core/symbol.rbs +41 -34
- data/core/thread.rbs +139 -83
- 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/CONTRIBUTING.md +2 -1
- 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 +634 -0
- data/docs/rbs_by_example.md +20 -20
- data/docs/release.md +151 -0
- data/docs/rust.md +96 -0
- data/docs/sigs.md +3 -3
- data/docs/syntax.md +48 -18
- data/docs/type_fingerprint.md +21 -0
- data/docs/wasm_serialization.md +80 -0
- data/exe/rbs +1 -1
- data/ext/rbs_extension/ast_translation.c +1855 -0
- data/ext/rbs_extension/ast_translation.h +41 -0
- data/ext/rbs_extension/class_constants.c +187 -0
- data/{include/rbs/constants.h → ext/rbs_extension/class_constants.h} +23 -1
- data/ext/rbs_extension/compat.h +10 -0
- data/ext/rbs_extension/extconf.rb +26 -1
- data/ext/rbs_extension/legacy_location.c +299 -0
- data/ext/rbs_extension/legacy_location.h +82 -0
- data/ext/rbs_extension/main.c +603 -23
- data/ext/rbs_extension/rbs_extension.h +6 -21
- data/ext/rbs_extension/rbs_string_bridging.c +9 -0
- data/ext/rbs_extension/rbs_string_bridging.h +24 -0
- data/include/rbs/ast.h +1047 -0
- data/include/rbs/defines.h +99 -0
- data/include/rbs/lexer.h +207 -0
- data/include/rbs/location.h +40 -0
- data/include/rbs/parser.h +153 -0
- data/include/rbs/serialize.h +39 -0
- data/include/rbs/string.h +47 -0
- data/include/rbs/util/rbs_allocator.h +59 -0
- data/include/rbs/util/rbs_assert.h +20 -0
- data/include/rbs/util/rbs_buffer.h +83 -0
- data/include/rbs/util/rbs_constant_pool.h +6 -70
- data/include/rbs/util/rbs_encoding.h +282 -0
- data/include/rbs/util/rbs_unescape.h +24 -0
- data/include/rbs.h +9 -2
- data/lib/rbs/annotate/formatter.rb +3 -13
- data/lib/rbs/annotate/rdoc_annotator.rb +30 -32
- data/lib/rbs/annotate/rdoc_source.rb +1 -1
- 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 +451 -0
- data/lib/rbs/ast/ruby/comment_block.rb +247 -0
- data/lib/rbs/ast/ruby/declarations.rb +291 -0
- data/lib/rbs/ast/ruby/helpers/constant_helper.rb +28 -0
- data/lib/rbs/ast/ruby/helpers/location_helper.rb +15 -0
- data/lib/rbs/ast/ruby/members.rb +762 -0
- data/lib/rbs/ast/type_param.rb +24 -4
- data/lib/rbs/buffer.rb +142 -20
- data/lib/rbs/cli/diff.rb +16 -15
- data/lib/rbs/cli/validate.rb +63 -126
- data/lib/rbs/cli.rb +59 -29
- data/lib/rbs/collection/config/lockfile_generator.rb +28 -3
- data/lib/rbs/collection/sources/git.rb +7 -0
- data/lib/rbs/definition.rb +6 -1
- data/lib/rbs/definition_builder/ancestor_builder.rb +121 -65
- data/lib/rbs/definition_builder/method_builder.rb +74 -33
- data/lib/rbs/definition_builder.rb +177 -20
- data/lib/rbs/diff.rb +7 -1
- data/lib/rbs/environment/class_entry.rb +69 -0
- data/lib/rbs/environment/module_entry.rb +66 -0
- data/lib/rbs/environment.rb +410 -215
- data/lib/rbs/environment_loader.rb +2 -8
- data/lib/rbs/errors.rb +31 -21
- data/lib/rbs/inline_parser/comment_association.rb +117 -0
- data/lib/rbs/inline_parser.rb +568 -0
- data/lib/rbs/location_aux.rb +36 -4
- data/lib/rbs/locator.rb +5 -1
- data/lib/rbs/method_type.rb +5 -3
- data/lib/rbs/namespace.rb +47 -18
- data/lib/rbs/parser_aux.rb +37 -7
- data/lib/rbs/prototype/helpers.rb +57 -0
- data/lib/rbs/prototype/rb.rb +3 -28
- data/lib/rbs/prototype/rbi.rb +196 -45
- data/lib/rbs/prototype/runtime.rb +12 -2
- data/lib/rbs/resolver/constant_resolver.rb +2 -2
- data/lib/rbs/resolver/type_name_resolver.rb +120 -44
- data/lib/rbs/rewriter.rb +70 -0
- data/lib/rbs/source.rb +99 -0
- data/lib/rbs/subtractor.rb +7 -4
- data/lib/rbs/test/type_check.rb +25 -3
- data/lib/rbs/type_name.rb +34 -21
- data/lib/rbs/types.rb +91 -79
- data/lib/rbs/unit_test/convertibles.rb +1 -0
- data/lib/rbs/unit_test/type_assertions.rb +44 -8
- data/lib/rbs/validator.rb +2 -2
- data/lib/rbs/version.rb +1 -1
- data/lib/rbs/wasm/deserializer.rb +213 -0
- data/lib/rbs/wasm/location.rb +61 -0
- data/lib/rbs/wasm/parser.rb +137 -0
- data/lib/rbs/wasm/runtime.rb +196 -0
- data/lib/rbs/wasm/serialization_schema.rb +110 -0
- data/lib/rbs.rb +25 -2
- data/lib/rbs_jars.rb +39 -0
- data/lib/rdoc/discover.rb +1 -1
- data/lib/rdoc_plugin/parser.rb +8 -3
- data/rbs.gemspec +37 -5
- data/schema/typeParam.json +17 -1
- data/sig/ancestor_builder.rbs +1 -1
- data/sig/annotate/formatter.rbs +2 -2
- data/sig/annotate/rdoc_annotater.rbs +13 -10
- data/sig/ast/ruby/annotations.rbs +470 -0
- data/sig/ast/ruby/comment_block.rbs +127 -0
- data/sig/ast/ruby/declarations.rbs +158 -0
- data/sig/ast/ruby/helpers/constant_helper.rbs +11 -0
- data/sig/ast/ruby/helpers/location_helper.rbs +15 -0
- data/sig/ast/ruby/members.rbs +198 -0
- data/sig/buffer.rbs +81 -5
- data/sig/cli/diff.rbs +5 -11
- data/sig/cli/validate.rbs +12 -8
- data/sig/cli.rbs +18 -18
- data/sig/collection/config/lockfile_generator.rbs +2 -0
- data/sig/definition.rbs +6 -0
- data/sig/definition_builder.rbs +3 -1
- data/sig/environment/class_entry.rbs +50 -0
- data/sig/environment/module_entry.rbs +50 -0
- data/sig/environment.rbs +94 -87
- data/sig/errors.rbs +26 -20
- data/sig/inline_parser/comment_association.rbs +71 -0
- data/sig/inline_parser.rbs +126 -0
- data/sig/location.rbs +32 -7
- data/sig/locator.rbs +0 -2
- data/sig/manifest.yaml +0 -2
- data/sig/method_builder.rbs +9 -4
- data/sig/namespace.rbs +20 -5
- data/sig/parser.rbs +77 -13
- data/sig/prototype/helpers.rbs +2 -0
- data/sig/prototype/rbi.rbs +33 -4
- data/sig/resolver/type_name_resolver.rbs +36 -10
- data/sig/rewriter.rbs +45 -0
- data/sig/source.rbs +48 -0
- data/sig/type_param.rbs +13 -8
- data/sig/typename.rbs +15 -5
- data/sig/types.rbs +10 -8
- data/sig/unit_test/spy.rbs +0 -8
- data/sig/unit_test/type_assertions.rbs +15 -0
- data/sig/wasm/deserializer.rbs +66 -0
- data/sig/wasm/serialization_schema.rbs +13 -0
- data/src/ast.c +1628 -0
- data/src/lexer.c +3221 -0
- data/src/lexer.re +155 -0
- data/src/lexstate.c +221 -0
- data/src/location.c +31 -0
- data/src/parser.c +4258 -0
- data/src/serialize.c +958 -0
- data/src/string.c +41 -0
- data/src/util/rbs_allocator.c +171 -0
- data/src/util/rbs_assert.c +19 -0
- data/src/util/rbs_buffer.c +54 -0
- data/src/util/rbs_constant_pool.c +18 -92
- data/src/util/rbs_encoding.c +21308 -0
- data/src/util/rbs_unescape.c +167 -0
- data/stdlib/abbrev/0/array.rbs +1 -1
- 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/csv/0/csv.rbs +5 -5
- data/stdlib/date/0/date.rbs +92 -79
- data/stdlib/date/0/date_time.rbs +25 -24
- data/stdlib/delegate/0/delegator.rbs +11 -7
- data/stdlib/did_you_mean/0/did_you_mean.rbs +17 -16
- data/stdlib/digest/0/digest.rbs +117 -1
- data/stdlib/erb/0/erb.rbs +748 -347
- data/stdlib/etc/0/etc.rbs +73 -54
- data/stdlib/fileutils/0/fileutils.rbs +179 -160
- data/stdlib/forwardable/0/forwardable.rbs +13 -10
- data/stdlib/io-console/0/io-console.rbs +2 -2
- data/stdlib/ipaddr/0/ipaddr.rbs +0 -5
- data/stdlib/json/0/json.rbs +232 -185
- data/stdlib/monitor/0/monitor.rbs +5 -5
- 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 +521 -397
- 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 +4 -3
- data/stdlib/rdoc/0/comment.rbs +2 -0
- data/stdlib/rdoc/0/options.rbs +76 -0
- data/stdlib/rdoc/0/parser.rbs +1 -1
- data/stdlib/rdoc/0/rdoc.rbs +7 -5
- data/stdlib/rdoc/0/store.rbs +2 -2
- data/stdlib/resolv/0/resolv.rbs +26 -69
- data/stdlib/ripper/0/ripper.rbs +25 -19
- data/stdlib/securerandom/0/manifest.yaml +2 -0
- data/stdlib/securerandom/0/securerandom.rbs +7 -20
- data/stdlib/shellwords/0/shellwords.rbs +3 -3
- data/stdlib/singleton/0/singleton.rbs +3 -0
- data/stdlib/socket/0/addrinfo.rbs +9 -9
- 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 +1209 -95
- data/stdlib/strscan/0/string_scanner.rbs +101 -80
- data/stdlib/tempfile/0/manifest.yaml +3 -0
- data/stdlib/tempfile/0/tempfile.rbs +25 -21
- data/stdlib/time/0/time.rbs +8 -6
- data/stdlib/timeout/0/timeout.rbs +58 -7
- data/stdlib/tsort/0/cyclic.rbs +4 -1
- data/stdlib/tsort/0/interfaces.rbs +8 -8
- data/stdlib/tsort/0/tsort.rbs +16 -15
- data/stdlib/uri/0/common.rbs +42 -20
- data/stdlib/uri/0/file.rbs +3 -3
- data/stdlib/uri/0/generic.rbs +21 -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 +8 -8
- 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/wasm/README.md +60 -0
- data/wasm/rbs_wasm.c +423 -0
- metadata +131 -19
- data/ext/rbs_extension/lexer.c +0 -2728
- data/ext/rbs_extension/lexer.h +0 -179
- data/ext/rbs_extension/lexer.re +0 -147
- data/ext/rbs_extension/lexstate.c +0 -175
- data/ext/rbs_extension/location.c +0 -325
- data/ext/rbs_extension/location.h +0 -85
- data/ext/rbs_extension/parser.c +0 -2982
- data/ext/rbs_extension/parser.h +0 -18
- data/ext/rbs_extension/parserstate.c +0 -411
- data/ext/rbs_extension/parserstate.h +0 -163
- data/ext/rbs_extension/unescape.c +0 -32
- data/include/rbs/ruby_objs.h +0 -72
- data/src/constants.c +0 -153
- data/src/ruby_objs.c +0 -799
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,435 @@
|
|
|
1
1
|
# CHANGELOG
|
|
2
2
|
|
|
3
|
+
## 4.1.1 (2026-07-30)
|
|
4
|
+
|
|
5
|
+
### Library changes
|
|
6
|
+
|
|
7
|
+
* Include the trailing `?` in a keyword key's symbol location ([#3043](https://github.com/ruby/rbs/pull/3043))
|
|
8
|
+
* Mark `type_name` as optional on the alias annotations ([#3039](https://github.com/ruby/rbs/pull/3039))
|
|
9
|
+
|
|
10
|
+
### Miscellaneous
|
|
11
|
+
|
|
12
|
+
* Fix template drift for ext/rbs_extension/ast_translation.c ([#3038](https://github.com/ruby/rbs/pull/3038))
|
|
13
|
+
|
|
14
|
+
## 4.1.0 (2026-07-27)
|
|
15
|
+
|
|
16
|
+
RBS 4.1 ships with JRuby support. The RBS parser is written in plain C without depending on the Ruby C API, so it is compiled to WebAssembly and runs on a Wasm runtime, with the parsed AST serialized in a binary format and decoded into RBS objects. The full test suite runs on JRuby in CI.
|
|
17
|
+
|
|
18
|
+
The inline RBS syntax gets three new features: singleton method definitions (`def self.`), the `module-self` constraint, and instance variable annotations in `module` declarations. Note that RBS inline is still experimental and may change in future releases.
|
|
19
|
+
|
|
20
|
+
This release also introduces `RBS::Rewriter`, an API to edit RBS source text while preserving the surrounding content, which `rbs annotate` is now built on. Parsing performance is improved by interning type names in a shared trie and reducing allocations per node.
|
|
21
|
+
|
|
22
|
+
`RBS::Prototype::Runtime`, the RDoc plugin parser, and the top-level `float` type alias are deprecated in this release.
|
|
23
|
+
|
|
24
|
+
### Signature updates
|
|
25
|
+
|
|
26
|
+
**Updated classes/modules/methods:** `ARGF`, `Array`, `CSV`, `Class`, `Delegator`, `Digest`, `ERB`, `Enumerable`, `Enumerator`, `Enumerator::Product`, `Etc`, `File`, `File::Constants`, `File::Stat`, `FileUtils`, `Float`, `Gem`, `Hash`, `IO`, `IPAddr`, `Integer`, `JSON`, `Kernel`, `MatchData`, `Module`, `Monitor`, `Numeric`, `ObjectSpace::WeakKeyMap`, `OpenSSL`, `Pathname`, `RBS::Ops`, `Ractor`, `Range`, `Resolv`, `RubyVM::InstructionSequence`, `Set`, `Shellwords`, `String`, `StringIO`, `StringScanner`, `Struct`, `Tempfile`, `Thread`, `Timeout`, `TSort`, `URI::Generic`, `Zlib::GzipReader`, `Zlib::ZStream`
|
|
27
|
+
|
|
28
|
+
* Remove stale Float constants and add a constant drift test ([#2994](https://github.com/ruby/rbs/pull/2994))
|
|
29
|
+
* Update RDoc comments with Ruby 4.0.6 ([#3035](https://github.com/ruby/rbs/pull/3035))
|
|
30
|
+
* Add a dependency on tempfile. ([#3025](https://github.com/ruby/rbs/pull/3025))
|
|
31
|
+
* Support `%a{implicitly-returns-nil}` on `MatchData#[]` ([#2990](https://github.com/ruby/rbs/pull/2990))
|
|
32
|
+
* Update `Array` ([#2987](https://github.com/ruby/rbs/pull/2987))
|
|
33
|
+
* Allow nil output buffers for reader methods ([#3002](https://github.com/ruby/rbs/pull/3002))
|
|
34
|
+
* Add stdlib signature tests for #2967 ([#2989](https://github.com/ruby/rbs/pull/2989))
|
|
35
|
+
* Update `Integer`, phase 1 ([#2995](https://github.com/ruby/rbs/pull/2995))
|
|
36
|
+
* Add RBS::Ops ([#2934](https://github.com/ruby/rbs/pull/2934))
|
|
37
|
+
* Update Module ([#2933](https://github.com/ruby/rbs/pull/2933))
|
|
38
|
+
* Correct core/stdlib signatures to match Ruby 4.0 ([#2967](https://github.com/ruby/rbs/pull/2967))
|
|
39
|
+
* Revert Digest::Class method changes ([#2980](https://github.com/ruby/rbs/pull/2980))
|
|
40
|
+
* Add stdlib tests for updated StringScanner signatures ([#2968](https://github.com/ruby/rbs/pull/2968))
|
|
41
|
+
* Update `StringScanner` signatures to match strscan 3.1.6 ([#2959](https://github.com/ruby/rbs/pull/2959))
|
|
42
|
+
* Remove StringScanner methods absent from the latest Ruby release ([#2961](https://github.com/ruby/rbs/pull/2961))
|
|
43
|
+
* Fix `Resolv#initialize` signature: array of resolvers + `use_ipv6:` ([#2960](https://github.com/ruby/rbs/pull/2960))
|
|
44
|
+
* [Hash] Update Hash's signatures and tests to be correct ([#2694](https://github.com/ruby/rbs/pull/2694))
|
|
45
|
+
* update rbs signatures to be more consistent with generics ([#2867](https://github.com/ruby/rbs/pull/2867))
|
|
46
|
+
* Use top-level `path` in fileutils.rbs to suppress deprecation warning ([#2949](https://github.com/ruby/rbs/pull/2949))
|
|
47
|
+
* Update File::Constants and File::Stat ([#2942](https://github.com/ruby/rbs/pull/2942))
|
|
48
|
+
* Add signature for `RubyVM::InstructionSequence.of` ([#2916](https://github.com/ruby/rbs/pull/2916))
|
|
49
|
+
* fix OpenSSL#session_new_cb signature ([#2924](https://github.com/ruby/rbs/pull/2924))
|
|
50
|
+
* [Class] update class.rbs ([#2898](https://github.com/ruby/rbs/pull/2898))
|
|
51
|
+
* Deprecate top-level float ([#2695](https://github.com/ruby/rbs/pull/2695))
|
|
52
|
+
* [Kernel] Updated querying methods ([#2685](https://github.com/ruby/rbs/pull/2685))
|
|
53
|
+
|
|
54
|
+
### Library changes
|
|
55
|
+
|
|
56
|
+
* Convert character offset to byte offset in parse_inline_*_annotation ([#2945](https://github.com/ruby/rbs/pull/2945))
|
|
57
|
+
* Guard against underflow when sysconf(_SC_PAGESIZE) returns 0 ([#3031](https://github.com/ruby/rbs/pull/3031))
|
|
58
|
+
* Report invalid UTF-8 byte in a comment as a parsing error ([#2983](https://github.com/ruby/rbs/pull/2983))
|
|
59
|
+
* Fetch Chicory/ASM jars from Maven instead of bundling in gem ([#3019](https://github.com/ruby/rbs/pull/3019))
|
|
60
|
+
* Add write barrier protection to RBS Location objects ([#3022](https://github.com/ruby/rbs/pull/3022))
|
|
61
|
+
* Rename parameter in rbs_intern_type_name for clarity ([#3023](https://github.com/ruby/rbs/pull/3023))
|
|
62
|
+
* Deprecate RDoc plugin parser ([#3016](https://github.com/ruby/rbs/pull/3016))
|
|
63
|
+
* Run the test suite on JRuby (JRuby support, step 4) ([#3008](https://github.com/ruby/rbs/pull/3008))
|
|
64
|
+
* Run the RBS parser on JRuby via WebAssembly (JRuby support, step 3) ([#3000](https://github.com/ruby/rbs/pull/3000))
|
|
65
|
+
* Add binary serialization of the parsed AST (JRuby support, step 2) ([#2999](https://github.com/ruby/rbs/pull/2999))
|
|
66
|
+
* Build the RBS parser as a WebAssembly module (JRuby support, step 1) ([#2998](https://github.com/ruby/rbs/pull/2998))
|
|
67
|
+
* Reject reversed position ranges in parser/lexer entrypoints ([#2974](https://github.com/ruby/rbs/pull/2974))
|
|
68
|
+
* Fix lexer infinite loop / abort on invalid UTF-8 byte ([#2973](https://github.com/ruby/rbs/pull/2973))
|
|
69
|
+
* Flyweight TypeName / Namespace cached in a shared trie ([#2957](https://github.com/ruby/rbs/pull/2957))
|
|
70
|
+
* Reduce Hash allocation per `Node` creation ([#2946](https://github.com/ruby/rbs/pull/2946))
|
|
71
|
+
* Tidy `ast_translation.c` ([#2947](https://github.com/ruby/rbs/pull/2947))
|
|
72
|
+
* Auto-generate rbs_ast_ruby_annotations_t union from config.yml ([#2939](https://github.com/ruby/rbs/pull/2939))
|
|
73
|
+
* Speed up RBS::InlineParser on large sources with non-ASCII characters ([#2950](https://github.com/ruby/rbs/pull/2950))
|
|
74
|
+
* Support `def self.method_name` singleton method in inline parser ([#2935](https://github.com/ruby/rbs/pull/2935))
|
|
75
|
+
* This is not prism ([#2951](https://github.com/ruby/rbs/pull/2951))
|
|
76
|
+
* Add RBS::Rewriter and use it in rbs annotate ([#2927](https://github.com/ruby/rbs/pull/2927))
|
|
77
|
+
* Add nullability annotations to AST pointer types ([#2922](https://github.com/ruby/rbs/pull/2922))
|
|
78
|
+
* Support `module-self` inline annotation ([#2921](https://github.com/ruby/rbs/pull/2921))
|
|
79
|
+
* Inline instance variable annotation in module declaration ([#2919](https://github.com/ruby/rbs/pull/2919))
|
|
80
|
+
|
|
81
|
+
#### rbs prototype
|
|
82
|
+
|
|
83
|
+
* Fix nested declarations in rbs prototype rbi ([#3029](https://github.com/ruby/rbs/pull/3029))
|
|
84
|
+
* Deprecate prototype runtime ([#2956](https://github.com/ruby/rbs/pull/2956))
|
|
85
|
+
|
|
86
|
+
#### rbs collection
|
|
87
|
+
|
|
88
|
+
* Clean up partial clone before falling back to full clone ([#2978](https://github.com/ruby/rbs/pull/2978))
|
|
89
|
+
* Suppress spurious warning for non-gem stdlib libraries ([#2929](https://github.com/ruby/rbs/pull/2929))
|
|
90
|
+
|
|
91
|
+
### Miscellaneous
|
|
92
|
+
|
|
93
|
+
* Fix Lint/DuplicateMethods in StringIO_test.rb ([#3010](https://github.com/ruby/rbs/pull/3010))
|
|
94
|
+
* Compressed files must be opened in binary mode ([#2981](https://github.com/ruby/rbs/pull/2981))
|
|
95
|
+
* Fix flaky DirSingletonTest GC failures in test_fchdir and test_for_fd ([#3004](https://github.com/ruby/rbs/pull/3004))
|
|
96
|
+
* Add TruffleRuby CI job ([#2996](https://github.com/ruby/rbs/pull/2996))
|
|
97
|
+
* Update the target Ruby version notes to the latest release ([#2962](https://github.com/ruby/rbs/pull/2962))
|
|
98
|
+
* Update docs/inline.md to match current inline parser behavior ([#2953](https://github.com/ruby/rbs/pull/2953))
|
|
99
|
+
* ci: skip Gemfile.lock BUNDLED WITH on ruby-head ([#2952](https://github.com/ruby/rbs/pull/2952))
|
|
100
|
+
* Remove `logger` from sig dependencies ([#2904](https://github.com/ruby/rbs/pull/2904))
|
|
101
|
+
|
|
102
|
+
## 4.0.2 (2026-03-25)
|
|
103
|
+
|
|
104
|
+
### Library changes
|
|
105
|
+
|
|
106
|
+
#### rbs collection
|
|
107
|
+
|
|
108
|
+
* Fix: pathname not written to lockfile. ([#2889](https://github.com/ruby/rbs/pull/2889))
|
|
109
|
+
|
|
110
|
+
### Miscellaneous
|
|
111
|
+
|
|
112
|
+
* Fix test failure on Windows in `ruby/ruby` ([#2900](https://github.com/ruby/rbs/pull/2900))
|
|
113
|
+
* Fix test for Ruby 4.1 ([#2899](https://github.com/ruby/rbs/pull/2899))
|
|
114
|
+
|
|
115
|
+
## 4.0.1 (2026-03-23)
|
|
116
|
+
|
|
117
|
+
This is a minor release to fix Ruby CI failure, which was caused by symlinks included in the `rust` directory.
|
|
118
|
+
|
|
119
|
+
### Library changes
|
|
120
|
+
|
|
121
|
+
* Fix `() -> (void)` being rejected as SyntaxError ([#2884](https://github.com/ruby/rbs/pull/2884))
|
|
122
|
+
|
|
123
|
+
### Miscellaneous
|
|
124
|
+
|
|
125
|
+
* Drop crates ([#2887](https://github.com/ruby/rbs/pull/2887))
|
|
126
|
+
* Add newline at eof ([#2885](https://github.com/ruby/rbs/pull/2885))
|
|
127
|
+
|
|
128
|
+
## 4.0.0 (2026-03-16)
|
|
129
|
+
|
|
130
|
+
RBS 4.0 ships with experimental RBS inline syntax support, allowing you to write type annotations directly in Ruby source files. See [docs/inline.md](docs/inline.md) for the syntax details.
|
|
131
|
+
|
|
132
|
+
```ruby
|
|
133
|
+
class Calculator
|
|
134
|
+
# @rbs (Integer, Integer) -> Integer
|
|
135
|
+
def add(a, b) = a + b
|
|
136
|
+
end
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
Note: RBS inline is still experimental and may change in future releases.
|
|
140
|
+
|
|
141
|
+
This release also introduces two language changes: type argument support for singleton types (`singleton(T)[S]`) mainly for Sorbet integration, and generic type parameter lower bounds (`T < S`).
|
|
142
|
+
|
|
143
|
+
### Signature updates
|
|
144
|
+
|
|
145
|
+
**Updated classes/modules/methods:** `Addrinfo`, `Array`, `BasicObject`, `BigDecimal`, `Binding`, `CGI`, `Comparable`, `Complex`, `Digest::SHA2`, `Encoding::Converter`, `Enumerable`, `Enumerator`, `Enumerator::ArithmeticSequence`, `Enumerator::Lazy`, `Fiber`, `File`, `FileUtils`, `Float`, `Hash`, `IO`, `IO::TimeoutError`, `Integer`, `JSON`, `Kernel`, `Kconv`, `Math`, `Method`, `Minitest`, `Module`, `Numeric`, `ObjectSpace`, `Open3`, `OpenURI`, `OptionParser`, `PStore`, `Pathname`, `Proc`, `Process::Status`, `Psych`, `Ractor`, `Random`, `Random::Formatter`, `Range`, `Rational`, `RBS::Unnamed::TopLevelSelfClass`, `Ripper::Lexer::Elem`, `Ruby`, `RubyVM`, `SecureRandom`, `Set`, `Socket`, `String`, `StringScanner`, `TCPSocket`, `Thread`, `URI`, `URI::Generic`, `Zlib::GzipReader`, `Zlib::GzipWriter`
|
|
146
|
+
|
|
147
|
+
* Remove deprecated types ([#2880](https://github.com/ruby/rbs/pull/2880))
|
|
148
|
+
* Add type `RBS::Unnamed::TopLevelSelfClass` to core ([#2362](https://github.com/ruby/rbs/pull/2362))
|
|
149
|
+
* Graduate bundled gems from Ruby v4.0 ([#2852](https://github.com/ruby/rbs/pull/2852))
|
|
150
|
+
* stdlib: Add missing Psych methods and exception classes ([#2850](https://github.com/ruby/rbs/pull/2850))
|
|
151
|
+
* Add variants with positional argument to `Hash#transform_keys` ([#2848](https://github.com/ruby/rbs/pull/2848))
|
|
152
|
+
* add extra kwarg options for File#initialize and derivatives ([#2798](https://github.com/ruby/rbs/pull/2798))
|
|
153
|
+
* pstore: fixes types, treat it as a collection ([#2806](https://github.com/ruby/rbs/pull/2806))
|
|
154
|
+
* Add signatures for `{Module,Proc}#ruby2_keywords` ([#2805](https://github.com/ruby/rbs/pull/2805))
|
|
155
|
+
* Make Zlib::GzipWriter.new level and strategy parameters optional ([#2810](https://github.com/ruby/rbs/pull/2810))
|
|
156
|
+
* URI.(s) does string coercion ([#2825](https://github.com/ruby/rbs/pull/2825))
|
|
157
|
+
* Fix String#append_as_bytes to accept Integer ([#2817](https://github.com/ruby/rbs/pull/2817))
|
|
158
|
+
* [Comparable] Add in Comparable::_CompareToZero ([#2697](https://github.com/ruby/rbs/pull/2697))
|
|
159
|
+
* [Kernel] Add Kernel.trace_var and Kernel.untrace_var ([#2682](https://github.com/ruby/rbs/pull/2682))
|
|
160
|
+
* Add signature for `Module#method_undefined` ([#2804](https://github.com/ruby/rbs/pull/2804))
|
|
161
|
+
* Fix Zlib::GzipWriter signatures ([#2803](https://github.com/ruby/rbs/pull/2803))
|
|
162
|
+
* GzipWriter#initialize only takes 1 required positional arg ([#2799](https://github.com/ruby/rbs/pull/2799))
|
|
163
|
+
* Fix accessibility of method in Module ([#2802](https://github.com/ruby/rbs/pull/2802))
|
|
164
|
+
* Graduate kconv ([#2794](https://github.com/ruby/rbs/pull/2794))
|
|
165
|
+
* Fix test related to pathname ([#2789](https://github.com/ruby/rbs/pull/2789))
|
|
166
|
+
* Split pathname to core and stdlib ([#2777](https://github.com/ruby/rbs/pull/2777))
|
|
167
|
+
* [Kernel] Narrow `caller_locations` ([#2745](https://github.com/ruby/rbs/pull/2745))
|
|
168
|
+
* Ruby 4.1 changed `source_location` type ([#2784](https://github.com/ruby/rbs/pull/2784))
|
|
169
|
+
* Remove ObjectSpace.count_nodes ([#2779](https://github.com/ruby/rbs/pull/2779))
|
|
170
|
+
* Support selector for `String#strip` family. ([#2775](https://github.com/ruby/rbs/pull/2775))
|
|
171
|
+
* Add `Ruby`, `Array#find`, and `Array#rfind` ([#2767](https://github.com/ruby/rbs/pull/2767))
|
|
172
|
+
* Update minitest ([#2761](https://github.com/ruby/rbs/pull/2761))
|
|
173
|
+
* Support BigDecimal v4 ([#2758](https://github.com/ruby/rbs/pull/2758))
|
|
174
|
+
* Update rdoc and comments ([#2733](https://github.com/ruby/rbs/pull/2733))
|
|
175
|
+
* Update cgi and cgi/escape type definitions ([#2728](https://github.com/ruby/rbs/pull/2728))
|
|
176
|
+
* Update RBS files for Ruby 4 ([#2731](https://github.com/ruby/rbs/pull/2731))
|
|
177
|
+
* Update existing docs ([#2724](https://github.com/ruby/rbs/pull/2724))
|
|
178
|
+
* Remove reference to `JSON.deep_const_get` ([#2701](https://github.com/ruby/rbs/pull/2701))
|
|
179
|
+
* Remove deprecated methods in `JSON` ([#2366](https://github.com/ruby/rbs/pull/2366))
|
|
180
|
+
* Update FileUtils to v1.8.0 ([#2700](https://github.com/ruby/rbs/pull/2700))
|
|
181
|
+
* Avoid overloading where arguments are identical ([#2559](https://github.com/ruby/rbs/pull/2559))
|
|
182
|
+
* Move Pathname to core from stdlib ([#2705](https://github.com/ruby/rbs/pull/2705))
|
|
183
|
+
* Remove undocumented `#nonzero?` ([#2543](https://github.com/ruby/rbs/pull/2543))
|
|
184
|
+
* Add signature for `OptionParser#raise_unknown` ([#2735](https://github.com/ruby/rbs/pull/2735))
|
|
185
|
+
* Add signature for `Open3.popen2` ([#2734](https://github.com/ruby/rbs/pull/2734))
|
|
186
|
+
* Add RFC2396_PARSER to URI module ([#2727](https://github.com/ruby/rbs/pull/2727))
|
|
187
|
+
* Add signature for `Open3.capture3` ([#2714](https://github.com/ruby/rbs/pull/2714))
|
|
188
|
+
* Remove sig for IO#{ready?,nread} ([#2710](https://github.com/ruby/rbs/pull/2710))
|
|
189
|
+
* Accept `nil` state parameter in `to_json` type signatures ([#2691](https://github.com/ruby/rbs/pull/2691))
|
|
190
|
+
* Add type of `Open3.popen3` ([#2699](https://github.com/ruby/rbs/pull/2699))
|
|
191
|
+
* `unsetenv_others` and `close_others` only allows bool. ([#2698](https://github.com/ruby/rbs/pull/2698))
|
|
192
|
+
* Add deprecated annotation to `attr` with bool args ([#2693](https://github.com/ruby/rbs/pull/2693))
|
|
193
|
+
* Update open3 ([#2692](https://github.com/ruby/rbs/pull/2692))
|
|
194
|
+
* Add signature for `SecureRandom.bytes` ([#2690](https://github.com/ruby/rbs/pull/2690))
|
|
195
|
+
* Set %a{deprecated} to deprecated core methods ([#2664](https://github.com/ruby/rbs/pull/2664))
|
|
196
|
+
* Migrate usages of ::_ToPath to use ::path instead ([#2677](https://github.com/ruby/rbs/pull/2677))
|
|
197
|
+
* Add missing signatures for `Random::Formatter` ([#2680](https://github.com/ruby/rbs/pull/2680))
|
|
198
|
+
* Split `Random::Formatter` to core and stdlib ([#2661](https://github.com/ruby/rbs/pull/2661))
|
|
199
|
+
* Skip test cases of developing methods for Pathname ([#2648](https://github.com/ruby/rbs/pull/2648))
|
|
200
|
+
* Add signature `Random.seed` ([#2649](https://github.com/ruby/rbs/pull/2649))
|
|
201
|
+
* Update `string.rbs` to avoid deprecation warning in Steep ([#2655](https://github.com/ruby/rbs/pull/2655))
|
|
202
|
+
* Add sig `IO#pread` and `IO#pwrite` ([#2647](https://github.com/ruby/rbs/pull/2647))
|
|
203
|
+
* Refine signature of `Numeric#step` and add type of `Enumerator::ArithmeticSequence` ([#2600](https://github.com/ruby/rbs/pull/2600))
|
|
204
|
+
* Remove undocumented override methods ([#2622](https://github.com/ruby/rbs/pull/2622))
|
|
205
|
+
* Add docs ([#2625](https://github.com/ruby/rbs/pull/2625))
|
|
206
|
+
* Remove undocumented methods for `imaginary` ([#2620](https://github.com/ruby/rbs/pull/2620))
|
|
207
|
+
* Update securerandom ([#2619](https://github.com/ruby/rbs/pull/2619))
|
|
208
|
+
* Drop undocumented `#eql?` ([#2618](https://github.com/ruby/rbs/pull/2618))
|
|
209
|
+
* Just use `Numeric#+@` and return self ([#2597](https://github.com/ruby/rbs/pull/2597))
|
|
210
|
+
* Drop undocumented `#dup` ([#2598](https://github.com/ruby/rbs/pull/2598))
|
|
211
|
+
* Add signature for `Digest::SHA2` ([#2573](https://github.com/ruby/rbs/pull/2573))
|
|
212
|
+
* Add signatures for `OpenURI` ([#2574](https://github.com/ruby/rbs/pull/2574))
|
|
213
|
+
* Add signature for `IO::TimeoutError` ([#2571](https://github.com/ruby/rbs/pull/2571))
|
|
214
|
+
* Add signatures for `Set` ([#2570](https://github.com/ruby/rbs/pull/2570))
|
|
215
|
+
* Add signature for `Enumerator#+` ([#2567](https://github.com/ruby/rbs/pull/2567))
|
|
216
|
+
* Add signature for `Enumerator::Lazy#eager` ([#2568](https://github.com/ruby/rbs/pull/2568))
|
|
217
|
+
* Add signature for `Fiber#blocking` ([#2566](https://github.com/ruby/rbs/pull/2566))
|
|
218
|
+
* Support BasicObject to avoid NoMethodError for `RBS::Test::TypeCheck` ([#2565](https://github.com/ruby/rbs/pull/2565))
|
|
219
|
+
* Add documentation for `Range#{minmax,count,to_a,entries}` ([#2562](https://github.com/ruby/rbs/pull/2562))
|
|
220
|
+
* Delegate to `Enumerable` from `Range#{min,max}` ([#2540](https://github.com/ruby/rbs/pull/2540))
|
|
221
|
+
* Add URI::Generic#+ ([#2535](https://github.com/ruby/rbs/pull/2535))
|
|
222
|
+
* Make IO.binread, IO.binwrite, IO.read and IO.write accept _ToPath ([#2378](https://github.com/ruby/rbs/pull/2378))
|
|
223
|
+
* Support pattern argument for Enumerable#{all,any,none,one}? ([#2368](https://github.com/ruby/rbs/pull/2368))
|
|
224
|
+
* fixing sig for addrinfo ([#2464](https://github.com/ruby/rbs/pull/2464))
|
|
225
|
+
|
|
226
|
+
### Language updates
|
|
227
|
+
|
|
228
|
+
* Add type arguments support to singleton types ([#2502](https://github.com/ruby/rbs/pull/2502))
|
|
229
|
+
* Move the note about lower bound ([#2517](https://github.com/ruby/rbs/pull/2517))
|
|
230
|
+
* Add support for lower bounds in type parameters ([#2490](https://github.com/ruby/rbs/pull/2490))
|
|
231
|
+
|
|
232
|
+
### Library changes
|
|
233
|
+
|
|
234
|
+
* Add `#type_fingerprint` methods ([#2879](https://github.com/ruby/rbs/pull/2879))
|
|
235
|
+
* `top` for membership predicates of collection types ([#2878](https://github.com/ruby/rbs/pull/2878))
|
|
236
|
+
* Add block parameter (`&block`) type declaration ([#2875](https://github.com/ruby/rbs/pull/2875))
|
|
237
|
+
* Add splat (`*a`) and double-splat (`**a`) parameter support ([#2873](https://github.com/ruby/rbs/pull/2873))
|
|
238
|
+
* Add parameter type inline annotation ([#2443](https://github.com/ruby/rbs/pull/2443))
|
|
239
|
+
* Reduce compile warnings ([#2871](https://github.com/ruby/rbs/pull/2871))
|
|
240
|
+
* Specify input range by byte offsets ([#2863](https://github.com/ruby/rbs/pull/2863))
|
|
241
|
+
* add `extern "C"` wrapping to `rbs.h` when using C++ ([#2855](https://github.com/ruby/rbs/pull/2855))
|
|
242
|
+
* Automatically inherits super method type if unannotated ([#2858](https://github.com/ruby/rbs/pull/2858))
|
|
243
|
+
* Add `...` syntax to method type inline annotation syntax ([#2856](https://github.com/ruby/rbs/pull/2856))
|
|
244
|
+
* Fix for string reference corruption issue ([#2836](https://github.com/ruby/rbs/pull/2836))
|
|
245
|
+
* Use unreleased steep for `rake typecheck_test` ([#2842](https://github.com/ruby/rbs/pull/2842))
|
|
246
|
+
* Fix breaking references after GC.compact ([#2822](https://github.com/ruby/rbs/pull/2822))
|
|
247
|
+
* Fix special methods accessibility. ([#2546](https://github.com/ruby/rbs/pull/2546))
|
|
248
|
+
* Fix allocation alignment ([#2788](https://github.com/ruby/rbs/pull/2788))
|
|
249
|
+
* Skip `set` and `pathname` from `manifest.yaml` ([#2773](https://github.com/ruby/rbs/pull/2773))
|
|
250
|
+
* Fix C++ compiler warnings ([#2755](https://github.com/ruby/rbs/pull/2755))
|
|
251
|
+
* Better encoding ([#2675](https://github.com/ruby/rbs/pull/2675))
|
|
252
|
+
* Move `require_eof` handling to C API ([#2678](https://github.com/ruby/rbs/pull/2678))
|
|
253
|
+
* Delete debug print ([#2753](https://github.com/ruby/rbs/pull/2753))
|
|
254
|
+
* Make assertions macro ([#2729](https://github.com/ruby/rbs/pull/2729))
|
|
255
|
+
* Remove deprecated method `Kernel#Namespace`. Also remove `Kernel#TypeName`. ([#2480](https://github.com/ruby/rbs/pull/2480))
|
|
256
|
+
* Update rdoc to 6.13.1 ([#2355](https://github.com/ruby/rbs/pull/2355))
|
|
257
|
+
* Allow `self` for inline `@rbs @ivar: self` ([#2633](https://github.com/ruby/rbs/pull/2633))
|
|
258
|
+
* Normalize modules during type name resolution ([#2670](https://github.com/ruby/rbs/pull/2670))
|
|
259
|
+
* Only load extconf_compile_commands_json when compiling through Rake ([#2498](https://github.com/ruby/rbs/pull/2498))
|
|
260
|
+
* Use `malloc` based allocator ([#2666](https://github.com/ruby/rbs/pull/2666))
|
|
261
|
+
* Add another parser benchmark script ([#2668](https://github.com/ruby/rbs/pull/2668))
|
|
262
|
+
* Reuse empty array and hash ([#2667](https://github.com/ruby/rbs/pull/2667))
|
|
263
|
+
* Faster lexical analyzer ([#2665](https://github.com/ruby/rbs/pull/2665))
|
|
264
|
+
* Introduce `type_fingerprint` ([#2644](https://github.com/ruby/rbs/pull/2644))
|
|
265
|
+
* Add module-class alias declaration ([#2636](https://github.com/ruby/rbs/pull/2636))
|
|
266
|
+
* Inline constant declaration ([#2635](https://github.com/ruby/rbs/pull/2635))
|
|
267
|
+
* `self` type is rejected depending on the context ([#2627](https://github.com/ruby/rbs/pull/2627))
|
|
268
|
+
* Add instance variable declaration annotation ([#2632](https://github.com/ruby/rbs/pull/2632))
|
|
269
|
+
* Module-self allow void once ([#2626](https://github.com/ruby/rbs/pull/2626))
|
|
270
|
+
* Support inheritance in Inline RBS declaration ([#2630](https://github.com/ruby/rbs/pull/2630))
|
|
271
|
+
* Inline attribute/method definitions have comments ([#2624](https://github.com/ruby/rbs/pull/2624))
|
|
272
|
+
* Inline RBS declaration for attributes (`attr_***`) ([#2623](https://github.com/ruby/rbs/pull/2623))
|
|
273
|
+
* Fix bad scaling in `rbs_comment_t` tokens ([#2578](https://github.com/ruby/rbs/pull/2578))
|
|
274
|
+
* Update parser so that `void` type is rejected depending on the context ([#2590](https://github.com/ruby/rbs/pull/2590))
|
|
275
|
+
* Implement mixin in inline RBS declarations ([#2614](https://github.com/ruby/rbs/pull/2614))
|
|
276
|
+
* Validate type args given to non-generic ancestor ([#2615](https://github.com/ruby/rbs/pull/2615))
|
|
277
|
+
* Add name locations to AST ([#2595](https://github.com/ruby/rbs/pull/2595))
|
|
278
|
+
* Move `exit` calls to `exe/rbs` ([#2591](https://github.com/ruby/rbs/pull/2591))
|
|
279
|
+
* Fix locator ([#2588](https://github.com/ruby/rbs/pull/2588))
|
|
280
|
+
* Introduce standalone C parser for RBS with arena allocation ([#2398](https://github.com/ruby/rbs/pull/2398))
|
|
281
|
+
* Fix subtraction of civar ([#2369](https://github.com/ruby/rbs/pull/2369))
|
|
282
|
+
* Buffer with empty string ([#2551](https://github.com/ruby/rbs/pull/2551))
|
|
283
|
+
* Fix unavailable MAP_ANONYMOUS ([#2470](https://github.com/ruby/rbs/pull/2470))
|
|
284
|
+
* Inline minor fix ([#2514](https://github.com/ruby/rbs/pull/2514))
|
|
285
|
+
* Enable `-Wc++-compat` ([#2463](https://github.com/ruby/rbs/pull/2463))
|
|
286
|
+
* Expose a method to parse type parameters ([#2457](https://github.com/ruby/rbs/pull/2457))
|
|
287
|
+
* Expose and fix `Block#location` ([#2456](https://github.com/ruby/rbs/pull/2456))
|
|
288
|
+
* Restore RBS::Environment#declarations for backwards-compatibility ([#2393](https://github.com/ruby/rbs/pull/2393))
|
|
289
|
+
* Implement `@rbs return: T` annotation ([#2406](https://github.com/ruby/rbs/pull/2406))
|
|
290
|
+
* Add `@rbs skip` annotation ([#2405](https://github.com/ruby/rbs/pull/2405))
|
|
291
|
+
* Inline annotations ([#2403](https://github.com/ruby/rbs/pull/2403))
|
|
292
|
+
* Inline `def` support ([#2392](https://github.com/ruby/rbs/pull/2392))
|
|
293
|
+
* Suppress to GCC warning with multi-line comment ([#2383](https://github.com/ruby/rbs/pull/2383))
|
|
294
|
+
* Add inline class/module declaration ([#2390](https://github.com/ruby/rbs/pull/2390))
|
|
295
|
+
* Add `RBS::Source::RBS` ([#2380](https://github.com/ruby/rbs/pull/2380))
|
|
296
|
+
|
|
297
|
+
#### rbs prototype
|
|
298
|
+
|
|
299
|
+
* [prototype runtime] Find redefined methods ([#2542](https://github.com/ruby/rbs/pull/2542))
|
|
300
|
+
|
|
301
|
+
#### rbs collection
|
|
302
|
+
|
|
303
|
+
### Miscellaneous
|
|
304
|
+
|
|
305
|
+
* bundle update (2026-01-20) ([#2818](https://github.com/ruby/rbs/pull/2818))
|
|
306
|
+
* Ruby 4.0.1 ([#2823](https://github.com/ruby/rbs/pull/2823))
|
|
307
|
+
* [rbs/test] Check type arguments size ([#2809](https://github.com/ruby/rbs/pull/2809))
|
|
308
|
+
* Add tsort to testing dependencies ([#2795](https://github.com/ruby/rbs/pull/2795))
|
|
309
|
+
* Update ruby to 4.0 ([#2776](https://github.com/ruby/rbs/pull/2776))
|
|
310
|
+
* Ruby 4.0.0 preview3 ([#2764](https://github.com/ruby/rbs/pull/2764))
|
|
311
|
+
* Remove test code for bundled gems ([#2760](https://github.com/ruby/rbs/pull/2760))
|
|
312
|
+
* Fix `nil` size `Enumerator` test ([#2749](https://github.com/ruby/rbs/pull/2749))
|
|
313
|
+
* Fix tests for rbs_skip_tests in ruby repo ([#2725](https://github.com/ruby/rbs/pull/2725))
|
|
314
|
+
* Update rdoc to v6.16 ([#2721](https://github.com/ruby/rbs/pull/2721))
|
|
315
|
+
* Run CI with "4.0.0-preview2" ([#2718](https://github.com/ruby/rbs/pull/2718))
|
|
316
|
+
* Minor typo fix ([#2676](https://github.com/ruby/rbs/pull/2676))
|
|
317
|
+
* Add -j option to make ([#2658](https://github.com/ruby/rbs/pull/2658))
|
|
318
|
+
* Allows the use of a path list as RBS_SKIP_TESTS ([#2612](https://github.com/ruby/rbs/pull/2612))
|
|
319
|
+
* Fix clang-format ([#2589](https://github.com/ruby/rbs/pull/2589))
|
|
320
|
+
* Restrict the execution of the valgrind task to when the C code has been modified. ([#2552](https://github.com/ruby/rbs/pull/2552))
|
|
321
|
+
* Set force_ruby_platform for bundler when head ([#2555](https://github.com/ruby/rbs/pull/2555))
|
|
322
|
+
* More skip paths with valgrind ([#2557](https://github.com/ruby/rbs/pull/2557))
|
|
323
|
+
* Run the `Encoding::Converter` test ([#2550](https://github.com/ruby/rbs/pull/2550))
|
|
324
|
+
* Fix CI ([#2527](https://github.com/ruby/rbs/pull/2527))
|
|
325
|
+
* Replace reference with official documentation ([#2453](https://github.com/ruby/rbs/pull/2453))
|
|
326
|
+
* Add clangd integration for improved C extension development ([#2481](https://github.com/ruby/rbs/pull/2481))
|
|
327
|
+
* Setup clang format for C code ([#2437](https://github.com/ruby/rbs/pull/2437))
|
|
328
|
+
* Add `super` calls in `setup` ([#2484](https://github.com/ruby/rbs/pull/2484))
|
|
329
|
+
* Suppress warnings during testing ([#2370](https://github.com/ruby/rbs/pull/2370))
|
|
330
|
+
* Update rubocop-on-rbs and use plugins ([#2345](https://github.com/ruby/rbs/pull/2345))
|
|
331
|
+
* Fix error at Ruby CI ([#2445](https://github.com/ruby/rbs/pull/2445))
|
|
332
|
+
* Use `erb` instead of `set` for load path testing ([#2439](https://github.com/ruby/rbs/pull/2439))
|
|
333
|
+
* Skip loading ruby_memcheck ([#2349](https://github.com/ruby/rbs/pull/2349))
|
|
334
|
+
* Forcibly uninstall gems even if there is a dependency problem. ([#2346](https://github.com/ruby/rbs/pull/2346))
|
|
335
|
+
|
|
336
|
+
## 3.10.4 (2026-03-25)
|
|
337
|
+
|
|
338
|
+
### Library changes
|
|
339
|
+
|
|
340
|
+
#### rbs collection
|
|
341
|
+
|
|
342
|
+
* [Backport] [3.10] Fix: pathname not written to lockfile. ([#2896](https://github.com/ruby/rbs/pull/2896))
|
|
343
|
+
|
|
344
|
+
## 3.10.3 (2026-01-30)
|
|
345
|
+
|
|
346
|
+
This is a minor fix around the dependency to `tsort`.
|
|
347
|
+
|
|
348
|
+
## Pull Requests
|
|
349
|
+
|
|
350
|
+
* Merge pull request #2601 from ima1zumi/add-tsort-dep ([#2834](https://github.com/ruby/rbs/pull/2834))
|
|
351
|
+
|
|
352
|
+
## 3.10.2 (2026-01-07)
|
|
353
|
+
|
|
354
|
+
This is a minor fix on arena allocator alignment.
|
|
355
|
+
|
|
356
|
+
### Pull Requests
|
|
357
|
+
|
|
358
|
+
* Merge pull request #2788 from ruby/fix-alloc-alignment ([#2790](https://github.com/ruby/rbs/pull/2790))
|
|
359
|
+
|
|
360
|
+
## 3.10.1 (2026-01-07)
|
|
361
|
+
|
|
362
|
+
This is a follow-up release for Ruby 4.0.0 with documentation update based on Ruby 4.0.0, and bugfixes related to set/pathname library loading.
|
|
363
|
+
|
|
364
|
+
### Pull Requests
|
|
365
|
+
|
|
366
|
+
* Merge pull request #2777 from ksss/pathname-ext ([#2786](https://github.com/ruby/rbs/pull/2786))
|
|
367
|
+
* Ruby 4.0.0 backports ([#2785](https://github.com/ruby/rbs/pull/2785))
|
|
368
|
+
* [Backport] Fix subtraction of civar ([#2783](https://github.com/ruby/rbs/pull/2783))
|
|
369
|
+
* [Backport] Update ruby to 4.0 ([#2778](https://github.com/ruby/rbs/pull/2778))
|
|
370
|
+
|
|
371
|
+
## 3.10.0 (2025-12-23)
|
|
372
|
+
|
|
373
|
+
RBS 3.10.0 ships with a pure C parser implementation, signature updates for Ruby 4.0, and various bug fixes.
|
|
374
|
+
|
|
375
|
+
### Pure C parser implementation
|
|
376
|
+
|
|
377
|
+
The new parser implementation was announced at [RubyKaigi 2025](https://rubykaigi.org/2025/presentations/amomchilov.html) and is finally shipped as a RubyGem!
|
|
378
|
+
|
|
379
|
+
The new parser is faster than the one in 3.9 and is portable — it is independent of the Ruby runtime and is used to implement Sorbet’s RBS support.
|
|
380
|
+
|
|
381
|
+
### Type definition of bundled gems
|
|
382
|
+
|
|
383
|
+
The type definitions of `cgi` have been moved to [gem_rbs_collection](https://github.com/ruby/gem_rbs_collection/tree/main/gems/cgi), as it has been migrated to a bundled gem in Ruby 4.0
|
|
384
|
+
|
|
385
|
+
`cgi-escape` has been added to `stdlib`. You may need to declare a dependency on `cgi-escape` in your `manifest.yaml`, add `-r cgi-escape` to your command line, or update your type checker configuration.
|
|
386
|
+
|
|
387
|
+
```yaml
|
|
388
|
+
dependencies:
|
|
389
|
+
- name: cgi-escape
|
|
390
|
+
```
|
|
391
|
+
|
|
392
|
+
The type definitions for `pathname` have also been moved from `stdlib` to `core`, as it is now implemented as part of the core library.
|
|
393
|
+
|
|
394
|
+
### Pull Requests
|
|
395
|
+
|
|
396
|
+
* [Backport] Support rdoc v7 ([#2770](https://github.com/ruby/rbs/pull/2770))
|
|
397
|
+
* [Backport] Check tuple type length ([#2766](https://github.com/ruby/rbs/pull/2766))
|
|
398
|
+
* Backport update to 4.0.0-preview3 ([#2768](https://github.com/ruby/rbs/pull/2768))
|
|
399
|
+
* [Backport] Remove test code for bundled gems ([#2762](https://github.com/ruby/rbs/pull/2762))
|
|
400
|
+
* Merge pull request #2761 from ruby/update-minitest ([#2763](https://github.com/ruby/rbs/pull/2763))
|
|
401
|
+
* [Backport] Support BigDecimal v4 ([#2759](https://github.com/ruby/rbs/pull/2759))
|
|
402
|
+
* Parser/lexer backports ([#2756](https://github.com/ruby/rbs/pull/2756))
|
|
403
|
+
* Merge pull request #2753 from ruby/delete-printf ([#2754](https://github.com/ruby/rbs/pull/2754))
|
|
404
|
+
* Backports ([#2751](https://github.com/ruby/rbs/pull/2751))
|
|
405
|
+
* Merge pull request #2728 from ruby/cgi ([#2747](https://github.com/ruby/rbs/pull/2747))
|
|
406
|
+
* Merge pull request #2729 from ruby/rbs-assert ([#2748](https://github.com/ruby/rbs/pull/2748))
|
|
407
|
+
* Merge pull request #2749 from ruby/fix-test ([#2750](https://github.com/ruby/rbs/pull/2750))
|
|
408
|
+
* Backport RBS file updates ([#2742](https://github.com/ruby/rbs/pull/2742))
|
|
409
|
+
* Backport JSON PRs ([#2740](https://github.com/ruby/rbs/pull/2740))
|
|
410
|
+
* Merge pull request #2718 from ruby/ruby-4 ([#2741](https://github.com/ruby/rbs/pull/2741))
|
|
411
|
+
* [Backport] Move Pathname to core from stdlib ([#2730](https://github.com/ruby/rbs/pull/2730))
|
|
412
|
+
* Backport rdoc 6.16 ([#2722](https://github.com/ruby/rbs/pull/2722))
|
|
413
|
+
* Backport rdoc support ([#2719](https://github.com/ruby/rbs/pull/2719))
|
|
414
|
+
* Backport "Remove sig for IO#{ready?,nread}" ([#2720](https://github.com/ruby/rbs/pull/2720))
|
|
415
|
+
* Backport more pure C parsers ([#2679](https://github.com/ruby/rbs/pull/2679))
|
|
416
|
+
* Backport module name normalization ([#2673](https://github.com/ruby/rbs/pull/2673))
|
|
417
|
+
* Backport pure-C parser ([#2671](https://github.com/ruby/rbs/pull/2671))
|
|
418
|
+
* Fix test failure ([#2672](https://github.com/ruby/rbs/pull/2672))
|
|
419
|
+
|
|
420
|
+
## 3.9.5 (2025-09-08)
|
|
421
|
+
|
|
422
|
+
### Signature updates
|
|
423
|
+
|
|
424
|
+
* Merge pull request #2655 from ruby/silence-string-deprecation ([#2656](https://github.com/ruby/rbs/pull/2656))
|
|
425
|
+
|
|
426
|
+
### Miscellaneous
|
|
427
|
+
|
|
428
|
+
* Allows the use of a path list as RBS_SKIP_TESTS ([#2641](https://github.com/ruby/rbs/pull/2641))
|
|
429
|
+
* Suppress to GCC warning with multi-line comment ([#2646](https://github.com/ruby/rbs/pull/2646))
|
|
430
|
+
* Backport to 3.9 ([#2487](https://github.com/ruby/rbs/pull/2487))
|
|
431
|
+
* Use erb instead of set for load path testing ([#2468](https://github.com/ruby/rbs/pull/2468))
|
|
432
|
+
|
|
3
433
|
## 3.9.4 (2025-05-15)
|
|
4
434
|
|
|
5
435
|
### Miscellaneous
|
data/Dockerfile.jruby
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# JRuby verification image for RBS.
|
|
2
|
+
#
|
|
3
|
+
# RBS can't load its MRI C extension on JRuby, so it parses through a
|
|
4
|
+
# WebAssembly build of the parser (see lib/rbs/wasm and docs/wasm_serialization.md).
|
|
5
|
+
# This single-stage image installs the WASI SDK, compiles rbs_parser.wasm and
|
|
6
|
+
# downloads the Chicory/ASM jars into ~/.m2 (via jar-dependencies), then runs the
|
|
7
|
+
# test suite on JRuby. It mirrors .github/workflows/jruby.yml but is self-contained.
|
|
8
|
+
#
|
|
9
|
+
# docker build -f Dockerfile.jruby -t rbs-jruby .
|
|
10
|
+
# docker run --rm rbs-jruby # run the test suite
|
|
11
|
+
# docker run --rm -e RBS_PLATFORM=java rbs-jruby \
|
|
12
|
+
# gem build rbs.gemspec # build the -java gem
|
|
13
|
+
#
|
|
14
|
+
# Bundler is intentionally not used: the development Gemfile pulls in CRuby-only
|
|
15
|
+
# C extensions (bigdecimal, stackprof, ...) that cannot build on JRuby. The few
|
|
16
|
+
# gems the suite needs are installed directly, exactly as the CI does.
|
|
17
|
+
|
|
18
|
+
FROM jruby:10.1.1.0-jdk21
|
|
19
|
+
|
|
20
|
+
# Keep in sync with .github/workflows/wasm.yml and .github/workflows/jruby.yml.
|
|
21
|
+
ARG WASI_SDK_VERSION=33
|
|
22
|
+
ARG WASI_SDK_RELEASE=33.0
|
|
23
|
+
|
|
24
|
+
# build-essential supplies cc/make: on JRuby the prism gem builds libprism.so
|
|
25
|
+
# (loaded via FFI) instead of an MRI C extension, so it needs a C toolchain.
|
|
26
|
+
RUN apt-get update \
|
|
27
|
+
&& apt-get install -y --no-install-recommends git curl ca-certificates build-essential \
|
|
28
|
+
&& rm -rf /var/lib/apt/lists/*
|
|
29
|
+
|
|
30
|
+
# The WASI SDK provides clang, the wasi-libc sysroot and the wasm32 compiler-rt
|
|
31
|
+
# builtins that `rake wasm:build` needs to compile src/**/*.c to WebAssembly.
|
|
32
|
+
RUN set -eux; \
|
|
33
|
+
case "$(uname -m)" in \
|
|
34
|
+
x86_64 | amd64) wasi_arch=x86_64 ;; \
|
|
35
|
+
aarch64 | arm64) wasi_arch=arm64 ;; \
|
|
36
|
+
*) echo "unsupported arch: $(uname -m)" >&2; exit 1 ;; \
|
|
37
|
+
esac; \
|
|
38
|
+
mkdir -p /opt/wasi-sdk; \
|
|
39
|
+
curl -fsSL "https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${WASI_SDK_VERSION}/wasi-sdk-${WASI_SDK_RELEASE}-${wasi_arch}-linux.tar.gz" \
|
|
40
|
+
| tar xz --strip-components=1 -C /opt/wasi-sdk
|
|
41
|
+
ENV WASI_SDK_PATH=/opt/wasi-sdk
|
|
42
|
+
|
|
43
|
+
# Runtime/test gems the suite needs on JRuby (same set as the jruby.yml CI).
|
|
44
|
+
RUN gem install prism rake rake-compiler test-unit rdoc rspec minitest json-schema pry --no-document
|
|
45
|
+
|
|
46
|
+
WORKDIR /rbs
|
|
47
|
+
COPY . .
|
|
48
|
+
|
|
49
|
+
# Compile rbs_parser.wasm (clang is a subprocess, so the build is engine
|
|
50
|
+
# independent) and download the Chicory + ASM jars into ~/.m2 via jar-dependencies.
|
|
51
|
+
RUN rake wasm:jruby_setup wasm:install_jars
|
|
52
|
+
|
|
53
|
+
CMD ["rake", "test"]
|
data/README.md
CHANGED
|
@@ -54,8 +54,8 @@ end
|
|
|
54
54
|
|
|
55
55
|
## The Target Version
|
|
56
56
|
|
|
57
|
-
* The standard library signatures targets the latest release of Ruby. (`
|
|
58
|
-
* The library code targets non-EOL versions of Ruby. (`>= 3.
|
|
57
|
+
* The standard library signatures targets the [latest release of Ruby](https://www.ruby-lang.org/en/downloads/branches/). (`4.0` as of 2026.)
|
|
58
|
+
* The library code targets [non-EOL versions of Ruby](https://www.ruby-lang.org/en/downloads/branches/). (`>= 3.3` as of 2026.)
|
|
59
59
|
|
|
60
60
|
## Installation
|
|
61
61
|
|
|
@@ -122,7 +122,7 @@ This is only a starting point, and you should edit the output to match your sign
|
|
|
122
122
|
|
|
123
123
|
- `rb` generates from just the available Ruby code
|
|
124
124
|
- `rbi` generates from Sorbet RBI
|
|
125
|
-
- `runtime` generates from runtime API
|
|
125
|
+
- `runtime` generates from runtime API (**deprecated**; see [#2841](https://github.com/ruby/rbs/issues/2841))
|
|
126
126
|
|
|
127
127
|
## Library
|
|
128
128
|
|
|
@@ -141,7 +141,7 @@ require "rbs"
|
|
|
141
141
|
loader = RBS::EnvironmentLoader.new()
|
|
142
142
|
|
|
143
143
|
# loader.add(path: Pathname("sig")) # Load .rbs files from `sig` directory
|
|
144
|
-
# loader.add(library: "
|
|
144
|
+
# loader.add(library: "logger") # Load logger library
|
|
145
145
|
|
|
146
146
|
environment = RBS::Environment.from_loader(loader).resolve_type_names
|
|
147
147
|
|
|
@@ -198,6 +198,43 @@ After checking out the repo, run `bin/setup` to install dependencies. Then, run
|
|
|
198
198
|
|
|
199
199
|
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
|
200
200
|
|
|
201
|
+
### C Code Formatting
|
|
202
|
+
|
|
203
|
+
This project uses `clang-format` to enforce consistent formatting of C code with a `.clang-format` configuration in the root directory.
|
|
204
|
+
|
|
205
|
+
#### Setup
|
|
206
|
+
|
|
207
|
+
First, install clang-format:
|
|
208
|
+
|
|
209
|
+
```bash
|
|
210
|
+
# macOS
|
|
211
|
+
brew install clang-format
|
|
212
|
+
|
|
213
|
+
# Ubuntu/Debian
|
|
214
|
+
sudo apt-get install clang-format
|
|
215
|
+
|
|
216
|
+
# Windows
|
|
217
|
+
choco install llvm
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
#### Usage
|
|
221
|
+
|
|
222
|
+
Format all C source files:
|
|
223
|
+
|
|
224
|
+
```bash
|
|
225
|
+
rake format:c
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
Check formatting without making changes:
|
|
229
|
+
|
|
230
|
+
```bash
|
|
231
|
+
rake format:c_check
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
#### Editor Integration
|
|
235
|
+
|
|
236
|
+
For VS Code users, install the "clangd" extension which will automatically use the project's `.clang-format` file.
|
|
237
|
+
|
|
201
238
|
## Contributing
|
|
202
239
|
|
|
203
240
|
Bug reports and pull requests are welcome on GitHub at https://github.com/ruby/rbs.
|