rbs 2.8.4 → 3.0.0.dev.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +0 -28
  3. data/Gemfile +1 -1
  4. data/Gemfile.lock +16 -16
  5. data/Rakefile +1 -9
  6. data/ext/rbs_extension/constants.c +2 -0
  7. data/ext/rbs_extension/constants.h +1 -0
  8. data/ext/rbs_extension/extconf.rb +1 -1
  9. data/ext/rbs_extension/parser.c +23 -13
  10. data/ext/rbs_extension/ruby_objs.c +15 -3
  11. data/ext/rbs_extension/ruby_objs.h +2 -1
  12. data/lib/rbs/ast/members.rb +49 -15
  13. data/lib/rbs/cli.rb +6 -1
  14. data/lib/rbs/collection/config/lockfile.rb +115 -0
  15. data/lib/rbs/collection/config/lockfile_generator.rb +89 -48
  16. data/lib/rbs/collection/config.rb +11 -39
  17. data/lib/rbs/collection/installer.rb +9 -13
  18. data/lib/rbs/collection/sources/base.rb +2 -2
  19. data/lib/rbs/collection/sources/git.rb +135 -62
  20. data/lib/rbs/collection/sources/rubygems.rb +10 -12
  21. data/lib/rbs/collection/sources/stdlib.rb +10 -13
  22. data/lib/rbs/collection/sources.rb +7 -1
  23. data/lib/rbs/collection.rb +1 -0
  24. data/lib/rbs/definition.rb +1 -1
  25. data/lib/rbs/definition_builder/method_builder.rb +3 -3
  26. data/lib/rbs/definition_builder.rb +449 -572
  27. data/lib/rbs/environment.rb +5 -3
  28. data/lib/rbs/environment_loader.rb +11 -10
  29. data/lib/rbs/locator.rb +2 -2
  30. data/lib/rbs/prototype/helpers.rb +29 -13
  31. data/lib/rbs/prototype/node_usage.rb +99 -0
  32. data/lib/rbs/prototype/rb.rb +3 -2
  33. data/lib/rbs/prototype/rbi.rb +6 -4
  34. data/lib/rbs/prototype/runtime.rb +25 -12
  35. data/lib/rbs/substitution.rb +19 -0
  36. data/lib/rbs/types.rb +1 -5
  37. data/lib/rbs/validator.rb +2 -1
  38. data/lib/rbs/version.rb +1 -1
  39. data/lib/rbs/writer.rb +26 -17
  40. data/lib/rbs.rb +1 -0
  41. data/lib/rdoc_plugin/parser.rb +1 -1
  42. data/rbs.gemspec +1 -1
  43. data/schema/members.json +15 -10
  44. data/sig/collection/config/lockfile.rbs +80 -0
  45. data/sig/collection/config/lockfile_generator.rbs +55 -0
  46. data/sig/collection/config.rbs +5 -48
  47. data/sig/collection/installer.rbs +1 -1
  48. data/sig/collection/sources.rbs +66 -29
  49. data/sig/definition_builder.rbs +94 -81
  50. data/sig/environment_loader.rbs +1 -1
  51. data/sig/errors.rbs +21 -0
  52. data/sig/members.rbs +31 -7
  53. data/sig/prototype/node_usage.rbs +20 -0
  54. data/sig/shims/bundler.rbs +13 -0
  55. data/sig/shims/rubygems.rbs +9 -0
  56. data/sig/shims.rbs +0 -22
  57. data/sig/substitution.rbs +6 -0
  58. data/sig/writer.rbs +2 -0
  59. data/steep/Gemfile +3 -0
  60. data/steep/Gemfile.lock +61 -0
  61. metadata +13 -4
@@ -0,0 +1,13 @@
1
+ module Bundler
2
+ class LockfileParser
3
+ def initialize: (String) -> void
4
+ def specs: () -> Array[LazySpecification]
5
+ end
6
+
7
+ class LazySpecification
8
+ def name: () -> String
9
+ def version: () -> String
10
+ end
11
+
12
+ def self.default_lockfile: () -> Pathname
13
+ end
@@ -0,0 +1,9 @@
1
+ module Gem
2
+ class Specification
3
+ attr_reader version (): Version
4
+
5
+ attr_reader gem_dir (): String
6
+
7
+ def self.find_by_name: (String name, *String requirements) -> instance
8
+ end
9
+ end
data/sig/shims.rbs CHANGED
@@ -1,25 +1,3 @@
1
- module Gem
2
- class Specification
3
- attr_reader version (): Version
4
-
5
- attr_reader gem_dir (): String
6
-
7
- def self.find_by_name: (String name, *String requirements) -> instance
8
- end
9
- end
10
-
11
- module Bundler
12
- class LockfileParser
13
- def initialize: (String) -> void
14
- def specs: () -> Array[LazySpecification]
15
- end
16
-
17
- class LazySpecification
18
- def name: () -> String
19
- def version: () -> String
20
- end
21
- end
22
-
23
1
  module RDoc
24
2
  class Store
25
3
  def initialize: (?String? path, ?Symbol? type) -> void
data/sig/substitution.rbs CHANGED
@@ -38,5 +38,11 @@ module RBS
38
38
 
39
39
  # Returns true if given substitution is identity.
40
40
  def empty?: () -> bool
41
+
42
+ alias [] apply
43
+
44
+ # (s1 + s2)[t] == s2[s1[t]]
45
+ #
46
+ def +: (Substitution) -> Substitution
41
47
  end
42
48
  end
data/sig/writer.rbs CHANGED
@@ -94,6 +94,8 @@ module RBS
94
94
 
95
95
  def write_loc_source: (_Located) { () -> void } -> void
96
96
 
97
+ def format_annotation: (AST::Annotation) -> String
98
+
97
99
  def write_annotation: (Array[AST::Annotation]) -> void
98
100
 
99
101
  def write_comment: (AST::Comment?) -> void
data/steep/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem "steep"
@@ -0,0 +1,61 @@
1
+ GEM
2
+ remote: https://rubygems.org/
3
+ specs:
4
+ activesupport (7.0.4)
5
+ concurrent-ruby (~> 1.0, >= 1.0.2)
6
+ i18n (>= 1.6, < 2)
7
+ minitest (>= 5.1)
8
+ tzinfo (~> 2.0)
9
+ ast (2.4.2)
10
+ concurrent-ruby (1.1.10)
11
+ csv (3.2.5)
12
+ ffi (1.15.5)
13
+ fileutils (1.6.0)
14
+ i18n (1.12.0)
15
+ concurrent-ruby (~> 1.0)
16
+ json (2.6.2)
17
+ language_server-protocol (3.17.0.1)
18
+ listen (3.7.1)
19
+ rb-fsevent (~> 0.10, >= 0.10.3)
20
+ rb-inotify (~> 0.9, >= 0.9.10)
21
+ logger (1.5.1)
22
+ minitest (5.16.3)
23
+ parallel (1.22.1)
24
+ parser (3.1.2.1)
25
+ ast (~> 2.4.1)
26
+ rainbow (3.1.1)
27
+ rb-fsevent (0.11.2)
28
+ rb-inotify (0.10.1)
29
+ ffi (~> 1.0)
30
+ rbs (2.8.0)
31
+ securerandom (0.2.0)
32
+ steep (1.3.0)
33
+ activesupport (>= 5.1)
34
+ csv (>= 3.0.9)
35
+ fileutils (>= 1.1.0)
36
+ json (>= 2.1.0)
37
+ language_server-protocol (>= 3.15, < 4.0)
38
+ listen (~> 3.0)
39
+ logger (>= 1.3.0)
40
+ parallel (>= 1.0.0)
41
+ parser (>= 3.1)
42
+ rainbow (>= 2.2.2, < 4.0)
43
+ rbs (>= 2.8.0)
44
+ securerandom (>= 0.1)
45
+ strscan (>= 1.0.0)
46
+ terminal-table (>= 2, < 4)
47
+ strscan (3.0.4)
48
+ terminal-table (3.0.2)
49
+ unicode-display_width (>= 1.1.1, < 3)
50
+ tzinfo (2.0.5)
51
+ concurrent-ruby (~> 1.0)
52
+ unicode-display_width (2.3.0)
53
+
54
+ PLATFORMS
55
+ ruby
56
+
57
+ DEPENDENCIES
58
+ steep
59
+
60
+ BUNDLED WITH
61
+ 2.3.14
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbs
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.8.4
4
+ version: 3.0.0.dev.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Soutaro Matsumoto
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-01-20 00:00:00.000000000 Z
11
+ date: 2023-01-06 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: RBS is the language for type signatures for Ruby and standard library
14
14
  definitions.
