rbs 2.8.2 → 3.0.0.dev.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/comments.yml +1 -1
  3. data/.github/workflows/ruby.yml +9 -6
  4. data/CHANGELOG.md +0 -14
  5. data/Gemfile +1 -1
  6. data/Gemfile.lock +16 -16
  7. data/ext/rbs_extension/constants.c +2 -0
  8. data/ext/rbs_extension/constants.h +1 -0
  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/schema/members.json +15 -10
  43. data/sig/collection/config/lockfile.rbs +80 -0
  44. data/sig/collection/config/lockfile_generator.rbs +55 -0
  45. data/sig/collection/config.rbs +5 -48
  46. data/sig/collection/installer.rbs +1 -1
  47. data/sig/collection/sources.rbs +66 -29
  48. data/sig/definition_builder.rbs +94 -81
  49. data/sig/environment_loader.rbs +1 -1
  50. data/sig/errors.rbs +21 -0
  51. data/sig/members.rbs +31 -7
  52. data/sig/prototype/node_usage.rbs +20 -0
  53. data/sig/shims/bundler.rbs +13 -0
  54. data/sig/shims/rubygems.rbs +9 -0
  55. data/sig/shims.rbs +0 -22
  56. data/sig/substitution.rbs +6 -0
  57. data/sig/writer.rbs +2 -0
  58. metadata +11 -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
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.2
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: 2022-12-21 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
@@ -437,9 +444,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
437
444
  version: '2.6'
438
445
  required_rubygems_version: !ruby/object:Gem::Requirement
439
446
  requirements:
440
- - - ">="
447
+ - - ">"
441
448
  - !ruby/object:Gem::Version
442
- version: '0'
449
+ version: 1.3.1
443
450
  requirements: []
444
451
  rubygems_version: 3.3.26
445
452
  signing_key: