rbs 3.4.4 → 3.5.0.pre.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (68) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ruby.yml +7 -0
  3. data/CHANGELOG.md +0 -26
  4. data/Gemfile +12 -1
  5. data/Gemfile.lock +51 -34
  6. data/README.md +2 -1
  7. data/Rakefile +2 -2
  8. data/core/enumerator.rbs +1 -1
  9. data/core/gc.rbs +272 -150
  10. data/core/integer.rbs +4 -3
  11. data/core/io/wait.rbs +4 -4
  12. data/core/io.rbs +10 -3
  13. data/core/kernel.rbs +8 -7
  14. data/core/module.rbs +17 -4
  15. data/core/range.rbs +2 -2
  16. data/core/regexp.rbs +101 -90
  17. data/core/ruby_vm.rbs +103 -103
  18. data/core/string.rbs +3 -3
  19. data/core/symbol.rbs +2 -1
  20. data/core/thread.rbs +1 -1
  21. data/core/time.rbs +24 -4
  22. data/docs/architecture.md +110 -0
  23. data/docs/syntax.md +5 -1
  24. data/ext/rbs_extension/constants.c +2 -0
  25. data/ext/rbs_extension/constants.h +1 -0
  26. data/ext/rbs_extension/location.c +79 -70
  27. data/ext/rbs_extension/location.h +23 -5
  28. data/ext/rbs_extension/parser.c +82 -24
  29. data/ext/rbs_extension/parserstate.c +4 -0
  30. data/ext/rbs_extension/ruby_objs.c +13 -3
  31. data/ext/rbs_extension/ruby_objs.h +1 -0
  32. data/lib/rbs/collection/config.rb +1 -1
  33. data/lib/rbs/collection/sources/git.rb +1 -6
  34. data/lib/rbs/definition_builder/method_builder.rb +1 -1
  35. data/lib/rbs/definition_builder.rb +8 -8
  36. data/lib/rbs/diff.rb +1 -1
  37. data/lib/rbs/environment_loader.rb +2 -1
  38. data/lib/rbs/errors.rb +0 -14
  39. data/lib/rbs/parser_aux.rb +0 -5
  40. data/lib/rbs/prototype/helpers.rb +22 -12
  41. data/lib/rbs/prototype/rb.rb +38 -4
  42. data/lib/rbs/prototype/rbi.rb +30 -20
  43. data/lib/rbs/test/errors.rb +19 -14
  44. data/lib/rbs/test/tester.rb +1 -1
  45. data/lib/rbs/test/type_check.rb +95 -16
  46. data/lib/rbs/types.rb +112 -13
  47. data/lib/rbs/unit_test/spy.rb +1 -1
  48. data/lib/rbs/version.rb +1 -1
  49. data/rbs.gemspec +1 -1
  50. data/sig/environment_loader.rbs +1 -1
  51. data/sig/errors.rbs +1 -1
  52. data/sig/method_types.rbs +3 -3
  53. data/sig/prototype/helpers.rbs +4 -0
  54. data/sig/prototype/rbi.rbs +2 -0
  55. data/sig/types.rbs +54 -4
  56. data/sig/variance_calculator.rbs +2 -2
  57. data/stdlib/csv/0/csv.rbs +4 -1
  58. data/stdlib/fileutils/0/fileutils.rbs +1 -1
  59. data/stdlib/net-http/0/net-http.rbs +29 -27
  60. data/stdlib/socket/0/socket.rbs +2 -2
  61. data/stdlib/timeout/0/timeout.rbs +6 -0
  62. data/stdlib/uri/0/generic.rbs +2 -2
  63. data/stdlib/uri/0/http.rbs +2 -2
  64. metadata +3 -6
  65. data/lib/rbs/parser_compat/lexer_error.rb +0 -6
  66. data/lib/rbs/parser_compat/located_value.rb +0 -7
  67. data/lib/rbs/parser_compat/semantics_error.rb +0 -6
  68. data/lib/rbs/parser_compat/syntax_error.rb +0 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1cb14174ab8984f446bae9472db5994cfd3f660101eb6ce33d53b1ce8d2c0871
