rbs_protobuf 1.0.0 → 1.2.0

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.
@@ -1,76 +1,61 @@
1
1
  ---
2
2
  sources:
3
- - name: ruby/gem_rbs_collection
3
+ - type: git
4
+ name: ruby/gem_rbs_collection
5
+ revision: 5666e737d2b27a8425b4e3855c1a38cae54989f7
4
6
  remote: https://github.com/ruby/gem_rbs_collection.git
5
- revision: main
6
7
  repo_dir: gems
7
8
  path: ".gem_rbs_collection"
8
9
  gems:
9
- - name: rbs
10
- version: 2.3.2
10
+ - name: abbrev
11
+ version: '0'
11
12
  source:
12
- type: rubygems
13
+ type: stdlib
13
14
  - name: activesupport
14
- version: '6.0'
15
+ version: '7.0'
15
16
  source:
16
17
  type: git
17
18
  name: ruby/gem_rbs_collection
18
- revision: c7b9329222debd0b8a4a85c0ccdae6588fedd57a
19
+ revision: 8a678b2ec20e9d594055f53745399814e3a887dc
19
20
  remote: https://github.com/ruby/gem_rbs_collection.git
20
21
  repo_dir: gems
21
- - name: ast
22
- version: '2.4'
22
+ - name: concurrent-ruby
23
+ version: '1.1'
23
24
  source:
24
25
  type: git
25
26
  name: ruby/gem_rbs_collection
26
- revision: c7b9329222debd0b8a4a85c0ccdae6588fedd57a
27
+ revision: 8a678b2ec20e9d594055f53745399814e3a887dc
27
28
  remote: https://github.com/ruby/gem_rbs_collection.git
28
29
  repo_dir: gems
30
+ - name: date
31
+ version: '0'
32
+ source:
33
+ type: stdlib
29
34
  - name: i18n
30
35
  version: '1.10'
31
36
  source:
32
37
  type: git
33
38
  name: ruby/gem_rbs_collection
34
- revision: c7b9329222debd0b8a4a85c0ccdae6588fedd57a
39
+ revision: 8a678b2ec20e9d594055f53745399814e3a887dc
35
40
  remote: https://github.com/ruby/gem_rbs_collection.git
36
41
  repo_dir: gems
37
- - name: listen
38
- version: '3.2'
39
- source:
40
- type: git
41
- name: ruby/gem_rbs_collection
42
- revision: c7b9329222debd0b8a4a85c0ccdae6588fedd57a
43
- remote: https://github.com/ruby/gem_rbs_collection.git
44
- repo_dir: gems
45
- - name: parallel
46
- version: '1.20'
47
- source:
48
- type: git
49
- name: ruby/gem_rbs_collection
50
- revision: c7b9329222debd0b8a4a85c0ccdae6588fedd57a
51
- remote: https://github.com/ruby/gem_rbs_collection.git
52
- repo_dir: gems
53
- - name: rainbow
54
- version: '3.0'
42
+ - name: json
43
+ version: '0'
55
44
  source:
56
- type: git
57
- name: ruby/gem_rbs_collection
58
- revision: c7b9329222debd0b8a4a85c0ccdae6588fedd57a
59
- remote: https://github.com/ruby/gem_rbs_collection.git
60
- repo_dir: gems
45
+ type: stdlib
61
46
  - name: logger
62
47
  version: '0'
63
48
  source:
64
49
  type: stdlib
65
- - name: set
50
+ - name: minitest
66
51
  version: '0'
67
52
  source:
68
53
  type: stdlib
69
- - name: pathname
54
+ - name: monitor
70
55
  version: '0'
71
56
  source:
72
57
  type: stdlib
73
- - name: json
58
+ - name: mutex_m
74
59
  version: '0'
75
60
  source:
76
61
  type: stdlib
@@ -78,19 +63,27 @@ gems:
78
63
  version: '0'
79
64
  source:
80
65
  type: stdlib
81
- - name: rubygems
66
+ - name: pathname
82
67
  version: '0'
83
68
  source:
84
69
  type: stdlib
85
- - name: tsort
86
- version: '0'
70
+ - name: protobuf
71
+ version: 3.10.3
87
72
  source:
88
- type: stdlib
89
- - name: monitor
73
+ type: git
74
+ name: ruby/gem_rbs_collection
75
+ revision: 8a678b2ec20e9d594055f53745399814e3a887dc
76
+ remote: https://github.com/ruby/gem_rbs_collection.git
77
+ repo_dir: gems
78
+ - name: rbs
79
+ version: 3.1.3
80
+ source:
81
+ type: rubygems
82
+ - name: rdoc
90
83
  version: '0'
91
84
  source:
92
85
  type: stdlib
93
- - name: date
86
+ - name: securerandom
94
87
  version: '0'
95
88
  source:
96
89
  type: stdlib
@@ -98,11 +91,12 @@ gems:
98
91
  version: '0'
99
92
  source:
100
93
  type: stdlib
101
- - name: mutex_m
94
+ - name: time
102
95
  version: '0'
103
96
  source:
104
97
  type: stdlib
105
- - name: time
98
+ - name: tsort
106
99
  version: '0'
107
100
  source:
108
101
  type: stdlib
102
+ gemfile_lock_path: Gemfile.lock
data/rbs_collection.yaml CHANGED
@@ -8,12 +8,4 @@ sources:
8
8
  # A directory to install the downloaded RBSs
9
9
  path: .gem_rbs_collection
10
10
 
11
- gems:
12
- # Skip loading rbs gem's RBS.
13
- # It's unnecessary if you don't use rbs as a library.
14
- - name: rbs
15
- - name: activesupport
16
- - name: protobuf
17
- ignore: true
18
- - name: rbs_protobuf
19
- ignore: true
11
+ gems: []
@@ -10,7 +10,7 @@ module RBSProtobuf
10
10
 
11
11
  def singleton_type: (String | RBS::TypeName name) -> RBS::Types::ClassSingleton
12
12
 
13
- def union_type: (RBS::Types::t `type`, *RBS::Types::t types) -> RBS::Types::t
13
+ def union_type: (RBS::Types::t `type`, *RBS::Types::t? types) -> RBS::Types::t
14
14
 
15
15
  def nil_type: (?location: RBS::Location[untyped, untyped]?) -> RBS::Types::Bases::Nil
16
16
 
@@ -5,7 +5,15 @@ module RBSProtobuf
5
5
 
6
6
  attr_reader input: untyped
7
7
 
8
- def initialize: (untyped input) -> void
8
+ type filter = ^(String rbs_name, String rbs_content, Array[untyped] proto_files) -> [String, String]?
9
+
10
+ attr_reader filters: Array[filter]
11
+
12
+ attr_accessor rbs_concat_level: Integer?
13
+
14
+ def initialize: (untyped input, ?Array[filter] filters) -> void
15
+
16
+ def apply_filter: (String rbs_name, String rbs_content, Array[untyped] proto_file) -> [String, String]?
9
17
 
10
18
  @factory: RBSFactory
11
19
 
@@ -21,7 +29,9 @@ module RBSProtobuf
21
29
 
22
30
  def rbs_suffix: () -> ::String
23
31
 
24
- def rbs_content: (String file) -> String
32
+ def format_rbs: (?dirs: Array[RBS::AST::Directives::t], ?decls: Array[RBS::AST::Declarations::t]) -> String
33
+
34
+ def rbs_content: (String file) -> Array[RBS::AST::Declarations::t]
25
35
 
26
36
  def comment_for_path: (untyped source_code_info, Array[Integer] path, options: untyped) -> RBS::AST::Comment?
27
37
 
@@ -30,6 +40,8 @@ module RBSProtobuf
30
40
  def base_type: (untyped `type`) -> RBS::Types::t
31
41
 
32
42
  def message_type: (String) -> RBS::Types::ClassInstance
43
+
44
+ def optional_type: (RBS::Types::t) -> RBS::Types::Optional
33
45
  end
34
46
  end
35
47
  end
@@ -28,6 +28,7 @@ module RBSProtobuf
28
28
 
29
29
  def initialize: (
30
30
  untyped input,
31
+ ?Array[Base::filter] filters,
31
32
  upcase_enum: bool,
32
33
  nested_namespace: bool,
33
34
  extension: bool | :print | nil,
@@ -63,7 +64,7 @@ module RBSProtobuf
63
64
  # The entry point.
64
65
  # Generate RBS declarations from the `file` and returns the string representation of the declarations.
65
66
  #
66
- def rbs_content: (untyped file) -> String
67
+ def rbs_content: (untyped file) -> Array[RBS::AST::Declarations::t]
67
68
 
68
69
  # Returns the class declaration for given message.
69
70
  #
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rbs_protobuf
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.2.0
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-04-25 00:00:00.000000000 Z
11
+ date: 2023-09-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rbs
@@ -49,7 +49,6 @@ files:
49
49
  - ".github/workflows/test.yml"
50
50
  - ".gitignore"
51
51
  - ".gitmodules"
52
- - ".protoc-version"
53
52
  - ".rakeTasks"
54
53
  - ".travis.yml"
55
54
  - CHANGELOG.md
@@ -69,6 +68,7 @@ files:
69
68
  - example/a.proto
70
69
  - example/b.proto
71
70
  - example/c.proto
71
+ - example/d.proto
72
72
  - example/protobuf_gem_example.rb
73
73
  - exe/protoc-gen-rbs
74
74
  - lib/rbs_protobuf.rb
@@ -108,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
108
108
  - !ruby/object:Gem::Version
109
109
  version: '0'
110
110
  requirements: []
111
- rubygems_version: 3.3.7
111
+ rubygems_version: 3.4.10
112
112
  signing_key:
113
113
  specification_version: 4
114
114
  summary: Generate RBS files from .proto files
data/.protoc-version DELETED
@@ -1 +0,0 @@
1
- 3.9.0-square-1.0