rbs 3.2.2 → 3.3.0.pre.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (134) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/comments.yml +1 -1
  3. data/.github/workflows/ruby.yml +7 -2
  4. data/.rubocop.yml +1 -1
  5. data/CHANGELOG.md +105 -0
  6. data/Gemfile +3 -0
  7. data/Gemfile.lock +20 -14
  8. data/README.md +11 -2
  9. data/Rakefile +10 -7
  10. data/Steepfile +7 -7
  11. data/core/basic_object.rbs +7 -7
  12. data/core/binding.rbs +3 -3
  13. data/core/builtin.rbs +171 -5
  14. data/core/constants.rbs +17 -17
  15. data/core/dir.rbs +3 -3
  16. data/core/encoding.rbs +434 -628
  17. data/core/enumerator.rbs +37 -0
  18. data/core/exception.rbs +11 -11
  19. data/core/false_class.rbs +5 -11
  20. data/core/fiber.rbs +3 -3
  21. data/core/file_test.rbs +28 -26
  22. data/core/kernel.rbs +900 -21
  23. data/core/marshal.rbs +24 -14
  24. data/core/match_data.rbs +8 -8
  25. data/core/math.rbs +57 -53
  26. data/core/method.rbs +3 -1
  27. data/core/module.rbs +38 -36
  28. data/core/nil_class.rbs +7 -13
  29. data/core/object.rbs +3 -966
  30. data/core/process.rbs +3 -3
  31. data/core/ractor.rbs +2 -2
  32. data/core/rb_config.rbs +64 -43
  33. data/core/regexp.rbs +3 -3
  34. data/core/set.rbs +3 -2
  35. data/core/signal.rbs +10 -4
  36. data/core/struct.rbs +1 -1
  37. data/core/thread.rbs +7 -7
  38. data/core/thread_group.rbs +9 -9
  39. data/core/true_class.rbs +5 -11
  40. data/core/unbound_method.rbs +56 -7
  41. data/core/warning.rbs +33 -0
  42. data/docs/collection.md +56 -6
  43. data/docs/data_and_struct.md +57 -0
  44. data/docs/stdlib.md +61 -2
  45. data/docs/syntax.md +123 -2
  46. data/ext/rbs_extension/lexer.c +624 -569
  47. data/ext/rbs_extension/lexer.h +1 -0
  48. data/ext/rbs_extension/lexer.re +1 -0
  49. data/ext/rbs_extension/lexstate.c +1 -0
  50. data/ext/rbs_extension/parser.c +6 -0
  51. data/goodcheck.yml +2 -2
  52. data/lib/rbs/annotate/formatter.rb +13 -3
  53. data/lib/rbs/annotate/rdoc_source.rb +10 -1
  54. data/lib/rbs/cli/colored_io.rb +48 -0
  55. data/lib/rbs/cli/diff.rb +80 -0
  56. data/lib/rbs/cli.rb +165 -17
  57. data/lib/rbs/collection/config/lockfile.rb +0 -25
  58. data/lib/rbs/collection/config/lockfile_generator.rb +0 -6
  59. data/lib/rbs/collection/installer.rb +1 -1
  60. data/lib/rbs/collection/sources/git.rb +6 -4
  61. data/lib/rbs/collection/sources/local.rb +7 -5
  62. data/lib/rbs/diff.rb +104 -0
  63. data/lib/rbs/environment.rb +1 -1
  64. data/lib/rbs/method_type.rb +23 -0
  65. data/lib/rbs/prototype/rb.rb +2 -9
  66. data/lib/rbs/prototype/rbi.rb +1 -1
  67. data/lib/rbs/prototype/runtime/helpers.rb +59 -0
  68. data/lib/rbs/prototype/runtime/reflection.rb +19 -0
  69. data/lib/rbs/prototype/runtime/value_object_generator.rb +275 -0
  70. data/lib/rbs/prototype/runtime.rb +233 -153
  71. data/lib/rbs/sorter.rb +144 -117
  72. data/lib/rbs/test/guaranteed.rb +31 -0
  73. data/lib/rbs/test/type_check.rb +4 -4
  74. data/lib/rbs/test.rb +3 -0
  75. data/lib/rbs/types.rb +184 -3
  76. data/lib/rbs/version.rb +1 -1
  77. data/lib/rbs/writer.rb +4 -4
  78. data/lib/rbs.rb +1 -0
  79. data/rbs.gemspec +1 -0
  80. data/sig/annotate/formatter.rbs +2 -2
  81. data/sig/annotate/rdoc_annotater.rbs +1 -1
  82. data/sig/cli/colored_io.rbs +15 -0
  83. data/sig/cli/diff.rbs +21 -0
  84. data/sig/cli.rbs +2 -0
  85. data/sig/collection/config/lockfile.rbs +0 -6
  86. data/sig/diff.rbs +23 -0
  87. data/sig/errors.rbs +1 -5
  88. data/sig/method_types.rbs +6 -0
  89. data/sig/prototype/runtime.rbs +166 -0
  90. data/sig/rdoc/rbs.rbs +4 -0
  91. data/sig/shims/bundler.rbs +5 -0
  92. data/sig/sorter.rbs +23 -5
  93. data/sig/types.rbs +29 -0
  94. data/stdlib/benchmark/0/benchmark.rbs +1 -1
  95. data/stdlib/cgi/0/core.rbs +2 -2
  96. data/stdlib/did_you_mean/0/did_you_mean.rbs +2 -2
  97. data/stdlib/digest/0/digest.rbs +1 -1
  98. data/stdlib/fileutils/0/fileutils.rbs +1 -1
  99. data/stdlib/forwardable/0/forwardable.rbs +4 -4
  100. data/stdlib/io-console/0/io-console.rbs +1 -1
  101. data/stdlib/json/0/json.rbs +37 -0
  102. data/stdlib/logger/0/logger.rbs +2 -2
  103. data/stdlib/net-http/0/manifest.yaml +1 -1
  104. data/stdlib/net-http/0/net-http.rbs +16 -63
  105. data/stdlib/net-protocol/0/manifest.yaml +2 -0
  106. data/stdlib/net-protocol/0/net-protocol.rbs +56 -0
  107. data/stdlib/net-smtp/0/manifest.yaml +2 -0
  108. data/stdlib/net-smtp/0/net-smtp.rbs +55 -0
  109. data/stdlib/open-uri/0/manifest.yaml +3 -0
  110. data/stdlib/open-uri/0/open-uri.rbs +341 -0
  111. data/stdlib/openssl/0/openssl.rbs +1 -1
  112. data/stdlib/pp/0/manifest.yaml +2 -0
  113. data/stdlib/pp/0/pp.rbs +301 -0
  114. data/stdlib/{yaml → psych}/0/dbm.rbs +3 -3
  115. data/stdlib/psych/0/manifest.yaml +3 -0
  116. data/stdlib/psych/0/psych.rbs +391 -0
  117. data/stdlib/{yaml → psych}/0/store.rbs +2 -2
  118. data/stdlib/rdoc/0/code_object.rbs +55 -0
  119. data/stdlib/rdoc/0/comment.rbs +60 -0
  120. data/stdlib/rdoc/0/context.rbs +153 -0
  121. data/stdlib/rdoc/0/markup.rbs +119 -0
  122. data/stdlib/rdoc/0/parser.rbs +56 -0
  123. data/stdlib/rdoc/0/rdoc.rbs +0 -372
  124. data/stdlib/rdoc/0/ri.rbs +17 -0
  125. data/stdlib/rdoc/0/store.rbs +48 -0
  126. data/stdlib/rdoc/0/top_level.rbs +97 -0
  127. data/stdlib/socket/0/basic_socket.rbs +1 -1
  128. data/stdlib/socket/0/socket.rbs +1 -1
  129. data/stdlib/uri/0/common.rbs +1 -1
  130. data/stdlib/yaml/0/manifest.yaml +1 -2
  131. data/stdlib/yaml/0/yaml.rbs +1 -199
  132. metadata +51 -9
  133. data/sig/shims/pp.rbs +0 -3
  134. data/sig/shims.rbs +0 -47
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e35554c5e6cea0f61928bfdc6faaf896414118057a8889c82dd1d6dc87811811
4
- data.tar.gz: f6506b40efbcc5df5ffeb51ebd700e63311b76aaf6c9627e542aecf8d16232b8
3
+ metadata.gz: 7dc5c4dc317f2e52f4626a4fec99d333422d69e6e18ec9fcad02d710bf17a212
4
+ data.tar.gz: e9da32752089f0d923e82ee304e36751f28263adeb5893860d4f0f84f5b62caf
5
5
  SHA512:
6
- metadata.gz: b075058eceed815b0fb39a844dc663bda7651694a79a024a33196a252e58eb6767cdc14595fbf989d02f8558ac4b252d543e8e13bfd930abd046e259d12e97a3
7
- data.tar.gz: 7a19f068dc2278bc2bd0332559ecf91c848516f80537ff7bb3bda7cf6084e4c085fbae8f59e7dae241ae16867827e13e81107d154d78c7336cc560eda9084dbb
6
+ metadata.gz: eb722e98a22685907310de9465590da330bf86f4387fc40e65ce692a9fbbd6839d850a706ca7f489954048d40555d3040e83ffddb452494529febfcd98dbeff5
7
+ data.tar.gz: 2ed8a1e9a4bbb28341f5c578903a94a23ea3b6bcc95721308dcfddce514f269755f0f7baaaf2cb0a4511c7895fc39992fe2cdfe95ad33e66f045971cb137587e
@@ -13,7 +13,7 @@ jobs:
13
13
  container:
14
14
  image: rubylang/ruby:3.2-dev-focal
15
15
  steps:
16
- - uses: actions/checkout@v3
16
+ - uses: actions/checkout@v4
17
17
  - name: Install dependencies
18
18
  run: |
19
19
  apt-get update
@@ -11,6 +11,7 @@ jobs:
11
11
  test:
12
12
  runs-on: "ubuntu-latest"
13
13
  strategy:
14
+ fail-fast: false
14
15
  matrix:
15
16
  container_tag:
16
17
  - master-nightly-focal
@@ -30,10 +31,13 @@ jobs:
30
31
  job: stdlib_test
31
32
  - container_tag: 3.1-dev-focal
32
33
  job: stdlib_test
34
+ include:
35
+ - container_tag: master-nightly-focal
36
+ allow_failures: "true"
33
37
  container:
34
38
  image: rubylang/ruby:${{ matrix.container_tag }}
35
39
  steps:
36
- - uses: actions/checkout@v3
40
+ - uses: actions/checkout@v4
37
41
  - name: Set working directory as safe
38
42
  run: git config --global --add safe.directory $(pwd)
39
43
  - name: Install dependencies
@@ -66,6 +70,7 @@ jobs:
66
70
  - name: Run test
67
71
  run: |
68
72
  bundle exec rake ${{ matrix.job }}
73
+ continue-on-error: ${{ matrix.allow_failures == 'true' && (github.event_name == 'push' || github.event_name == 'merge_group') }}
69
74
 
70
75
  windows:
71
76
  runs-on: ${{ matrix.os }}
@@ -75,7 +80,7 @@ jobs:
75
80
  os: [windows-2019, windows-2022]
76
81
  ruby: [ucrt, mswin]
77
82
  steps:
78
- - uses: actions/checkout@v3
83
+ - uses: actions/checkout@v4
79
84
  - name: load ruby
80
85
  uses: ruby/setup-ruby@v1
81
86
  with:
data/.rubocop.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  require: rubocop-rubycw
2
2
  AllCops:
3
- TargetRubyVersion: 2.7
3
+ TargetRubyVersion: 3.0
4
4
  DisabledByDefault: true
5
5
  Exclude:
6
6
  - 'vendor/bundle/**/*'
data/CHANGELOG.md CHANGED
@@ -2,6 +2,111 @@
2
2
 
3
3
  ## master
4
4
 
5
+ ## 3.3.0.pre.2 (2023-11-02)
6
+
7
+ ### Signature updates
8
+
9
+ * net/smtp ([#1560](https://github.com/ruby/rbs/pull/1560))
10
+ * open-uri ([#1592](https://github.com/ruby/rbs/pull/1592))
11
+ * `Set` ([#1595](https://github.com/ruby/rbs/pull/1595))
12
+
13
+ ### Library changes
14
+
15
+ * Fixup validation ([#1596](https://github.com/ruby/rbs/pull/1596))
16
+ * Print type syntax errors instead of raising error ([#1594](https://github.com/ruby/rbs/pull/1594))
17
+
18
+ #### rbs prototype
19
+
20
+ * Fix error when MASGN ([#1593](https://github.com/ruby/rbs/pull/1593))
21
+ * Support cases where `Module#constants` has been redefined ([#1591](https://github.com/ruby/rbs/pull/1591))
22
+ * [prototype runtime] Fix error if direct inherited ([#1590](https://github.com/ruby/rbs/pull/1590))
23
+
24
+ ## 3.3.0.pre.1 (2023-10-31)
25
+
26
+ ### Signature updates
27
+
28
+ * json ([#1575](https://github.com/ruby/rbs/pull/1575))
29
+ * net-protocol ([#1559](https://github.com/ruby/rbs/pull/1559))
30
+ * pp ([#1545](https://github.com/ruby/rbs/pull/1545))
31
+ * psych ([#1527](https://github.com/ruby/rbs/pull/1527))
32
+ * `BasicObject` ([#1506](https://github.com/ruby/rbs/pull/1506))
33
+ * `ConditionVariable` ([#1468](https://github.com/ruby/rbs/pull/1468))
34
+ * `Encoding` ([#1510](https://github.com/ruby/rbs/pull/1510))
35
+ * `Exception` ([#1529](https://github.com/ruby/rbs/pull/1529))
36
+ * `FalseClass` ([#1478](https://github.com/ruby/rbs/pull/1478), [#1487](https://github.com/ruby/rbs/pull/1487))
37
+ * `Fiber` ([#1463](https://github.com/ruby/rbs/pull/1463))
38
+ * `FileTest` ([#1500](https://github.com/ruby/rbs/pull/1500))
39
+ * `Kernel` ([#1567](https://github.com/ruby/rbs/pull/1567), [#1518](https://github.com/ruby/rbs/pull/1518), [#1504](https://github.com/ruby/rbs/pull/1504), [#1487](https://github.com/ruby/rbs/pull/1487))
40
+ * `Marshal` ([#1524](https://github.com/ruby/rbs/pull/1524))
41
+ * `Math` ([#1533](https://github.com/ruby/rbs/pull/1533))
42
+ * `Mutex` ([#1468](https://github.com/ruby/rbs/pull/1468))
43
+ * `NilClass` ([#1478](https://github.com/ruby/rbs/pull/1478), [#1487](https://github.com/ruby/rbs/pull/1487))
44
+ * `Object` ([#1504](https://github.com/ruby/rbs/pull/1504))
45
+ * `Queue` ([#1468](https://github.com/ruby/rbs/pull/1468))
46
+ * `RbConfig` ([#1534](https://github.com/ruby/rbs/pull/1534))
47
+ * `Signal` ([#1512](https://github.com/ruby/rbs/pull/1512))
48
+ * `SizedQueue` ([#1468](https://github.com/ruby/rbs/pull/1468))
49
+ * `ThreadGroup` ([#1509](https://github.com/ruby/rbs/pull/1509))
50
+ * `TrueClass` ([#1478](https://github.com/ruby/rbs/pull/1478), [#1487](https://github.com/ruby/rbs/pull/1487))
51
+ * `Warning` ([#1477](https://github.com/ruby/rbs/pull/1477))
52
+ * `Enumerator.produce` ([#1516](https://github.com/ruby/rbs/pull/1516))
53
+ * `Module.define_method` ([#1557](https://github.com/ruby/rbs/pull/1557))
54
+ * `URI.join` ([#1580](https://github.com/ruby/rbs/pull/1580))
55
+ * `YAML.unsafe_load` ([#1528](https://github.com/ruby/rbs/pull/1528))
56
+ * `builtin.rbs`([#1455](https://github.com/ruby/rbs/pull/1455), [#1469](https://github.com/ruby/rbs/pull/1469))
57
+ * `constants.rbs` ([#1531](https://github.com/ruby/rbs/pull/1531))
58
+ * `::interned` ([#1499](https://github.com/ruby/rbs/pull/1499), [#1488](https://github.com/ruby/rbs/pull/1488))
59
+
60
+ ### Language updates
61
+
62
+ * Add `__todo__` type ([#1520](https://github.com/ruby/rbs/pull/1520))
63
+
64
+ ### Library changes
65
+
66
+ * Colored diff ([#1589](https://github.com/ruby/rbs/pull/1589))
67
+ * Fix the issue where ::array[T] would be interpreted as ::array, and type mismatch ([#1491](https://github.com/ruby/rbs/pull/1491))
68
+ * Add `Abbrev` to runtime dependency ([#1573](https://github.com/ruby/rbs/pull/1573))
69
+ * Avoid an error when parsing files including SyntaxError ([#1574](https://github.com/ruby/rbs/pull/1574))
70
+ * Implement rbs diff command ([#1459](https://github.com/ruby/rbs/pull/1459))
71
+ * Add another type syntax validation ([#1566](https://github.com/ruby/rbs/pull/1566))
72
+ * Mark global variables ([#1551](https://github.com/ruby/rbs/pull/1551))
73
+ * Show location of type by method command ([#1537](https://github.com/ruby/rbs/pull/1537))
74
+ * Make alias and interface names absolute ([#1502](https://github.com/ruby/rbs/pull/1502))
75
+ * Better record type format ([#1501](https://github.com/ruby/rbs/pull/1501))
76
+ * Should keep escape of alias and attr family ([#1486](https://github.com/ruby/rbs/pull/1486))
77
+ * Fix error when undefined interface or alias ([#1465](https://github.com/ruby/rbs/pull/1465))
78
+
79
+ #### rbs prototype
80
+
81
+ * [prototype runtime --todo] Consider accessibility mismatch ([#1539](https://github.com/ruby/rbs/pull/1539))
82
+ * Better support for inherited class of `Struct` or `Data` by prototype runtime ([#1571](https://github.com/ruby/rbs/pull/1571))
83
+ * prototype rb: Ignore ITER (method call with block) ([#1562](https://github.com/ruby/rbs/pull/1562))
84
+ * [prototype runtime] Add --autoload option ([#1561](https://github.com/ruby/rbs/pull/1561))
85
+ * Implement todo option ([#1470](https://github.com/ruby/rbs/pull/1470))
86
+ * [prototype runtime] Fix error when constant is a BasicObject instance. ([#1485](https://github.com/ruby/rbs/pull/1485))
87
+ * [prototype runtime] Const name should be absolute ([#1490](https://github.com/ruby/rbs/pull/1490))
88
+ * [prototype runtime] Optimize performance ([#1495](https://github.com/ruby/rbs/pull/1495))
89
+ * [prototype runtime] Fix error when output Object constants ([#1472](https://github.com/ruby/rbs/pull/1472))
90
+ * [prototype runtime] Support prepend mixin ([#1460](https://github.com/ruby/rbs/pull/1460))
91
+ * [prototype runtime] Avoid alias for methods defined in another module ([#1457](https://github.com/ruby/rbs/pull/1457))
92
+
93
+ #### rbs collection
94
+
95
+ * [Collection] Simple colorize collection text like Bundler ([#1558](https://github.com/ruby/rbs/pull/1558))
96
+ * Delete `sources` section from lockfile ([#1544](https://github.com/ruby/rbs/pull/1544))
97
+
98
+ ### Miscellaneous
99
+
100
+ * Add in with_XXX methods ([#1492](https://github.com/ruby/rbs/pull/1492))
101
+ * Updated binding to use modern kernel tests ([#1507](https://github.com/ruby/rbs/pull/1507))
102
+ * Remove all non-required methods from testing types ([#1541](https://github.com/ruby/rbs/pull/1541))
103
+ * Add `assert_type` assertion to confirm if the value has a type ([#1532](https://github.com/ruby/rbs/pull/1532))
104
+ * Add `#assert_const_type` and guide to use type assertions ([#1514](https://github.com/ruby/rbs/pull/1514))
105
+ * Improve skip test message ([#1476](https://github.com/ruby/rbs/pull/1476))
106
+ * Type check ([#1467](https://github.com/ruby/rbs/pull/1467))
107
+ * Type check RDoc related Ruby code ([#1466](https://github.com/ruby/rbs/pull/1466))
108
+ * Fix CI failure ([#1464](https://github.com/ruby/rbs/pull/1464))
109
+
5
110
  ## 3.2.2 (2023-09-28)
6
111
 
7
112
  ### Library changes
data/Gemfile CHANGED
@@ -22,6 +22,9 @@ gem "rdoc", "~> 6.4.0"
22
22
  # Test gems
23
23
  gem "rbs-amber", path: "test/assets/test-gem"
24
24
 
25
+ # Bundled gems
26
+ gem "net-smtp"
27
+
25
28
  group :minitest do
26
29
  gem "minitest"
27
30
  end
data/Gemfile.lock CHANGED
@@ -1,7 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rbs (3.2.2)
4
+ rbs (3.3.0.pre.2)
5
+ abbrev
5
6
 
6
7
  PATH
7
8
  remote: test/assets/test-gem
@@ -11,10 +12,10 @@ PATH
11
12
  GEM
12
13
  remote: https://rubygems.org/
13
14
  specs:
14
- addressable (2.8.4)
15
+ abbrev (0.1.1)
16
+ addressable (2.8.5)
15
17
  public_suffix (>= 2.0.2, < 6.0)
16
18
  ast (2.4.2)
17
- base64 (0.1.1)
18
19
  dbm (1.1.0)
19
20
  diff-lcs (1.5.0)
20
21
  digest (3.1.1)
@@ -24,27 +25,31 @@ GEM
24
25
  rainbow (>= 3.0, < 4.0)
25
26
  strong_json (>= 1.1, < 2.2)
26
27
  json (2.6.3)
27
- json-schema (4.0.0)
28
+ json-schema (4.1.1)
28
29
  addressable (>= 2.8)
29
30
  language_server-protocol (3.17.0.3)
30
31
  marcel (1.0.2)
31
- minitest (5.19.0)
32
+ minitest (5.20.0)
33
+ net-protocol (0.2.1)
34
+ timeout
35
+ net-smtp (0.4.0)
36
+ net-protocol
32
37
  parallel (1.23.0)
33
- parser (3.2.2.3)
38
+ parser (3.2.2.4)
34
39
  ast (~> 2.4.1)
35
40
  racc
36
41
  power_assert (2.0.3)
37
42
  psych (4.0.6)
38
43
  stringio
39
- public_suffix (5.0.1)
44
+ public_suffix (5.0.3)
40
45
  racc (1.7.1)
41
46
  rainbow (3.1.1)
42
- rake (13.0.6)
47
+ rake (13.1.0)
43
48
  rake-compiler (1.2.5)
44
49
  rake
45
50
  rdoc (6.4.0)
46
51
  psych (>= 4.0.0)
47
- regexp_parser (2.8.1)
52
+ regexp_parser (2.8.2)
48
53
  rexml (3.2.6)
49
54
  rspec (3.12.0)
50
55
  rspec-core (~> 3.12.0)
@@ -59,19 +64,18 @@ GEM
59
64
  diff-lcs (>= 1.2.0, < 2.0)
60
65
  rspec-support (~> 3.12.0)
61
66
  rspec-support (3.12.0)
62
- rubocop (1.56.0)
63
- base64 (~> 0.1.1)
67
+ rubocop (1.57.2)
64
68
  json (~> 2.3)
65
69
  language_server-protocol (>= 3.17.0)
66
70
  parallel (~> 1.10)
67
- parser (>= 3.2.2.3)
71
+ parser (>= 3.2.2.4)
68
72
  rainbow (>= 2.2.2, < 4.0)
69
73
  regexp_parser (>= 1.8, < 3.0)
70
74
  rexml (>= 3.2.5, < 4.0)
71
75
  rubocop-ast (>= 1.28.1, < 2.0)
72
76
  ruby-progressbar (~> 1.7)
73
77
  unicode-display_width (>= 2.4.0, < 3.0)
74
- rubocop-ast (1.29.0)
78
+ rubocop-ast (1.30.0)
75
79
  parser (>= 3.2.1.0)
76
80
  rubocop-rubycw (0.1.6)
77
81
  rubocop (~> 1.0)
@@ -82,7 +86,8 @@ GEM
82
86
  tempfile (0.1.3)
83
87
  test-unit (3.6.1)
84
88
  power_assert
85
- unicode-display_width (2.4.2)
89
+ timeout (0.4.0)
90
+ unicode-display_width (2.5.0)
86
91
 
87
92
  PLATFORMS
88
93
  ruby
@@ -95,6 +100,7 @@ DEPENDENCIES
95
100
  json
96
101
  json-schema
97
102
  minitest
103
+ net-smtp
98
104
  rake
99
105
  rake-compiler
100
106
  rbs!
data/README.md CHANGED
@@ -54,8 +54,8 @@ end
54
54
 
55
55
  ## The Target Version
56
56
 
57
- * The standard library signatures targets Ruby 3.1. (The latest release of Ruby.)
58
- * The library code targets Ruby 3.1, 3.0, and 2.7. (It runs on 2.6 in fact.)
57
+ * The standard library signatures targets the latest release of Ruby. (`3.2` as of 2023.)
58
+ * The library code targets non-EOL versions of Ruby. (`>= 3.0` as of 2023.)
59
59
 
60
60
  ## Installation
61
61
 
@@ -132,6 +132,15 @@ puts singleton.methods[:gsub]
132
132
  - [Stdlib signatures guide](docs/stdlib.md)
133
133
  - [Syntax](docs/syntax.md)
134
134
  - [RBS by Example](docs/rbs_by_example.md)
135
+ - [RBS collection](docs/collection.md)
136
+ - [Using `Data` and `Struct`](docs/data_and_struct.md)
137
+
138
+ ## Community
139
+
140
+ Here is a list of some places you can talk with active maintainers.
141
+
142
+ - [Ruby Discord Server (invite link)](https://discord.gg/ad2acQFtkh) -- We have `rbs` channel in Ruby Discord server.
143
+ - [ruby-jp Slack Workspace (in Japanese)](https://ruby-jp.github.io/) -- We have `types` channel in ruby-jp slack workspace.
135
144
 
136
145
  ## Development
137
146
 
data/Rakefile CHANGED
@@ -84,11 +84,12 @@ end
84
84
 
85
85
  task :stdlib_test => :compile do
86
86
  test_files = FileList["test/stdlib/**/*_test.rb"].reject do |path|
87
- path =~ %r{Ractor}
87
+ path =~ %r{Ractor} || path =~ %r{Encoding}
88
88
  end
89
89
  sh "#{ruby} -Ilib #{bin}/test_runner.rb #{test_files.join(' ')}"
90
90
  # TODO: Ractor tests need to be run in a separate process
91
91
  sh "#{ruby} -Ilib #{bin}/test_runner.rb test/stdlib/Ractor_test.rb"
92
+ sh "#{ruby} -Ilib #{bin}/test_runner.rb test/stdlib/Encoding_test.rb"
92
93
  end
93
94
 
94
95
  task :rubocop do
@@ -157,13 +158,14 @@ namespace :generate do
157
158
  # library "pathname", "securerandom" # Declare library signatures to load
158
159
  testing "singleton(::<%= target %>)"
159
160
 
160
- <%- class_methods.each do |method_name, definition| %>
161
+ <%- class_methods.each do |method_name, definition| -%>
161
162
  def test_<%= test_name_for(method_name) %>
162
163
  <%- definition.method_types.each do |method_type| -%>
163
- assert_send_type "<%= method_type %>",
164
- <%= target %>, :<%= method_name %>
164
+ assert_send_type "<%= method_type %>",
165
+ <%= target %>, :<%= method_name %>
165
166
  <%- end -%>
166
167
  end
168
+
167
169
  <%- end -%>
168
170
  end
169
171
  <%- end -%>
@@ -175,13 +177,14 @@ namespace :generate do
175
177
  # library "pathname", "securerandom" # Declare library signatures to load
176
178
  testing "::<%= target %>"
177
179
 
178
- <%- instance_methods.each do |method_name, definition| %>
180
+ <%- instance_methods.each do |method_name, definition| -%>
179
181
  def test_<%= test_name_for(method_name) %>
180
182
  <%- definition.method_types.each do |method_type| -%>
181
- assert_send_type "<%= method_type %>",
182
- <%= target %>.new, :<%= method_name %>
183
+ assert_send_type "<%= method_type %>",
184
+ <%= target %>.new, :<%= method_name %>
183
185
  <%- end -%>
184
186
  end
187
+
185
188
  <%- end -%>
186
189
  end
187
190
  <%- end -%>
data/Steepfile CHANGED
@@ -4,23 +4,23 @@ target :lib do
4
4
  signature "sig"
5
5
  check "lib"
6
6
  ignore(
7
- "lib/rbs/prototype/runtime.rb",
8
7
  "lib/rbs/test",
9
8
  "lib/rbs/test.rb"
10
9
  )
11
10
 
12
- library "pathname", "json", "logger", "monitor", "tsort", "uri", 'dbm', 'pstore', 'singleton', 'shellwords', 'fileutils', 'find', 'digest', 'abbrev'
11
+ library "pathname", "json", "logger", "monitor", "tsort", "uri", 'dbm', 'pstore', 'singleton', 'shellwords', 'fileutils', 'find', 'digest', 'abbrev', 'prettyprint'
13
12
  signature 'stdlib/yaml/0'
14
13
  signature "stdlib/strscan/0/"
15
14
  signature "stdlib/optparse/0/"
16
15
  signature "stdlib/rdoc/0/"
17
16
  signature "stdlib/ripper/0"
17
+ signature "stdlib/pp/0"
18
18
 
19
- configure_code_diagnostics do |config|
20
- config[D::Ruby::MethodDefinitionMissing] = :hint
21
- config[D::Ruby::ElseOnExhaustiveCase] = :hint
22
- config[D::Ruby::FallbackAny] = :hint
23
- end
19
+ # configure_code_diagnostics do |config|
20
+ # config[D::Ruby::MethodDefinitionMissing] = :hint
21
+ # config[D::Ruby::ElseOnExhaustiveCase] = :hint
22
+ # config[D::Ruby::FallbackAny] = :hint
23
+ # end
24
24
  end
25
25
 
26
26
  # target :lib do
@@ -163,7 +163,7 @@ class BasicObject
163
163
  # k = Klass.new
164
164
  # k.send :hello, "gentle", "readers" #=> "Hello gentle readers"
165
165
  #
166
- def __send__: (String | Symbol arg0, *untyped args) -> untyped
166
+ def __send__: (interned name, *untyped, **untyped) ?{ (*untyped, **untyped) -> untyped } -> untyped
167
167
 
168
168
  # <!-- rdoc-file=object.c -->
169
169
  # Equality --- At the Object level, #== returns `true` only if `obj` and `other`
@@ -195,7 +195,7 @@ class BasicObject
195
195
  # 1 == 1.0 #=> true
196
196
  # 1.eql? 1.0 #=> false
197
197
  #
198
- def equal?: (untyped other) -> bool
198
+ alias equal? ==
199
199
 
200
200
  # <!--
201
201
  # rdoc-file=vm_eval.c
@@ -228,7 +228,7 @@ class BasicObject
228
228
  # k.instance_eval { the_secret } #=> "Ssssh! The secret is 99."
229
229
  # k.instance_eval {|obj| obj == self } #=> true
230
230
  #
231
- def instance_eval: (String, ?String filename, ?Integer lineno) -> untyped
231
+ def instance_eval: (string code, ?string filename, ?int lineno) -> untyped
232
232
  | [U] () { (self) [self: self] -> U } -> U
233
233
 
234
234
  # <!--
@@ -256,7 +256,7 @@ class BasicObject
256
256
  # -->
257
257
  # Returns a new BasicObject.
258
258
  #
259
- def initialize: () -> void
259
+ def initialize: () -> nil
260
260
 
261
261
  private
262
262
 
@@ -318,7 +318,7 @@ class BasicObject
318
318
  # Adding one
319
319
  # Adding three
320
320
  #
321
- def singleton_method_added: (Symbol) -> void
321
+ def singleton_method_added: (Symbol name) -> nil
322
322
 
323
323
  # <!--
324
324
  # rdoc-file=object.c
@@ -345,7 +345,7 @@ class BasicObject
345
345
  # Removing three
346
346
  # Removing one
347
347
  #
348
- def singleton_method_removed: (Symbol) -> void
348
+ def singleton_method_removed: (Symbol name) -> nil
349
349
 
350
350
  # <!--
351
351
  # rdoc-file=object.c
@@ -368,5 +368,5 @@ class BasicObject
368
368
  #
369
369
  # Undefining one
370
370
  #
371
- def singleton_method_undefined: (Symbol) -> void
371
+ def singleton_method_undefined: (Symbol name) -> nil
372
372
  end
data/core/binding.rbs CHANGED
@@ -66,7 +66,7 @@ class Binding
66
66
  #
67
67
  # binding.eval("defined?(#{symbol}) == 'local-variable'")
68
68
  #
69
- def local_variable_defined?: (Symbol | string varname) -> bool
69
+ def local_variable_defined?: (interned varname) -> bool
70
70
 
71
71
  # <!--
72
72
  # rdoc-file=proc.c
@@ -84,7 +84,7 @@ class Binding
84
84
  #
85
85
  # binding.eval("#{symbol}")
86
86
  #
87
- def local_variable_get: (Symbol | string varname) -> untyped
87
+ def local_variable_get: (interned varname) -> untyped
88
88
 
89
89
  # <!--
90
90
  # rdoc-file=proc.c
@@ -111,7 +111,7 @@ class Binding
111
111
  #
112
112
  # if `obj` can be dumped in Ruby code.
113
113
  #
114
- def local_variable_set: [U] (Symbol | string varname, U obj) -> U
114
+ def local_variable_set: [U] (interned varname, U obj) -> U
115
115
 
116
116
  # <!--
117
117
  # rdoc-file=proc.c