4
- data.tar.gz: f91955d86a636a762d5894fdb0230024c05dda5c2957c70c126d5d1e8ebe21e6
3
+ metadata.gz: d531a807ca33dac823ab8abc9381ad2769607581f7f878c7e90b64f96a7df12c
4
+ data.tar.gz: f063ae7209b5eded9645c0429ddba1c70104d4866252eee234b4f58dad2f0090
5
5
  SHA512:
6
- metadata.gz: d26b8e953ca26fd82eb8c0a74718c9288ac0871de48b5ba4e968fe2ed00cbeb8396097b0b75c732227b2a7cb3eb59338ed3ca945a5051ff3f9d3c7293c37f5db
7
- data.tar.gz: fa9c674f1fb275fcb920beea62d731edf3f831c7d2c9d53bcdd3ee97fb8d213b974e24466eb9ebf11f1922f35ed85ec6afd3466b93404d17de49e4d3377249b6
6
+ metadata.gz: 361cee4e71bb3430d5f83e48923e44f3a542336b77b81ee6aa2188d5434f14d89569d204d866c8b688fc932803bd6fd5c6ad3a1c65db99536032d63f5b882443
7
+ data.tar.gz: 2c526b49e8db179a6137a2ab82d1205f11fd1b2346e630248f8cdd874d514c6647bff7cb5bfc9e224d5ea10ae3d90c2fff0cacd903b69f071b5930d3831eded3
@@ -14,6 +14,7 @@ jobs:
14
14
  fail-fast: false
15
15
  matrix:
16
16
  ruby: ['3.0', '3.1', '3.2', '3.3', head]
17
+ rubyopt: [""]
17
18
  job:
18
19
  - test
19
20
  include:
@@ -21,6 +22,12 @@ jobs:
21
22
  job: stdlib_test rubocop
22
23
  - ruby: "3.3"
23
24
  job: stdlib_test
25
+ - ruby: "3.3"
26
+ job: test
27
+ rubyopt: "--enable-frozen-string-literal"
28
+ - ruby: "3.3"
29
+ job: stdlib_test
30
+ rubyopt: "--enable-frozen-string-literal"
24
31
  - ruby: "3.3"
25
32
  job: lexer compile confirm_lexer
26
33
  - ruby: "3.3"
data/CHANGELOG.md CHANGED
@@ -2,32 +2,6 @@
2
2
 
3
3
  ## master
4
4
 