@@ -159,6 +159,7 @@ files:
159
159
  - lib/rbs/collection.rb
160
160
  - lib/rbs/collection/cleaner.rb
161
161
  - lib/rbs/collection/config.rb
162
+ - lib/rbs/collection/config/lockfile.rb
162
163
  - lib/rbs/collection/config/lockfile_generator.rb
163
164
  - lib/rbs/collection/installer.rb
164
165
  - lib/rbs/collection/sources.rb
@@ -187,6 +188,7 @@ files:
187
188
  - lib/rbs/parser_compat/semantics_error.rb
188
189
  - lib/rbs/parser_compat/syntax_error.rb
189
190
  - lib/rbs/prototype/helpers.rb
191
+ - lib/rbs/prototype/node_usage.rb
190
192
  - lib/rbs/prototype/rb.rb
191
193
  - lib/rbs/prototype/rbi.rb
192
194
  - lib/rbs/prototype/runtime.rb
@@ -239,6 +241,8 @@ files:
239
241
  - sig/collection.rbs
240
242
  - sig/collection/cleaner.rbs
241
243
  - sig/collection/config.rbs
244
+ - sig/collection/config/lockfile.rbs
245
+ - sig/collection/config/lockfile_generator.rbs
242
246
  - sig/collection/installer.rbs
243
247
  - sig/collection/sources.rbs
244
248
  - sig/comment.rbs
@@ -261,6 +265,7 @@ files:
261
265
  - sig/namespace.rbs
262
266
  - sig/parser.rbs
263
267
  - sig/prototype/helpers.rbs
268
+ - sig/prototype/node_usage.rbs
264
269
  - sig/prototype/rb.rbs
265
270
  - sig/prototype/rbi.rbs
266
271
  - sig/rbs.rbs
@@ -271,9 +276,11 @@ files:
271
276
  - sig/resolver/type_name_resolver.rbs
272
277
  - sig/shims.rbs
273
278
  - sig/shims/abstract_syntax_tree.rbs
279
+ - sig/shims/bundler.rbs
274
280
  - sig/shims/enumerable.rbs
275
281
  - sig/shims/pp.rbs
276
282
  - sig/shims/ripper.rbs
283
+ - sig/shims/rubygems.rbs
277
284
  - sig/sorter.rbs
278
285
  - sig/substitution.rbs
279
286
  - sig/type_alias_dependency.rbs
@@ -416,6 +423,8 @@ files:
416
423
  - stdlib/yaml/0/store.rbs
417
424
  - stdlib/yaml/0/yaml.rbs
418
425
  - stdlib/zlib/0/zlib.rbs
426
+ - steep/Gemfile
427
+ - steep/Gemfile.lock
419
428
  homepage: https://github.com/ruby/rbs
420
429
  licenses:
421
430
  - BSD-2-Clause
@@ -435,9 +444,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
435
444
  version: '2.6'
436
445
  required_rubygems_version: !ruby/object:Gem::Requirement
437
446
  requirements:
438
- - - ">="
447
+ - - ">"
439
448
  - !ruby/object:Gem::Version
440
- version: '0'
449
+ version: 1.3.1
441
450
  requirements: []
442
451
  rubygems_version: 3.3.26
443
452
  signing_key: