rbs 4.1.2 → 4.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitattributes +1 -0
- data/.github/workflows/bundle-update.yml +2 -2
- data/.github/workflows/c-check.yml +2 -2
- data/.github/workflows/changelog.yml +121 -0
- data/.github/workflows/comments.yml +2 -2
- data/.github/workflows/dependabot.yml +1 -1
- data/.github/workflows/jruby.yml +3 -3
- data/.github/workflows/release-gems.yml +6 -7
- data/.github/workflows/ruby.yml +6 -6
- data/.github/workflows/rust.yml +12 -12
- data/.github/workflows/truffleruby.yml +2 -2
- data/.github/workflows/typecheck.yml +2 -2
- data/.github/workflows/wasm.yml +3 -3
- data/.github/workflows/windows.yml +2 -2
- data/.rubocop.yml +0 -1
- data/CHANGELOG.md +57 -0
- data/Rakefile +50 -21
- data/config.yml +5 -0
- data/core/io.rbs +2 -1
- data/docs/CONTRIBUTING.md +1 -1
- data/docs/release.md +57 -1
- data/docs/stdlib.md +8 -0
- data/docs/syntax.md +12 -0
- data/ext/rbs_extension/ast_translation.c +15 -0
- data/ext/rbs_extension/class_constants.c +2 -0
- data/ext/rbs_extension/class_constants.h +1 -0
- data/ext/rbs_extension/main.c +55 -19
- data/include/rbs/ast.h +21 -13
- data/include/rbs/defines.h +8 -3
- data/include/rbs/lexer.h +13 -12
- data/include/rbs/parser.h +37 -3
- data/lib/rbs/ast/declarations.rb +1 -1
- data/lib/rbs/ast/type_param.rb +1 -1
- data/lib/rbs/definition_builder/ancestor_builder.rb +8 -5
- data/lib/rbs/definition_builder/method_builder.rb +4 -4
- data/lib/rbs/definition_builder.rb +5 -2
- data/lib/rbs/environment/class_entry.rb +12 -0
- data/lib/rbs/environment/module_entry.rb +26 -1
- data/lib/rbs/parser_aux.rb +2 -2
- data/lib/rbs/prototype/helpers.rb +19 -52
- data/lib/rbs/prototype/runtime/value_object_generator.rb +0 -1
- data/lib/rbs/prototype/runtime.rb +1 -1
- data/lib/rbs/types.rb +44 -2
- data/lib/rbs/unit_test/type_assertions.rb +5 -5
- data/lib/rbs/version.rb +1 -1
- data/lib/rbs/wasm/parser.rb +62 -25
- data/lib/rbs/wasm/runtime.rb +19 -4
- data/lib/rbs/wasm/serialization_schema.rb +3 -2
- data/rbs.gemspec +1 -5
- data/schema/function.json +12 -1
- data/sig/environment/class_entry.rbs +6 -0
- data/sig/environment/module_entry.rbs +15 -0
- data/sig/parser.rbs +4 -4
- data/sig/types.rbs +11 -1
- data/sig/unit_test/type_assertions.rbs +2 -2
- data/src/ast.c +17 -1
- data/src/lexer.c +1562 -1560
- data/src/lexer.re +50 -18
- data/src/lexstate.c +2 -1
- data/src/parser.c +130 -70
- data/src/serialize.c +20 -13
- data/src/util/rbs_encoding.c +195 -49
- data/stdlib/erb/0/erb.rbs +4 -4
- data/stdlib/monitor/0/monitor.rbs +4 -4
- data/stdlib/singleton/0/singleton.rbs +3 -0
- data/stdlib/stringio/0/stringio.rbs +2 -1
- data/stdlib/zlib/0/gzip_file.rbs +1 -1
- data/stdlib/zlib/0/gzip_writer.rbs +2 -1
- data/wasm/README.md +20 -4
- data/wasm/rbs_wasm.c +93 -37
- metadata +5 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3e76f94a794b829effcba20a9dc637da54915d4bb3a87fa1b4200c4091fa60a6
|
|
4
|
+
data.tar.gz: 5f6eb47e5f31023f56ccede03402493f223719fa5dc1033995fecc592e87e2f1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 168b150476b5515f06f4bc72a58854bc2c60cf073365761ceacf9dc48a5be22d41a0469c168e76ac9d85d03fbdb0e67ac2f7d3564ee6055191432514ff56b10c
|
|
7
|
+
data.tar.gz: 80e89dae7445279f1ee30c825280af61259363911fc78032812dfd1be5f4fc7677598732ca42b3366dff2bc1269fe8b7cd8e6bfa49ccd8a225fe318285bfdfb1
|
data/.gitattributes
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
src/lexer.c linguist-generated
|
|
@@ -11,10 +11,10 @@ jobs:
|
|
|
11
11
|
|
|
12
12
|
steps:
|
|
13
13
|
- name: Checkout repository
|
|
14
|
-
uses: actions/checkout@v7
|
|
14
|
+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
15
15
|
|
|
16
16
|
- name: Set up Ruby
|
|
17
|
-
uses: ruby/setup-ruby@v1
|
|
17
|
+
uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1.321.0
|
|
18
18
|
with:
|
|
19
19
|
ruby-version: '4.0'
|
|
20
20
|
|
|
@@ -14,8 +14,8 @@ jobs:
|
|
|
14
14
|
format-check:
|
|
15
15
|
runs-on: ubuntu-latest
|
|
16
16
|
steps:
|
|
17
|
-
- uses: actions/checkout@v7
|
|
18
|
-
- uses: ruby/setup-ruby@v1
|
|
17
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
18
|
+
- uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1.321.0
|
|
19
19
|
with:
|
|
20
20
|
ruby-version: "4.0"
|
|
21
21
|
bundler-cache: none
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
name: Changelog
|
|
2
|
+
|
|
3
|
+
# Prints the changelog template for a release, which is otherwise `rake gem:changelog`
|
|
4
|
+
# on a laptop.
|
|
5
|
+
#
|
|
6
|
+
# The task asks GitHub which pull requests the commits came from, and it asks through
|
|
7
|
+
# `gh`. A Claude Code on the web session cannot reach `api.github.com` at all -- the
|
|
8
|
+
# refusal is keyed on the session, so neither installing `gh` nor rewriting the task
|
|
9
|
+
# against REST gets around it -- and a runner has both `gh` and `github.token`. So the
|
|
10
|
+
# same task runs here, and the release is prepared from a session that could not
|
|
11
|
+
# otherwise produce this list.
|
|
12
|
+
#
|
|
13
|
+
# The ref selector picks the branch the changelog is for *and* the copy of the task
|
|
14
|
+
# that computes it, which are the same thing: dispatch it on `aaa-X.Y.x` for a patch
|
|
15
|
+
# release, on `master` otherwise.
|
|
16
|
+
#
|
|
17
|
+
# Nothing is written. The run reads the repository and prints.
|
|
18
|
+
|
|
19
|
+
on:
|
|
20
|
+
workflow_dispatch:
|
|
21
|
+
inputs:
|
|
22
|
+
version:
|
|
23
|
+
description: "Where the changelog starts, if not the RBS::VERSION of the ref (e.g. 4.1.0)"
|
|
24
|
+
required: false
|
|
25
|
+
type: string
|
|
26
|
+
format:
|
|
27
|
+
description: "The changelog template, or the JSON its sections are sorted from"
|
|
28
|
+
required: false
|
|
29
|
+
default: list
|
|
30
|
+
type: choice
|
|
31
|
+
options:
|
|
32
|
+
- list
|
|
33
|
+
- json
|
|
34
|
+
|
|
35
|
+
permissions:
|
|
36
|
+
contents: read
|
|
37
|
+
|
|
38
|
+
jobs:
|
|
39
|
+
changelog:
|
|
40
|
+
name: changelog
|
|
41
|
+
runs-on: ubuntu-latest
|
|
42
|
+
permissions:
|
|
43
|
+
contents: read # the history and the tags
|
|
44
|
+
pull-requests: read # what the commits came from
|
|
45
|
+
env:
|
|
46
|
+
# The inputs are read through the environment rather than interpolated into
|
|
47
|
+
# the script below.
|
|
48
|
+
VERSION: ${{ inputs.version }}
|
|
49
|
+
FORMAT: ${{ inputs.format }}
|
|
50
|
+
GH_TOKEN: ${{ github.token }}
|
|
51
|
+
steps:
|
|
52
|
+
# `changelog_base` resolves the previous release with `git describe`, the task
|
|
53
|
+
# walks the history back to it, and on a release branch it reads the `-x`
|
|
54
|
+
# trailers of the commits it finds -- so the full history and the tags are all
|
|
55
|
+
# needed. `fetch-depth: 0` fetches both.
|
|
56
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
57
|
+
with:
|
|
58
|
+
fetch-depth: 0
|
|
59
|
+
|
|
60
|
+
# Before the gems are installed, since a version that cannot be a version is
|
|
61
|
+
# cheapest to reject here.
|
|
62
|
+
- name: Check the input
|
|
63
|
+
run: |
|
|
64
|
+
version_pattern='^[0-9]+\.[0-9]+\.[0-9]+(\.(pre|dev)\.[0-9]+)?$'
|
|
65
|
+
if [ -n "$VERSION" ] && ! [[ "$VERSION" =~ $version_pattern ]]; then
|
|
66
|
+
echo "::error::\`$VERSION\` is not a version number."
|
|
67
|
+
exit 1
|
|
68
|
+
fi
|
|
69
|
+
|
|
70
|
+
- name: Set up Ruby
|
|
71
|
+
uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1.321.0
|
|
72
|
+
with:
|
|
73
|
+
ruby-version: ruby
|
|
74
|
+
bundler: none
|
|
75
|
+
- name: Install gems
|
|
76
|
+
run: |
|
|
77
|
+
bundle config set --local without libs:profilers
|
|
78
|
+
bundle install --jobs 4 --retry 3
|
|
79
|
+
|
|
80
|
+
# Only the changelog goes to STDOUT; the task reports what it is doing, and
|
|
81
|
+
# which pull requests it skipped, on STDERR. `tee` keeps both in the log, in
|
|
82
|
+
# order, and puts the changelog on its own where the next step can read it.
|
|
83
|
+
- name: Print the changelog
|
|
84
|
+
run: |
|
|
85
|
+
if [ "$FORMAT" = "json" ]; then
|
|
86
|
+
task="gem:changelog:json"
|
|
87
|
+
else
|
|
88
|
+
task="gem:changelog"
|
|
89
|
+
fi
|
|
90
|
+
if [ -n "$VERSION" ]; then
|
|
91
|
+
task="$task[$VERSION]"
|
|
92
|
+
fi
|
|
93
|
+
|
|
94
|
+
echo "Running \`rake $task\` on $(git rev-parse --abbrev-ref HEAD)"
|
|
95
|
+
bundle exec rake "$task" | tee changelog.out
|
|
96
|
+
|
|
97
|
+
# Uploaded before it is rendered, so that the changelog survives whatever the
|
|
98
|
+
# summary makes of it. This is also what to reach for when the JSON is long
|
|
99
|
+
# enough to be truncated in the log.
|
|
100
|
+
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
101
|
+
with:
|
|
102
|
+
name: changelog
|
|
103
|
+
path: changelog.out
|
|
104
|
+
|
|
105
|
+
# The log carries this too, but the summary renders it. A step summary is
|
|
106
|
+
# capped at 1MiB and the step fails if that is exceeded, which a long JSON
|
|
107
|
+
# could manage -- so past a comfortable fraction of it, link the artifact
|
|
108
|
+
# rather than lose the run over formatting.
|
|
109
|
+
- name: Render the changelog
|
|
110
|
+
run: |
|
|
111
|
+
if [ "$(wc -c < changelog.out)" -gt 900000 ]; then
|
|
112
|
+
echo "The changelog is too long to render here. Download the \`changelog\` artifact." \
|
|
113
|
+
>> "$GITHUB_STEP_SUMMARY"
|
|
114
|
+
exit 0
|
|
115
|
+
fi
|
|
116
|
+
|
|
117
|
+
{
|
|
118
|
+
echo '```markdown'
|
|
119
|
+
cat changelog.out
|
|
120
|
+
echo '```'
|
|
121
|
+
} >> "$GITHUB_STEP_SUMMARY"
|
|
@@ -13,8 +13,8 @@ jobs:
|
|
|
13
13
|
# env:
|
|
14
14
|
# RUBY_COMMIT: v4.0.0-preview2
|
|
15
15
|
steps:
|
|
16
|
-
- uses: actions/checkout@v7
|
|
17
|
-
- uses: ruby/setup-ruby@v1
|
|
16
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
17
|
+
- uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1.321.0
|
|
18
18
|
with:
|
|
19
19
|
ruby-version: "4.0.6"
|
|
20
20
|
bundler: none
|
|
@@ -17,7 +17,7 @@ jobs:
|
|
|
17
17
|
uses: dependabot/fetch-metadata@25dd0e34f4fe68f24cc83900b1fe3fe149efef98 # v3.1.0
|
|
18
18
|
id: metadata
|
|
19
19
|
- name: Checkout repository
|
|
20
|
-
uses: actions/checkout@v7
|
|
20
|
+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
21
21
|
with:
|
|
22
22
|
fetch-depth: 0
|
|
23
23
|
- name: Abort if blocker files are changed
|
data/.github/workflows/jruby.yml
CHANGED
|
@@ -33,13 +33,13 @@ jobs:
|
|
|
33
33
|
name: jruby
|
|
34
34
|
runs-on: ubuntu-latest
|
|
35
35
|
steps:
|
|
36
|
-
- uses: actions/checkout@v7
|
|
36
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
37
37
|
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
|
|
38
38
|
|
|
39
39
|
# Build the .wasm and fetch the Chicory jars with CRuby + the WASI SDK,
|
|
40
40
|
# then run RBS itself on JRuby against those artifacts.
|
|
41
41
|
- name: Set up Ruby (to assemble the WebAssembly runtime)
|
|
42
|
-
uses: ruby/setup-ruby@v1
|
|
42
|
+
uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1.321.0
|
|
43
43
|
with:
|
|
44
44
|
ruby-version: ruby
|
|
45
45
|
bundler: none
|
|
@@ -59,7 +59,7 @@ jobs:
|
|
|
59
59
|
run: bundle exec rake wasm:jruby_setup
|
|
60
60
|
|
|
61
61
|
- name: Set up JRuby
|
|
62
|
-
uses: ruby/setup-ruby@v1
|
|
62
|
+
uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1.321.0
|
|
63
63
|
with:
|
|
64
64
|
ruby-version: jruby
|
|
65
65
|
bundler: none
|
|
@@ -70,7 +70,7 @@ jobs:
|
|
|
70
70
|
# The gemspec takes its file list from `git ls-files`, so both gems are built
|
|
71
71
|
# from the committed state -- of the dispatched commit, since that is what is
|
|
72
72
|
# checked out. The full history is needed to tell which branches contain it.
|
|
73
|
-
- uses: actions/checkout@v7
|
|
73
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
74
74
|
with:
|
|
75
75
|
ref: ${{ inputs.commit }}
|
|
76
76
|
fetch-depth: 0
|
|
@@ -113,7 +113,7 @@ jobs:
|
|
|
113
113
|
fi
|
|
114
114
|
|
|
115
115
|
- name: Set up Ruby
|
|
116
|
-
uses: ruby/setup-ruby@v1
|
|
116
|
+
uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1.321.0
|
|
117
117
|
with:
|
|
118
118
|
ruby-version: ruby
|
|
119
119
|
bundler: none
|
|
@@ -174,7 +174,7 @@ jobs:
|
|
|
174
174
|
# from Maven during the install -- and parse something with it, so the
|
|
175
175
|
# WebAssembly runtime is exercised end to end before anything is published.
|
|
176
176
|
- name: Set up JRuby
|
|
177
|
-
uses: ruby/setup-ruby@v1
|
|
177
|
+
uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1.321.0
|
|
178
178
|
with:
|
|
179
179
|
ruby-version: jruby
|
|
180
180
|
bundler: none
|
|
@@ -190,14 +190,14 @@ jobs:
|
|
|
190
190
|
'
|
|
191
191
|
|
|
192
192
|
- name: Switch back to CRuby
|
|
193
|
-
uses: ruby/setup-ruby@v1
|
|
193
|
+
uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1.321.0
|
|
194
194
|
with:
|
|
195
195
|
ruby-version: ruby
|
|
196
196
|
bundler: none
|
|
197
197
|
|
|
198
198
|
# Uploaded before publishing, so a failed push still leaves the gems behind.
|
|
199
199
|
# This is also where a dry run ends.
|
|
200
|
-
- uses: actions/upload-artifact@v7
|
|
200
|
+
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
201
201
|
with:
|
|
202
202
|
name: gems
|
|
203
203
|
path: pkg/*.gem
|
|
@@ -218,8 +218,7 @@ jobs:
|
|
|
218
218
|
|
|
219
219
|
- name: Configure RubyGems credentials
|
|
220
220
|
if: ${{ !inputs.dry_run }}
|
|
221
|
-
|
|
222
|
-
uses: rubygems/configure-rubygems-credentials@v2.1.0
|
|
221
|
+
uses: rubygems/configure-rubygems-credentials@dc5a8d8553e6ee01fc26761a49e99e733d17954a # v2.1.0
|
|
223
222
|
|
|
224
223
|
- name: Push the gems
|
|
225
224
|
if: ${{ !inputs.dry_run }}
|
data/.github/workflows/ruby.yml
CHANGED
|
@@ -40,8 +40,8 @@ jobs:
|
|
|
40
40
|
env:
|
|
41
41
|
RANDOMIZE_STDLIB_TEST_ORDER: "true"
|
|
42
42
|
steps:
|
|
43
|
-
- uses: actions/checkout@v7
|
|
44
|
-
- uses: ruby/setup-ruby@v1
|
|
43
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
44
|
+
- uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1.321.0
|
|
45
45
|
with:
|
|
46
46
|
ruby-version: ${{ matrix.ruby }}
|
|
47
47
|
bundler: none
|
|
@@ -90,11 +90,11 @@ jobs:
|
|
|
90
90
|
matrix:
|
|
91
91
|
ruby: ['4.0', head]
|
|
92
92
|
steps:
|
|
93
|
-
- uses: actions/checkout@v7
|
|
93
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
94
94
|
- name: Install dependencies
|
|
95
95
|
run: |
|
|
96
96
|
brew install ruby-build
|
|
97
|
-
- uses: ruby/setup-ruby@v1
|
|
97
|
+
- uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1.321.0
|
|
98
98
|
with:
|
|
99
99
|
ruby-version: ${{ matrix.ruby }}
|
|
100
100
|
bundler: none
|
|
@@ -127,11 +127,11 @@ jobs:
|
|
|
127
127
|
matrix:
|
|
128
128
|
ruby: ['4.0', head]
|
|
129
129
|
steps:
|
|
130
|
-
- uses: actions/checkout@v7
|
|
130
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
131
131
|
- name: Install dependencies
|
|
132
132
|
run: |
|
|
133
133
|
brew install ruby-build
|
|
134
|
-
- uses: ruby/setup-ruby@v1
|
|
134
|
+
- uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1.321.0
|
|
135
135
|
with:
|
|
136
136
|
ruby-version: ${{ matrix.ruby }}
|
|
137
137
|
bundler: none
|
data/.github/workflows/rust.yml
CHANGED
|
@@ -26,10 +26,10 @@ jobs:
|
|
|
26
26
|
matrix:
|
|
27
27
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
28
28
|
steps:
|
|
29
|
-
- uses: actions/checkout@v7
|
|
29
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
30
30
|
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
|
|
31
31
|
- name: Set up Ruby
|
|
32
|
-
uses: ruby/setup-ruby@v1
|
|
32
|
+
uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1.321.0
|
|
33
33
|
with:
|
|
34
34
|
ruby-version: ruby
|
|
35
35
|
bundler: none
|
|
@@ -45,7 +45,7 @@ jobs:
|
|
|
45
45
|
run: |
|
|
46
46
|
rustup update --no-self-update stable
|
|
47
47
|
rustup default stable
|
|
48
|
-
- uses: actions/cache@v6
|
|
48
|
+
- uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
|
49
49
|
with:
|
|
50
50
|
path: |
|
|
51
51
|
~/.cargo/registry
|
|
@@ -64,14 +64,14 @@ jobs:
|
|
|
64
64
|
runs-on: ubuntu-latest
|
|
65
65
|
continue-on-error: true
|
|
66
66
|
steps:
|
|
67
|
-
- uses: actions/checkout@v7
|
|
67
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
68
68
|
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
|
|
69
69
|
- name: Set up git identity
|
|
70
70
|
run: |
|
|
71
71
|
git config user.name "GitHub Actions"
|
|
72
72
|
git config user.email "actions@github.com"
|
|
73
73
|
- name: Set up Ruby
|
|
74
|
-
uses: ruby/setup-ruby@v1
|
|
74
|
+
uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1.321.0
|
|
75
75
|
with:
|
|
76
76
|
ruby-version: ruby
|
|
77
77
|
bundler: none
|
|
@@ -87,7 +87,7 @@ jobs:
|
|
|
87
87
|
run: |
|
|
88
88
|
rustup update --no-self-update stable
|
|
89
89
|
rustup default stable
|
|
90
|
-
- uses: actions/cache@v6
|
|
90
|
+
- uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
|
91
91
|
with:
|
|
92
92
|
path: |
|
|
93
93
|
~/.cargo/registry
|
|
@@ -106,14 +106,14 @@ jobs:
|
|
|
106
106
|
runs-on: ubuntu-latest
|
|
107
107
|
continue-on-error: true
|
|
108
108
|
steps:
|
|
109
|
-
- uses: actions/checkout@v7
|
|
109
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
110
110
|
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
|
|
111
111
|
- name: Set up git identity
|
|
112
112
|
run: |
|
|
113
113
|
git config user.name "GitHub Actions"
|
|
114
114
|
git config user.email "actions@github.com"
|
|
115
115
|
- name: Set up Ruby
|
|
116
|
-
uses: ruby/setup-ruby@v1
|
|
116
|
+
uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1.321.0
|
|
117
117
|
with:
|
|
118
118
|
ruby-version: ruby
|
|
119
119
|
bundler: none
|
|
@@ -129,7 +129,7 @@ jobs:
|
|
|
129
129
|
run: |
|
|
130
130
|
rustup update --no-self-update stable
|
|
131
131
|
rustup default stable
|
|
132
|
-
- uses: actions/cache@v6
|
|
132
|
+
- uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
|
133
133
|
with:
|
|
134
134
|
path: |
|
|
135
135
|
~/.cargo/registry
|
|
@@ -147,10 +147,10 @@ jobs:
|
|
|
147
147
|
name: cargo:lint
|
|
148
148
|
runs-on: ubuntu-latest
|
|
149
149
|
steps:
|
|
150
|
-
- uses: actions/checkout@v7
|
|
150
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
151
151
|
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
|
|
152
152
|
- name: Set up Ruby
|
|
153
|
-
uses: ruby/setup-ruby@v1
|
|
153
|
+
uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1.321.0
|
|
154
154
|
with:
|
|
155
155
|
ruby-version: ruby
|
|
156
156
|
bundler: none
|
|
@@ -167,7 +167,7 @@ jobs:
|
|
|
167
167
|
rustup update --no-self-update stable
|
|
168
168
|
rustup default stable
|
|
169
169
|
rustup component add --toolchain stable clippy rustfmt
|
|
170
|
-
- uses: actions/cache@v6
|
|
170
|
+
- uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
|
171
171
|
with:
|
|
172
172
|
path: |
|
|
173
173
|
~/.cargo/registry
|
|
@@ -24,8 +24,8 @@ jobs:
|
|
|
24
24
|
# TruffleRuby warns and falls back to US-ASCII unless the locale is UTF-8.
|
|
25
25
|
LANG: "en_US.UTF-8"
|
|
26
26
|
steps:
|
|
27
|
-
- uses: actions/checkout@v7
|
|
28
|
-
- uses: ruby/setup-ruby@v1
|
|
27
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
28
|
+
- uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1.321.0
|
|
29
29
|
with:
|
|
30
30
|
ruby-version: ${{ matrix.ruby }}
|
|
31
31
|
bundler: none
|
|
@@ -16,8 +16,8 @@ jobs:
|
|
|
16
16
|
strategy:
|
|
17
17
|
fail-fast: false
|
|
18
18
|
steps:
|
|
19
|
-
- uses: actions/checkout@v7
|
|
20
|
-
- uses: ruby/setup-ruby@v1
|
|
19
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
20
|
+
- uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1.321.0
|
|
21
21
|
with:
|
|
22
22
|
ruby-version: "4.0"
|
|
23
23
|
bundler: none
|
data/.github/workflows/wasm.yml
CHANGED
|
@@ -28,10 +28,10 @@ jobs:
|
|
|
28
28
|
name: wasm:check
|
|
29
29
|
runs-on: ubuntu-latest
|
|
30
30
|
steps:
|
|
31
|
-
- uses: actions/checkout@v7
|
|
31
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
32
32
|
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
|
|
33
33
|
- name: Set up Ruby
|
|
34
|
-
uses: ruby/setup-ruby@v1
|
|
34
|
+
uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1.321.0
|
|
35
35
|
with:
|
|
36
36
|
ruby-version: ruby
|
|
37
37
|
bundler: none
|
|
@@ -48,7 +48,7 @@ jobs:
|
|
|
48
48
|
curl -sSL "$url" | tar xz --strip-components=1 -C "$HOME/wasi-sdk"
|
|
49
49
|
echo "WASI_SDK_PATH=$HOME/wasi-sdk" >> "$GITHUB_ENV"
|
|
50
50
|
- name: Install wasmtime
|
|
51
|
-
uses: bytecodealliance/actions/wasmtime/setup@v1
|
|
51
|
+
uses: bytecodealliance/actions/wasmtime/setup@9152e710e9f7182e4c29ad218e4f335a7b203613 # v1.1.3
|
|
52
52
|
with:
|
|
53
53
|
version: ${{ env.WASMTIME_VERSION }}
|
|
54
54
|
- name: Build and smoke-test the WebAssembly module
|
|
@@ -18,9 +18,9 @@ jobs:
|
|
|
18
18
|
matrix:
|
|
19
19
|
ruby: ['4.0', ucrt, mswin]
|
|
20
20
|
steps:
|
|
21
|
-
- uses: actions/checkout@v7
|
|
21
|
+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
|
22
22
|
- name: load ruby
|
|
23
|
-
uses: ruby/setup-ruby@v1
|
|
23
|
+
uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1.321.0
|
|
24
24
|
with:
|
|
25
25
|
ruby-version: ${{ matrix.ruby }}
|
|
26
26
|
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,62 @@
|
|
|
1
1
|
# CHANGELOG
|
|
2
2
|
|
|
3
|
+
## 4.2.0 (2026-08-23)
|
|
4
|
+
|
|
5
|
+
RBS 4.2 accepts non-ASCII characters in identifiers. Method names, instance variable names and parameter names can be written in any script, and other names may contain non-ASCII characters as long as they start with an ASCII letter, which is what tells a constant from a method name.
|
|
6
|
+
|
|
7
|
+
```rbs
|
|
8
|
+
class Greeter
|
|
9
|
+
@挨拶: String
|
|
10
|
+
|
|
11
|
+
def こんにちは: () -> String
|
|
12
|
+
end
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
The parser and the AST support Ruby-style `...` forwarding parameters in method types, but the layers built on top of the parser do not yet. The syntax is disabled by default in 4.2 and is not enabled by the public `RBS::Parser` API, so it cannot be used in regular RBS signatures yet.
|
|
16
|
+
|
|
17
|
+
Ruby 3.2 reached EOL on 2026-04-01, and this release requires Ruby 3.3 or later. Applications on 3.2 stay on the 4.1 line.
|
|
18
|
+
|
|
19
|
+
### Signature updates
|
|
20
|
+
|
|
21
|
+
**Updated classes/modules/methods:** `ERB`, `ERB::DefMethod`, `IO`, `Monitor`, `MonitorMixin::ConditionVariable`, `Singleton`, `StringIO`, `Zlib::GzipFile`, `Zlib::GzipWriter`
|
|
22
|
+
|
|
23
|
+
* Replace deterministic `untyped` return types with concrete types ([#2966](https://github.com/ruby/rbs/pull/2966))
|
|
24
|
+
* Declare Singleton::SingletonInstanceMethods ([#3037](https://github.com/ruby/rbs/pull/3037))
|
|
25
|
+
|
|
26
|
+
### Language updates
|
|
27
|
+
|
|
28
|
+
* Gate forwarding parameter syntax behind parser option ([#3087](https://github.com/ruby/rbs/pull/3087))
|
|
29
|
+
* Support non-ASCII identifiers ([#3082](https://github.com/ruby/rbs/pull/3082))
|
|
30
|
+
* Support forwarding parameters in method types ([#3042](https://github.com/ruby/rbs/pull/3042))
|
|
31
|
+
|
|
32
|
+
### Library changes
|
|
33
|
+
|
|
34
|
+
* Drop runtime support for Ruby 3.2 ([#3095](https://github.com/ruby/rbs/pull/3095))
|
|
35
|
+
* Stop the lexer reading past the end of a byte_range ([#3040](https://github.com/ruby/rbs/pull/3040))
|
|
36
|
+
* Exclude CR from comment tokens to fix an off-by-one Location#end_line on CRLF files ([#3069](https://github.com/ruby/rbs/pull/3069))
|
|
37
|
+
* Handle the NULL parser in the WebAssembly shim ([#3085](https://github.com/ruby/rbs/pull/3085))
|
|
38
|
+
* Reject a byte position the lexer cannot start on ([#3083](https://github.com/ruby/rbs/pull/3083))
|
|
39
|
+
* Don't use Clang nullability qualifiers in strict ISO C mode ([#3074](https://github.com/ruby/rbs/pull/3074))
|
|
40
|
+
* Avoid eagerly inspecting call traces in type assertions ([#3073](https://github.com/ruby/rbs/pull/3073))
|
|
41
|
+
* Fix TypeParam.rename to substitute variables in bounds and default types ([#3068](https://github.com/ruby/rbs/pull/3068))
|
|
42
|
+
* Extract per-declaration type param alignment into entry-level align_params ([#3070](https://github.com/ruby/rbs/pull/3070))
|
|
43
|
+
* Align type params across declarations in module-self types and superclass validation ([#3067](https://github.com/ruby/rbs/pull/3067))
|
|
44
|
+
* Build the wasm module with -DNDEBUG ([#3066](https://github.com/ruby/rbs/pull/3066))
|
|
45
|
+
* Rename NODISCARD macro to RBS_NODISCARD ([#3065](https://github.com/ruby/rbs/pull/3065))
|
|
46
|
+
|
|
47
|
+
### Miscellaneous
|
|
48
|
+
|
|
49
|
+
* Omit forwarding parameter tests on JRuby ([#3092](https://github.com/ruby/rbs/pull/3092))
|
|
50
|
+
* Skip JSON 2-only tests with JSON 3 ([#3084](https://github.com/ruby/rbs/pull/3084))
|
|
51
|
+
* Pin GitHub Actions to commit hashes ([#3020](https://github.com/ruby/rbs/pull/3020))
|
|
52
|
+
|
|
53
|
+
## 4.1.3 (2026-08-10)
|
|
54
|
+
|
|
55
|
+
### Miscellaneous
|
|
56
|
+
|
|
57
|
+
* Don't use Clang nullability qualifiers in strict ISO C mode ([#3074](https://github.com/ruby/rbs/pull/3074), Backported in [#3075](https://github.com/ruby/rbs/pull/3075))
|
|
58
|
+
* Avoid eagerly inspecting call traces in type assertions ([#3073](https://github.com/ruby/rbs/pull/3073), Backported in [#3076](https://github.com/ruby/rbs/pull/3076))
|
|
59
|
+
|
|
3
60
|
## 4.1.2 (2026-08-03)
|
|
4
61
|
|
|
5
62
|
### Miscellaneous
|