rbs 4.0.0.dev.4 → 4.0.0.dev.5

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.
Files changed (223) hide show
  1. checksums.yaml +4 -4
  2. data/.github/dependabot.yml +14 -14
  3. data/.github/workflows/bundle-update.yml +60 -0
  4. data/.github/workflows/c-check.yml +11 -8
  5. data/.github/workflows/comments.yml +3 -3
  6. data/.github/workflows/dependabot.yml +1 -1
  7. data/.github/workflows/ruby.yml +17 -34
  8. data/.github/workflows/typecheck.yml +2 -2
  9. data/.github/workflows/valgrind.yml +42 -0
  10. data/.github/workflows/windows.yml +2 -2
  11. data/.rubocop.yml +1 -1
  12. data/README.md +1 -1
  13. data/Rakefile +32 -5
  14. data/config.yml +46 -0
  15. data/core/array.rbs +96 -46
  16. data/core/binding.rbs +0 -2
  17. data/core/builtin.rbs +2 -2
  18. data/core/comparable.rbs +13 -6
  19. data/core/complex.rbs +55 -41
  20. data/core/dir.rbs +4 -4
  21. data/core/encoding.rbs +7 -10
  22. data/core/enumerable.rbs +90 -3
  23. data/core/enumerator/arithmetic_sequence.rbs +70 -0
  24. data/core/enumerator.rbs +63 -1
  25. data/core/errno.rbs +8 -0
  26. data/core/errors.rbs +28 -1
  27. data/core/exception.rbs +2 -2
  28. data/core/fiber.rbs +40 -20
  29. data/core/file.rbs +108 -78
  30. data/core/file_test.rbs +1 -1
  31. data/core/float.rbs +225 -69
  32. data/core/gc.rbs +417 -281
  33. data/core/hash.rbs +1023 -727
  34. data/core/integer.rbs +104 -110
  35. data/core/io/buffer.rbs +21 -10
  36. data/core/io/wait.rbs +11 -33
  37. data/core/io.rbs +82 -19
  38. data/core/kernel.rbs +70 -59
  39. data/core/marshal.rbs +1 -1
  40. data/core/match_data.rbs +1 -1
  41. data/core/math.rbs +42 -3
  42. data/core/method.rbs +63 -27
  43. data/core/module.rbs +103 -26
  44. data/core/nil_class.rbs +3 -3
  45. data/core/numeric.rbs +43 -35
  46. data/core/object.rbs +3 -3
  47. data/core/object_space.rbs +21 -15
  48. data/core/pathname.rbs +1272 -0
  49. data/core/proc.rbs +30 -25
  50. data/core/process.rbs +4 -2
  51. data/core/ractor.rbs +361 -509
  52. data/core/random.rbs +17 -0
  53. data/core/range.rbs +113 -16
  54. data/core/rational.rbs +56 -85
  55. data/core/rbs/unnamed/argf.rbs +2 -2
  56. data/core/rbs/unnamed/env_class.rbs +1 -1
  57. data/core/rbs/unnamed/random.rbs +4 -113
  58. data/core/regexp.rbs +25 -20
  59. data/core/ruby.rbs +53 -0
  60. data/core/ruby_vm.rbs +6 -4
  61. data/core/rubygems/errors.rbs +3 -70
  62. data/core/rubygems/rubygems.rbs +11 -79
  63. data/core/rubygems/version.rbs +2 -3
  64. data/core/set.rbs +488 -359
  65. data/core/signal.rbs +24 -14
  66. data/core/string.rbs +3171 -1241
  67. data/core/struct.rbs +1 -1
  68. data/core/symbol.rbs +17 -11
  69. data/core/thread.rbs +95 -33
  70. data/core/time.rbs +35 -9
  71. data/core/trace_point.rbs +7 -4
  72. data/core/unbound_method.rbs +14 -6
  73. data/docs/aliases.md +79 -0
  74. data/docs/collection.md +2 -2
  75. data/docs/encoding.md +56 -0
  76. data/docs/gem.md +0 -1
  77. data/docs/inline.md +470 -0
  78. data/docs/sigs.md +3 -3
  79. data/docs/syntax.md +33 -4
  80. data/docs/type_fingerprint.md +21 -0
  81. data/exe/rbs +1 -1
  82. data/ext/rbs_extension/ast_translation.c +77 -3
  83. data/ext/rbs_extension/ast_translation.h +3 -0
  84. data/ext/rbs_extension/class_constants.c +8 -2
  85. data/ext/rbs_extension/class_constants.h +4 -0
  86. data/ext/rbs_extension/extconf.rb +5 -1
  87. data/ext/rbs_extension/legacy_location.c +5 -5
  88. data/ext/rbs_extension/main.c +37 -20
  89. data/include/rbs/ast.h +85 -38
  90. data/include/rbs/defines.h +27 -0
  91. data/include/rbs/lexer.h +30 -11
  92. data/include/rbs/parser.h +6 -6
  93. data/include/rbs/string.h +0 -2
  94. data/include/rbs/util/rbs_allocator.h +34 -13
  95. data/include/rbs/util/rbs_assert.h +12 -1
  96. data/include/rbs/util/rbs_encoding.h +2 -0
  97. data/include/rbs/util/rbs_unescape.h +2 -1
  98. data/lib/rbs/ast/annotation.rb +1 -1
  99. data/lib/rbs/ast/comment.rb +1 -1
  100. data/lib/rbs/ast/declarations.rb +10 -10
  101. data/lib/rbs/ast/members.rb +14 -14
  102. data/lib/rbs/ast/ruby/annotations.rb +137 -0
  103. data/lib/rbs/ast/ruby/comment_block.rb +24 -0
  104. data/lib/rbs/ast/ruby/declarations.rb +198 -3
  105. data/lib/rbs/ast/ruby/helpers/constant_helper.rb +4 -0
  106. data/lib/rbs/ast/ruby/members.rb +159 -1
  107. data/lib/rbs/ast/type_param.rb +24 -4
  108. data/lib/rbs/buffer.rb +20 -15
  109. data/lib/rbs/cli/diff.rb +16 -15
  110. data/lib/rbs/cli/validate.rb +38 -51
  111. data/lib/rbs/cli.rb +52 -19
  112. data/lib/rbs/collection/config/lockfile_generator.rb +8 -0
  113. data/lib/rbs/collection/sources/git.rb +1 -0
  114. data/lib/rbs/definition.rb +1 -1
  115. data/lib/rbs/definition_builder/ancestor_builder.rb +62 -9
  116. data/lib/rbs/definition_builder/method_builder.rb +20 -0
  117. data/lib/rbs/definition_builder.rb +91 -2
  118. data/lib/rbs/diff.rb +7 -1
  119. data/lib/rbs/environment.rb +227 -74
  120. data/lib/rbs/environment_loader.rb +0 -6
  121. data/lib/rbs/errors.rb +27 -7
  122. data/lib/rbs/inline_parser.rb +341 -5
  123. data/lib/rbs/location_aux.rb +1 -1
  124. data/lib/rbs/locator.rb +5 -1
  125. data/lib/rbs/method_type.rb +5 -3
  126. data/lib/rbs/parser_aux.rb +2 -2
  127. data/lib/rbs/prototype/rb.rb +2 -2
  128. data/lib/rbs/prototype/rbi.rb +2 -0
  129. data/lib/rbs/prototype/runtime.rb +8 -0
  130. data/lib/rbs/resolver/constant_resolver.rb +2 -2
  131. data/lib/rbs/resolver/type_name_resolver.rb +116 -38
  132. data/lib/rbs/subtractor.rb +3 -1
  133. data/lib/rbs/test/type_check.rb +16 -2
  134. data/lib/rbs/type_name.rb +1 -1
  135. data/lib/rbs/types.rb +27 -27
  136. data/lib/rbs/validator.rb +2 -2
  137. data/lib/rbs/version.rb +1 -1
  138. data/lib/rbs.rb +1 -1
  139. data/lib/rdoc/discover.rb +1 -1
  140. data/lib/rdoc_plugin/parser.rb +1 -1
  141. data/rbs.gemspec +3 -2
  142. data/schema/typeParam.json +17 -1
  143. data/sig/ast/ruby/annotations.rbs +124 -0
  144. data/sig/ast/ruby/comment_block.rbs +8 -0
  145. data/sig/ast/ruby/declarations.rbs +102 -4
  146. data/sig/ast/ruby/members.rbs +87 -1
  147. data/sig/cli/diff.rbs +5 -11
  148. data/sig/cli/validate.rbs +13 -4
  149. data/sig/cli.rbs +18 -18
  150. data/sig/definition.rbs +6 -1
  151. data/sig/environment.rbs +70 -12
  152. data/sig/errors.rbs +13 -6
  153. data/sig/inline_parser.rbs +39 -2
  154. data/sig/locator.rbs +0 -2
  155. data/sig/manifest.yaml +0 -1
  156. data/sig/method_builder.rbs +3 -1
  157. data/sig/method_types.rbs +1 -1
  158. data/sig/parser.rbs +16 -2
  159. data/sig/resolver/type_name_resolver.rbs +35 -7
  160. data/sig/source.rbs +3 -3
  161. data/sig/type_param.rbs +13 -8
  162. data/sig/types.rbs +4 -4
  163. data/src/ast.c +80 -1
  164. data/src/lexer.c +1392 -1313
  165. data/src/lexer.re +3 -0
  166. data/src/lexstate.c +58 -37
  167. data/src/location.c +4 -4
  168. data/src/parser.c +412 -145
  169. data/src/string.c +0 -48
  170. data/src/util/rbs_allocator.c +89 -71
  171. data/src/util/rbs_assert.c +1 -1
  172. data/src/util/rbs_buffer.c +2 -2
  173. data/src/util/rbs_constant_pool.c +10 -10
  174. data/src/util/rbs_encoding.c +4 -8
  175. data/src/util/rbs_unescape.c +56 -20
  176. data/stdlib/bigdecimal/0/big_decimal.rbs +100 -82
  177. data/stdlib/bigdecimal-math/0/big_math.rbs +169 -8
  178. data/stdlib/cgi/0/core.rbs +9 -393
  179. data/stdlib/cgi/0/manifest.yaml +1 -0
  180. data/stdlib/cgi-escape/0/escape.rbs +171 -0
  181. data/stdlib/coverage/0/coverage.rbs +3 -1
  182. data/stdlib/date/0/date.rbs +67 -59
  183. data/stdlib/date/0/date_time.rbs +1 -1
  184. data/stdlib/delegate/0/delegator.rbs +10 -7
  185. data/stdlib/digest/0/digest.rbs +110 -0
  186. data/stdlib/erb/0/erb.rbs +737 -347
  187. data/stdlib/fileutils/0/fileutils.rbs +20 -14
  188. data/stdlib/forwardable/0/forwardable.rbs +3 -0
  189. data/stdlib/json/0/json.rbs +82 -28
  190. data/stdlib/net-http/0/net-http.rbs +3 -0
  191. data/stdlib/objspace/0/objspace.rbs +9 -27
  192. data/stdlib/open-uri/0/open-uri.rbs +40 -0
  193. data/stdlib/open3/0/open3.rbs +459 -1
  194. data/stdlib/openssl/0/openssl.rbs +331 -228
  195. data/stdlib/optparse/0/optparse.rbs +8 -3
  196. data/stdlib/pathname/0/pathname.rbs +9 -1379
  197. data/stdlib/psych/0/psych.rbs +4 -4
  198. data/stdlib/random-formatter/0/random-formatter.rbs +277 -0
  199. data/stdlib/rdoc/0/code_object.rbs +2 -1
  200. data/stdlib/rdoc/0/parser.rbs +1 -1
  201. data/stdlib/rdoc/0/rdoc.rbs +1 -1
  202. data/stdlib/rdoc/0/store.rbs +1 -1
  203. data/stdlib/resolv/0/resolv.rbs +25 -68
  204. data/stdlib/ripper/0/ripper.rbs +2 -2
  205. data/stdlib/securerandom/0/manifest.yaml +2 -0
  206. data/stdlib/securerandom/0/securerandom.rbs +6 -19
  207. data/stdlib/singleton/0/singleton.rbs +3 -0
  208. data/stdlib/socket/0/socket.rbs +13 -1
  209. data/stdlib/socket/0/tcp_socket.rbs +10 -2
  210. data/stdlib/stringio/0/stringio.rbs +1176 -85
  211. data/stdlib/strscan/0/string_scanner.rbs +31 -31
  212. data/stdlib/tempfile/0/tempfile.rbs +3 -3
  213. data/stdlib/time/0/time.rbs +1 -1
  214. data/stdlib/timeout/0/timeout.rbs +63 -7
  215. data/stdlib/tsort/0/cyclic.rbs +3 -0
  216. data/stdlib/uri/0/common.rbs +16 -2
  217. data/stdlib/uri/0/file.rbs +1 -1
  218. data/stdlib/uri/0/generic.rbs +24 -16
  219. data/stdlib/uri/0/rfc2396_parser.rbs +6 -7
  220. data/stdlib/zlib/0/gzip_reader.rbs +2 -2
  221. data/stdlib/zlib/0/gzip_writer.rbs +1 -1
  222. data/stdlib/zlib/0/zstream.rbs +1 -0
  223. metadata +30 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2d6c17a1d8371e7d529d224fcf5654f338e078e576275c214754573bb852a3f1