5
- ## 3.4.4 (2024-02-08)
6
-
7
- ### Miscellaneous
8
-
9
- * Backport [#1752](https://github.com/ruby/rbs/pull/1752) ([#1753](https://github.com/ruby/rbs/pull/1753))
10
-
11
- ## 3.4.3 (2024-01-25)
12
-
13
- ### Library changes
14
-
15
- #### rbs collection
16
-
17
- * Backport [#1731](https://github.com/ruby/rbs/pull/1731) ([#1735](https://github.com/ruby/rbs/pull/1735))
18
-
19
- ## 3.4.2 (2024-01-19)
20
-
21
- ### Miscellaneous
22
-
23
- * Backport [#1724](https://github.com/ruby/rbs/pull/1724) ([#1726](https://github.com/ruby/rbs/pull/1726))
24
-
25
- ## 3.4.1 (2023-12-26)
26
-
27
- ### Signature updates
28
-
29
- * Update embedded RDoc based on ruby-3.3.0 (Backport #1699) ([#1700](https://github.com/ruby/rbs/pull/1700))
30
-
31
5
  ## 3.4.0 (2023-12-21)
32
6
 
33
7
  ### Signature updates
data/Gemfile CHANGED
@@ -12,18 +12,29 @@ gem "rubocop"
12
12
  gem "rubocop-rubycw"
13
13
  gem "json"
14
14
  gem "json-schema"
15
- gem 'stackprof'
16
15
  gem "goodcheck"
17
16
  gem "dbm"
18
17
  gem 'digest'
19
18
  gem 'tempfile'
20
19
  gem "rdoc"
20
+ gem "bigdecimal"
21
+ gem "abbrev"
22
+ gem "base64"
23
+ gem "mutex_m"
24
+ gem "nkf"
25
+ gem "fileutils"
26
+
27
+ # Performance profiling and benchmarking
28
+ gem 'stackprof'
29
+ gem 'memory_profiler'
30
+ gem 'benchmark-ips'
21
31
 
22
32
  # Test gems
23
33
  gem "rbs-amber", path: "test/assets/test-gem"
24
34
 
25
35
  # Bundled gems
26
36
  gem "net-smtp"
37
+ gem 'csv'
27
38
 
28
39
  group :minitest do
29
40
  gem "minitest"
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rbs (3.4.4)
4
+ rbs (3.5.0.pre.1)
5
5
  abbrev
6
6
 
7
7
  PATH
@@ -13,80 +13,88 @@ GEM
13
13
  remote: https://rubygems.org/
14
14
  specs:
15
15
  abbrev (0.1.2)
16
- addressable (2.8.5)
16
+ addressable (2.8.6)
17
17
  public_suffix (>= 2.0.2, < 6.0)
18
18
  ast (2.4.2)
19
+ base64 (0.2.0)
20
+ benchmark-ips (2.13.0)
21
+ bigdecimal (3.1.7)
22
+ csv (3.3.0)
19
23
  dbm (1.1.0)
20
- diff-lcs (1.5.0)
24
+ diff-lcs (1.5.1)
21
25
  digest (3.1.1)
26
+ fileutils (1.7.2)
22
27
  goodcheck (3.1.0)
23
28
  marcel (>= 1.0, < 2.0)
24
29
  psych (>= 3.1, < 5.0)
25
30
  rainbow (>= 3.0, < 4.0)
26
31
  strong_json (>= 1.1, < 2.2)
27
- json (2.7.1)
28
- json-schema (4.1.1)
32
+ json (2.7.2)
33
+ json-schema (4.3.0)
29
34
  addressable (>= 2.8)
30
35
  language_server-protocol (3.17.0.3)
31
36
  marcel (1.0.2)
32
- minitest (5.20.0)
33
- net-protocol (0.2.1)
37
+ memory_profiler (1.0.1)
38
+ minitest (5.22.3)
39
+ mutex_m (0.2.0)
40
+ net-protocol (0.2.2)
34
41
  timeout
35
- net-smtp (0.4.0)
42
+ net-smtp (0.5.0)
36
43
  net-protocol
37
- parallel (1.23.0)
38
- parser (3.2.2.4)
44
+ nkf (0.2.0)
45
+ parallel (1.24.0)
46
+ parser (3.3.0.5)
39
47
  ast (~> 2.4.1)
40
48
  racc
41
49
  power_assert (2.0.3)
42
50
  psych (4.0.6)
43
51
  stringio
44
- public_suffix (5.0.3)
52
+ public_suffix (5.0.5)
45
53
  racc (1.7.3)
46
54
  rainbow (3.1.1)
47
- rake (13.1.0)
48
- rake-compiler (1.2.5)
55
+ rake (13.2.1)
56
+ rake-compiler (1.2.7)
49
57
  rake
50
- rdoc (6.6.2)
58
+ rdoc (6.6.3.1)
51
59
  psych (>= 4.0.0)
52
- regexp_parser (2.8.3)
60
+ regexp_parser (2.9.0)
53
61
  rexml (3.2.6)
54
- rspec (3.12.0)
55
- rspec-core (~> 3.12.0)
56
- rspec-expectations (~> 3.12.0)
57
- rspec-mocks (~> 3.12.0)
58
- rspec-core (3.12.0)
59
- rspec-support (~> 3.12.0)
60
- rspec-expectations (3.12.0)
62
+ rspec (3.13.0)
63
+ rspec-core (~> 3.13.0)
64
+ rspec-expectations (~> 3.13.0)
65
+ rspec-mocks (~> 3.13.0)
66
+ rspec-core (3.13.0)
67
+ rspec-support (~> 3.13.0)
68
+ rspec-expectations (3.13.0)
61
69
  diff-lcs (>= 1.2.0, < 2.0)
62
- rspec-support (~> 3.12.0)
63
- rspec-mocks (3.12.0)
70
+ rspec-support (~> 3.13.0)
71
+ rspec-mocks (3.13.0)
64
72
  diff-lcs (>= 1.2.0, < 2.0)
65
- rspec-support (~> 3.12.0)
66
- rspec-support (3.12.0)
67
- rubocop (1.59.0)
73
+ rspec-support (~> 3.13.0)
74
+ rspec-support (3.13.0)
75
+ rubocop (1.63.2)
68
76
  json (~> 2.3)
69
77
  language_server-protocol (>= 3.17.0)
70
78
  parallel (~> 1.10)
71
- parser (>= 3.2.2.4)
79
+ parser (>= 3.3.0.2)
72
80
  rainbow (>= 2.2.2, < 4.0)
73
81
  regexp_parser (>= 1.8, < 3.0)
74
82
  rexml (>= 3.2.5, < 4.0)
75
- rubocop-ast (>= 1.30.0, < 2.0)
83
+ rubocop-ast (>= 1.31.1, < 2.0)
76
84
  ruby-progressbar (~> 1.7)
77
85
  unicode-display_width (>= 2.4.0, < 3.0)
78
- rubocop-ast (1.30.0)
79
- parser (>= 3.2.1.0)
86
+ rubocop-ast (1.31.2)
87
+ parser (>= 3.3.0.4)
80
88
  rubocop-rubycw (0.1.6)
81
89
  rubocop (~> 1.0)
82
90
  ruby-progressbar (1.13.0)
83
- stackprof (0.2.25)
91
+ stackprof (0.2.26)
84
92
  stringio (3.1.0)
85
93
  strong_json (2.1.2)
86
94
  tempfile (0.2.1)
87
- test-unit (3.6.1)
95
+ test-unit (3.6.2)
88
96
  power_assert
89
- timeout (0.4.0)
97
+ timeout (0.4.1)
90
98
  unicode-display_width (2.5.0)
91
99
 
92
100
  PLATFORMS
@@ -94,13 +102,22 @@ PLATFORMS
94
102
  x86_64-darwin-20
95
103
 
96
104
  DEPENDENCIES
105
+ abbrev
106
+ base64
107
+ benchmark-ips
108
+ bigdecimal
109
+ csv
97
110
  dbm
98
111
  digest
112
+ fileutils
99
113
  goodcheck
100
114
  json
101
115
  json-schema
116
+ memory_profiler
102
117
  minitest
118
+ mutex_m
103
119
  net-smtp
120
+ nkf
104
121
  rake
105
122
  rake-compiler
106
123
  rbs!
data/README.md CHANGED
@@ -118,7 +118,7 @@ end
118
118
  It prints signatures for all methods, classes, instance variables, and constants.
119
119
  This is only a starting point, and you should edit the output to match your signature more accurately.
120
120
 
121
- `rbs prototpe` offers three options.
121
+ `rbs prototype` offers three options.
122
122
 
123
123
  - `rb` generates from just the available Ruby code
124
124
  - `rbi` generates from Sorbet RBI
@@ -174,6 +174,7 @@ puts singleton.methods[:gsub]
174
174
 
175
175
  ## Guides
176
176
 
177
+ - [Architecture](docs/architecture.md)
177
178
  - [Core and standard library signature contribution guide](docs/CONTRIBUTING.md)
178
179
  - [Writing signatures guide](docs/sigs.md)
179
180
  - [Stdlib signatures guide](docs/stdlib.md)
data/Rakefile CHANGED
@@ -153,7 +153,7 @@ namespace :generate do
153
153
 
154
154
  <%- unless class_methods.empty? -%>
155
155
  class <%= target %>SingletonTest < Test::Unit::TestCase
156
- include TypeAssertions
156
+ include TestHelper
157
157
 
158
158
  # library "pathname", "securerandom" # Declare library signatures to load
159
159
  testing "singleton(::<%= target %>)"
@@ -172,7 +172,7 @@ namespace :generate do
172
172
 
173
173
  <%- unless instance_methods.empty? -%>
174
174
  class <%= target %>Test < Test::Unit::TestCase
175
- include TypeAssertions
175
+ include TestHelper
176
176
 
177
177
  # library "pathname", "securerandom" # Declare library signatures to load
178
178
  testing "::<%= target %>"
data/core/enumerator.rbs CHANGED
@@ -293,7 +293,7 @@ class Enumerator[unchecked out Elem, out Return] < Object
293
293
  # lazy fashion (see Enumerator#size). It can either be a value or a callable
294
294
  # object.
295
295
  #
296
- def initialize: (?Integer arg0) { (Enumerator::Yielder arg0) -> void } -> void
296
+ def initialize: (?Integer arg0) { (Enumerator::Yielder arg0) -> Return } -> void
297
297
 
298
298
  # <!--
299
299
  # rdoc-file=enumerator.c