4
- data.tar.gz: 181a52dc722b34752019e38fcbf1b7b001cbdc3fd0ff3ceadeeefeb2813a5a5d
3
+ metadata.gz: 803c356414679e6271a26f25094f449ae5cbf684047ea6d5ea3f973382b34a7e
4
+ data.tar.gz: 5ee41851402e87dc52910143a0babfed109abd6518b89083d39ee6b88e266078
5
5
  SHA512:
6
- metadata.gz: bee9898c24cd2cfe577fd693a60daa364c0769f815f684170e123fa7f2dc7932799fbf9b99aba19e83a17d373c8eedf5007e3934338b1ecd052a85c2f7ad986b
7
- data.tar.gz: 5cd52e73fbbd3680d049a3c116da321d6e98825121216d33cd365737bd5405e1bb32dd3f3d33842a7a5db7ca9442c27a107682430cbafbce78dbfc0dc24be06e
6
+ metadata.gz: e6feb377cf58019cdadc53a5fad61a365d87c197f871d889d70efd4427db9ba6f433648c9c7684eba85f0f74a15f59a8cb0aef91cdfe5478b8d685547545a787
7
+ data.tar.gz: 7e5f1555240f1e2f96696aa73b11b12643c020c4ae705d20d84524814c1c5da7245fac88a10636f6a3bcf0488343d3a82b2dd8e7623447d0e9ef8c1618e77b84
@@ -1,20 +1,20 @@
1
1
  version: 2
2
2
  updates:
3
- - package-ecosystem: bundler
4
- directory: "/"
5
- schedule:
6
- interval: daily
7
- open-pull-requests-limit: 3
8
- allow:
9
- - dependency-type: all
3
+ # - package-ecosystem: bundler
4
+ # directory: "/"
5
+ # schedule:
6
+ # interval: daily
7
+ # open-pull-requests-limit: 3
8
+ # allow:
9
+ # - dependency-type: all
10
10
 
11
- - package-ecosystem: bundler
12
- directory: "/steep"
13
- schedule:
14
- interval: daily
15
- open-pull-requests-limit: 3
16
- allow:
17
- - dependency-type: all
11
+ # - package-ecosystem: bundler
12
+ # directory: "/steep"
13
+ # schedule:
14
+ # interval: daily
15
+ # open-pull-requests-limit: 3
16
+ # allow:
17
+ # - dependency-type: all
18
18
 
19
19
  - package-ecosystem: 'github-actions'
20
20
  directory: '/'
@@ -0,0 +1,60 @@
1
+ name: Scheduled Bundle Update PR
2
+
3
+ on:
4
+ schedule:
5
+ - cron: '0 0 * * 2'
6
+ workflow_dispatch:
7
+
8
+ jobs:
9
+ bundle-update:
10
+ runs-on: ubuntu-latest
11
+
12
+ steps:
13
+ - name: Checkout repository
14
+ uses: actions/checkout@v6
15
+
16
+ - name: Set up Ruby
17
+ uses: ruby/setup-ruby@v1
18
+ with:
19
+ ruby-version: '4.0'
20
+
21
+ - name: Set up git
22
+ run: |
23
+ git config --global user.name "github-actions[bot]"
24
+ git config --global user.email "github-actions[bot]@users.noreply.github.com"
25
+
26
+ - name: Switch branch
27
+ run: |
28
+ git switch -c bundle-update-$(date +'%Y%m%d')-$(uuidgen | cut -c1-8)
29
+
30
+ - name: Install bundler
31
+ run: gem install bundler
32
+
33
+ - name: Run bundle update
34
+ run: |
35
+ bundle lock --update
36
+ bundle lock --update --gemfile=steep/Gemfile
37
+ git add Gemfile.lock steep/Gemfile.lock
38
+
39
+ if git diff --cached --exit-code; then
40
+ echo "No changes to commit, exiting."
41
+ exit 0
42
+ fi
43
+
44
+ git commit -m "bundle update"
45
+ echo "has_update=true" >> $GITHUB_ENV
46
+
47
+ - name: Push branch
48
+ if: env.has_update == 'true'
49
+ run: git push origin HEAD
50
+
51
+ - name: Create Pull Request
52
+ if: env.has_update == 'true'
53
+ env:
54
+ GH_TOKEN: ${{ secrets.DEPENDABOT_MERGE_GH_TOKEN }}
55
+ run: |
56
+ gh pr create \
57
+ --title "bundle update ($(date +'%Y-%m-%d'))" \
58
+ --body "Automated weekly bundle update" \
59
+ --head "$(git rev-parse --abbrev-ref HEAD)" \
60
+ --base "${{ github.event.repository.default_branch }}"
@@ -9,10 +9,10 @@ jobs:
9
9
  format-check:
10
10
  runs-on: ubuntu-latest
11
11
  steps:
12
- - uses: actions/checkout@v4
12
+ - uses: actions/checkout@v6
13
13
  - uses: ruby/setup-ruby@v1
14
14
  with:
15
- ruby-version: "3.4"
15
+ ruby-version: "4.0"
16
16
  bundler-cache: none
17
17
  - name: Set working directory as safe
18
18
  run: git config --global --add safe.directory $(pwd)
@@ -23,19 +23,22 @@ jobs:
23
23
  - name: Install clang-format from LLVM
24
24
  run: |
25
25
  wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
26
- sudo apt-add-repository "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy main"
26
+ sudo apt-add-repository "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-20 main"
27
27
  sudo apt-get update
28
- sudo apt-get install -y clang-format
28
+ sudo apt-get install -y clang-format-20
29
+ sudo ln -sf /usr/bin/clang-format-20 /usr/local/bin/clang-format
29
30
  clang-format --version
31
+ - name: Count processors
32
+ run: nproc
30
33
  - name: Install Re2c
31
34
  run: |
32
35
  cd /tmp
33
- curl -L https://github.com/skvadrik/re2c/archive/refs/tags/3.1.tar.gz > re2c-3.1.tar.gz
34
- tar xf re2c-3.1.tar.gz
35
- cd re2c-3.1
36
+ curl -L https://github.com/skvadrik/re2c/archive/refs/tags/4.3.tar.gz > re2c-4.3.tar.gz
37
+ tar xf re2c-4.3.tar.gz
38
+ cd re2c-4.3
36
39
  autoreconf -i -W all
37
40
  ./configure
38
- make
41
+ make -j"$(nproc)" -l"$(nproc)"
39
42
  sudo make install
40
43
  - name: Update rubygems & bundler
41
44
  run: |
@@ -11,12 +11,12 @@ jobs:
11
11
  comments:
12
12
  runs-on: "ubuntu-latest"
13
13
  # env:
14
- # RUBY_COMMIT: 1b0c46daed9186b82ab4fef1a4ab225afe582ee6
14
+ # RUBY_COMMIT: v4.0.0-preview2
15
15
  steps:
16
- - uses: actions/checkout@v4
16
+ - uses: actions/checkout@v6
17
17
  - uses: ruby/setup-ruby@v1
18
18
  with:
19
- ruby-version: "3.4.1"
19
+ ruby-version: "4.0.0"
20
20
  bundler: none
21
21
  - name: Install dependencies
22
22
  run: |
@@ -17,7 +17,7 @@ jobs:
17
17
  uses: dependabot/fetch-metadata@08eff52bf64351f401fb50d4972fa95b9f2c2d1b # v2.4.0
18
18
  id: metadata
19
19
  - name: Checkout repository
20
- uses: actions/checkout@v4
20
+ uses: actions/checkout@v6
21
21
  with:
22
22
  fetch-depth: 0
23
23
  - name: Abort if blocker files are changed
@@ -13,29 +13,29 @@ jobs:
13
13
  strategy:
14
14
  fail-fast: false
15
15
  matrix:
16
- ruby: ['3.1', '3.2', '3.3', '3.4', head]
16
+ ruby: ['3.2', '3.3', '3.4', '4.0', head]
17
17
  rubyopt: [""]
18
18
  job:
19
19
  - test
20
20
  include:
21
21
  - ruby: head
22
22
  job: stdlib_test rubocop
23
- - ruby: "3.4"
23
+ - ruby: "4.0"
24
24
  job: stdlib_test
25
- - ruby: "3.4"
25
+ - ruby: "4.0"
26
26
  job: test
27
27
  rubyopt: "--enable-frozen-string-literal"
28
- - ruby: "3.4"
28
+ - ruby: "4.0"
29
29
  job: stdlib_test
30
30
  rubyopt: "--enable-frozen-string-literal"
31
- - ruby: "3.4"
31
+ - ruby: "4.0"
32
32
  job: rubocop validate test_doc build test_generate_stdlib raap
33
- - ruby: "3.4"
33
+ - ruby: "4.0"
34
34
  job: typecheck_test
35
35
  env:
36
36
  RANDOMIZE_STDLIB_TEST_ORDER: "true"
37
37
  steps:
38
- - uses: actions/checkout@v4
38
+ - uses: actions/checkout@v6
39
39
  - uses: ruby/setup-ruby@v1
40
40
  with:
41
41
  ruby-version: ${{ matrix.ruby }}
@@ -55,6 +55,10 @@ jobs:
55
55
  echo "NO_MINITEST=true" >> $GITHUB_ENV
56
56
  bundle config set --local without 'minitest'
57
57
  if: ${{ contains(matrix.ruby, 'head') }}
58
+ - name: bundle config set force_ruby_platform true if head
59
+ if: ${{ contains(matrix.ruby, 'head') }}
60
+ run: |
61
+ bundle config set force_ruby_platform true
58
62
  - name: Skip installing type checkers
59
63
  if: ${{ ! contains(matrix.job, 'typecheck_test') }}
60
64
  run: |
@@ -65,38 +69,14 @@ jobs:
65
69
  - name: Run test
66
70
  run: |
67
71
  bundle exec rake ${{ matrix.job }}
68
- valgrind:
69
- runs-on: ubuntu-latest
70
- steps:
71
- - uses: actions/checkout@v4
72
- - uses: ruby/setup-ruby@v1
73
- with:
74
- ruby-version: "3.4"
75
- bundler-cache: none
76
- - name: Set working directory as safe
77
- run: git config --global --add safe.directory $(pwd)
78
- - name: Install dependencies
79
- run: |
80
- sudo apt-get update
81
- sudo apt-get install -y libdb-dev curl autoconf automake m4 libtool python3 valgrind
82
- - name: Update rubygems & bundler
83
- run: |
84
- ruby -v
85
- gem update --system
86
- - name: bin/setup
87
- run: |
88
- bin/setup
89
- - run: bundle exec rake test:valgrind
90
- env:
91
- RUBY_FREE_AT_EXIT: 1
92
72
  C99_compile:
93
73
  runs-on: macos-latest
94
74
  strategy:
95
75
  fail-fast: false
96
76
  matrix:
97
- ruby: ['3.4', head]
77
+ ruby: ['4.0', head]
98
78
  steps:
99
- - uses: actions/checkout@v4
79
+ - uses: actions/checkout@v6
100
80
  - name: Install dependencies
101
81
  run: |
102
82
  brew install ruby-build
@@ -112,8 +92,11 @@ jobs:
112
92
  gem update --system
113
93
  - name: clang version
114
94
  run: clang --version
95
+ - name: bundle config set force_ruby_platform true if head
96
+ if: ${{ contains(matrix.ruby, 'head') }}
97
+ run: |
98
+ bundle config set force_ruby_platform true
115
99
  - name: bin/setup
116
100
  run: |
117
101
  bin/setup
118
102
  - run: bundle exec rake clean compile_c99
119
-
@@ -13,10 +13,10 @@ jobs:
13
13
  strategy:
14
14
  fail-fast: false
15
15
  steps:
16
- - uses: actions/checkout@v4
16
+ - uses: actions/checkout@v6
17
17
  - uses: ruby/setup-ruby@v1
18
18
  with:
19
- ruby-version: "3.3"
19
+ ruby-version: "3.4"
20
20
  bundler: none
21
21
  - name: Set working directory as safe
22
22
  run: git config --global --add safe.directory $(pwd)
@@ -0,0 +1,42 @@
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
@@ -13,9 +13,9 @@ jobs:
13
13
  strategy:
14
14
  fail-fast: false
15
15
  matrix:
16
- ruby: ['3.2', '3.3', ucrt, mswin]
16
+ ruby: ['3.4', ucrt, mswin]
17
17
  steps:
18
- - uses: actions/checkout@v4
18
+ - uses: actions/checkout@v6
19
19
  - name: load ruby
20
20
  uses: ruby/setup-ruby@v1
21
21
  with:
data/.rubocop.yml CHANGED
@@ -3,7 +3,7 @@ plugins:
3
3
  - rubocop-on-rbs
4
4
 
5
5
  AllCops:
6
- TargetRubyVersion: 3.1
6
+ TargetRubyVersion: 3.4
7
7
  DisabledByDefault: true
8
8
  Exclude:
9
9
  - 'vendor/bundle/**/*'
data/README.md CHANGED
@@ -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: "pathname") # Load pathname library
144
+ # loader.add(library: "logger") # Load logger library
145
145
 
146
146
  environment = RBS::Environment.from_loader(loader).resolve_type_names
147
147
 
data/Rakefile CHANGED
@@ -25,6 +25,12 @@ test_config = lambda do |t|
25
25
  t.test_files = FileList["test/**/*_test.rb"].reject do |path|
26
26
  path =~ %r{test/stdlib/}
27
27
  end
28
+ if defined?(RubyMemcheck)
29
+ if t.is_a?(RubyMemcheck::TestTask)
30
+ t.verbose = true
31
+ t.options = '-v'
32
+ end
33
+ end
28
34
  end
29
35
 
30
36
  Rake::TestTask.new(test: :compile, &test_config)
@@ -206,7 +212,14 @@ task :validate => :compile do
206
212
  end
207
213
 
208
214
  libs.each do |lib|
209
- sh "#{ruby} #{rbs} -r #{lib} validate --exit-error-on-syntax-error"
215
+ args = ["-r", lib]
216
+
217
+ if lib == "rbs"
218
+ args << "-r"
219
+ args << "prism"
220
+ end
221
+
222
+ sh "#{ruby} #{rbs} #{args.join(' ')} validate --exit-error-on-syntax-error"
210
223
  end
211
224
  end
212
225
 
@@ -218,7 +231,7 @@ end
218
231
 
219
232
  task :stdlib_test => :compile do
220
233
  test_files = FileList["test/stdlib/**/*_test.rb"].reject do |path|
221
- path =~ %r{Ractor} || path =~ %r{Encoding} || path =~ %r{CGI_test}
234
+ path =~ %r{Ractor} || path =~ %r{Encoding} || path =~ %r{CGI-escape_test}
222
235
  end
223
236
 
224
237
  if ENV["RANDOMIZE_STDLIB_TEST_ORDER"] == "true"
@@ -227,7 +240,7 @@ task :stdlib_test => :compile do
227
240
 
228
241
  sh "#{ruby} -Ilib #{bin}/test_runner.rb #{test_files.join(' ')}"
229
242
  # TODO: Ractor tests need to be run in a separate process
230
- sh "#{ruby} -Ilib #{bin}/test_runner.rb test/stdlib/CGI_test.rb"
243
+ sh "#{ruby} -Ilib #{bin}/test_runner.rb test/stdlib/CGI-escape_test.rb"
231
244
  sh "#{ruby} -Ilib #{bin}/test_runner.rb test/stdlib/Ractor_test.rb"
232
245
  sh "#{ruby} -Ilib #{bin}/test_runner.rb test/stdlib/Encoding_test.rb"
233
246
  end
@@ -325,7 +338,7 @@ namespace :generate do
325
338
  class <%= target %>SingletonTest < Test::Unit::TestCase
326
339
  include TestHelper
327
340
 
328
- # library "pathname", "securerandom" # Declare library signatures to load
341
+ # library "logger", "securerandom" # Declare library signatures to load
329
342
  testing "singleton(::<%= target %>)"
330
343
 
331
344
  <%- class_methods.each do |method_name, definition| -%>
@@ -344,7 +357,7 @@ namespace :generate do
344
357
  class <%= target %>Test < Test::Unit::TestCase
345
358
  include TestHelper
346
359
 
347
- # library "pathname", "securerandom" # Declare library signatures to load
360
+ # library "logger", "securerandom" # Declare library signatures to load
348
361
  testing "::<%= target %>"
349
362
 
350
363
  <%- instance_methods.each do |method_name, definition| -%>
@@ -535,3 +548,17 @@ task :compile_c99 do
535
548
  ensure
536
549
  ENV.delete("TEST_NO_C23")
537
550
  end
551
+
552
+ task :prepare_bench do
553
+ ENV.delete("DEBUG")
554
+ Rake::Task[:"clobber"].invoke
555
+ Rake::Task[:"templates"].invoke
556
+ Rake::Task[:"compile"].invoke
557
+ end
558
+
559
+ task :prepare_profiling do
560
+ ENV["DEBUG"] = "1"
561
+ Rake::Task[:"clobber"].invoke
562
+ Rake::Task[:"templates"].invoke
563
+ Rake::Task[:"compile"].invoke
564
+ end
data/config.yml CHANGED
@@ -279,6 +279,8 @@ nodes:
279
279
  c_type: rbs_keyword
280
280
  - name: upper_bound
281
281
  c_type: rbs_node
282
+ - name: lower_bound
283
+ c_type: rbs_node
282
284
  - name: default_type
283
285
  c_type: rbs_node
284
286
  - name: unchecked
@@ -485,3 +487,47 @@ nodes:
485
487
  c_type: rbs_node
486
488
  - name: comment_location
487
489
  c_type: rbs_location
490
+ - name: RBS::AST::Ruby::Annotations::TypeApplicationAnnotation
491
+ fields:
492
+ - name: prefix_location
493
+ c_type: rbs_location
494
+ - name: type_args
495
+ c_type: rbs_node_list
496
+ - name: close_bracket_location
497
+ c_type: rbs_location
498
+ - name: comma_locations
499
+ c_type: rbs_location_list
500
+ - name: RBS::AST::Ruby::Annotations::InstanceVariableAnnotation
501
+ fields:
502
+ - name: prefix_location
503
+ c_type: rbs_location
504
+ - name: ivar_name
505
+ c_type: rbs_ast_symbol
506
+ - name: ivar_name_location
507
+ c_type: rbs_location
508
+ - name: colon_location
509
+ c_type: rbs_location
510
+ - name: type
511
+ c_type: rbs_node
512
+ - name: comment_location
513
+ c_type: rbs_location
514
+ - name: RBS::AST::Ruby::Annotations::ClassAliasAnnotation
515
+ fields:
516
+ - name: prefix_location
517
+ c_type: rbs_location
518
+ - name: keyword_location
519
+ c_type: rbs_location
520
+ - name: type_name
521
+ c_type: rbs_type_name
522
+ - name: type_name_location
523
+ c_type: rbs_location
524
+ - name: RBS::AST::Ruby::Annotations::ModuleAliasAnnotation
525
+ fields:
526
+ - name: prefix_location
527
+ c_type: rbs_location
528
+ - name: keyword_location
529
+ c_type: rbs_location
530
+ - name: type_name
531
+ c_type: rbs_type_name
532
+ - name: type_name_location
533
+ c_type: rbs_location