rbs_activesupport 1.0.0 → 1.1.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.
- checksums.yaml +4 -4
- data/.vscode/settings.json +3 -1
- data/README.md +62 -0
- data/lib/rbs_activesupport/attribute_accessor.rb +10 -0
- data/lib/rbs_activesupport/class_attribute.rb +10 -0
- data/lib/rbs_activesupport/declaration_builder.rb +10 -8
- data/lib/rbs_activesupport/parser/comment_parser.rb +36 -0
- data/lib/rbs_activesupport/parser.rb +16 -4
- data/lib/rbs_activesupport/version.rb +1 -1
- data/lib/rbs_activesupport.rb +1 -0
- data/rbs_collection.lock.yaml +24 -20
- data/rbs_collection.yaml +2 -4
- data/sig/rbs_activesupport/attribute_accessor.rbs +1 -0
- data/sig/rbs_activesupport/class_attribute.rbs +1 -0
- data/sig/rbs_activesupport/parser/comment_parser.rbs +11 -0
- data/sig/rbs_activesupport/parser.rbs +5 -1
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4db817778f6845f92163a0f4d14691e8b5126535c05b740027d8f9326f64d268
|
4
|
+
data.tar.gz: 51043ad364a80c5db2d59128c3a68eafbdd30cfe15cc0a6782bdc98c92755abd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 33c9ccc927e7db87c937a82cc7b95919f39bdef2ba83c54dae7c8e20787f5e38f1c779a6914375cc47b2dbd9191a8dbec56f324e62e42ade0be19d57f7e383b3
|
7
|
+
data.tar.gz: 0f179597ae8b8ddd37f8ed42f912164a4aa16d3b0ef228a6c345070032e963d9d4e9e0b84287f42c0d2156f3d9775958b36ea91ebbae5f4e847391da192fef61
|
data/.vscode/settings.json
CHANGED
data/README.md
CHANGED
@@ -22,6 +22,68 @@ Run `rbs:activesupport:setup` task:
|
|
22
22
|
|
23
23
|
Then rbs_activesupport will scan your source code and generate RBS file into `sig/activesupport` directory.
|
24
24
|
|
25
|
+
rbs_activesupport will generate types for the following code:
|
26
|
+
|
27
|
+
* auto-extend on including ActiveSupport::Concern module
|
28
|
+
* delegate
|
29
|
+
* class_attribute, cattr_* and mattr_*
|
30
|
+
|
31
|
+
|
32
|
+
### auto-extend on including ActiveSupport::Concern module
|
33
|
+
|
34
|
+
The concern modules using `ActiveSupport::Concern` can provide the sub module named
|
35
|
+
`ClassMethods`. It is useful to define class methods to the including class.
|
36
|
+
|
37
|
+
Extending the `ClassMethods` on including the concern module goes automatically and
|
38
|
+
silently. So developers who uses the concern modules don't know the concern modules
|
39
|
+
automatically call "extend" in the background.
|
40
|
+
|
41
|
+
On the other hand, in the Type World, Steep and RBS does not support auto-extending.
|
42
|
+
Therefore we need to define the "extend" call manually.
|
43
|
+
|
44
|
+
For example, we need to write the "extend" call like the following:
|
45
|
+
|
46
|
+
```ruby
|
47
|
+
# user.rbs
|
48
|
+
class User
|
49
|
+
include ActiveModel::Attribute
|
50
|
+
extend ActiveModel::Attribute::ClassMethods
|
51
|
+
end
|
52
|
+
```
|
53
|
+
|
54
|
+
rbs_activesupport detects the including concern modules and generates the "extend"
|
55
|
+
call automatically if the concern modules have `ClassMethods` module.
|
56
|
+
|
57
|
+
### delegate
|
58
|
+
|
59
|
+
ActiveSupport provides `delegate` method to delegate the method calls to the other
|
60
|
+
objects. It's very useful and powerful.
|
61
|
+
|
62
|
+
But RBS generators like `rbs prototype rb` and `rbs-inline` does not support it.
|
63
|
+
As a result, the delegation methods are missing in the RBS files.
|
64
|
+
|
65
|
+
rbs_activesupport detects the `delegate` method call and generates the types for
|
66
|
+
them automatically.
|
67
|
+
|
68
|
+
### class_attribute, cattr_* and mattr_*
|
69
|
+
|
70
|
+
ActiveSupport provides some methods to define class attributes and accessors:
|
71
|
+
|
72
|
+
* `class_attribute`
|
73
|
+
* `cattr_accessor`, `cattr_reader`, `cattr_writer`
|
74
|
+
* `mattr_accessor`, `mattr_reader`, `mattr_writer`
|
75
|
+
|
76
|
+
rbs_activesupport detects the calls of these methods and generates the types
|
77
|
+
for them.
|
78
|
+
|
79
|
+
Additionally, rbs_activesupport also supports the type annotation comment like RBS::Inline.
|
80
|
+
|
81
|
+
```ruby
|
82
|
+
class User
|
83
|
+
class_attribute :name #: String
|
84
|
+
end
|
85
|
+
```
|
86
|
+
|
25
87
|
## Development
|
26
88
|
|
27
89
|
After checking out the repo, run `bin/setup` to install dependencies. You can also
|
@@ -9,6 +9,16 @@ module RbsActivesupport
|
|
9
9
|
@options = options
|
10
10
|
end
|
11
11
|
|
12
|
+
def type
|
13
|
+
# @type var trailng_comment: String?
|
14
|
+
trailing_comment = options[:trailing_comment]
|
15
|
+
if trailing_comment&.start_with?("#:")
|
16
|
+
trailing_comment[2..].strip
|
17
|
+
else
|
18
|
+
"untyped"
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
12
22
|
def singleton_reader?
|
13
23
|
options.fetch(:singleton_reader, true)
|
14
24
|
end
|
@@ -9,6 +9,16 @@ module RbsActivesupport
|
|
9
9
|
@options = options
|
10
10
|
end
|
11
11
|
|
12
|
+
def type
|
13
|
+
# @type var trailng_comment: String?
|
14
|
+
trailing_comment = options[:trailing_comment]
|
15
|
+
if trailing_comment&.start_with?("#:")
|
16
|
+
trailing_comment[2..].strip
|
17
|
+
else
|
18
|
+
"untyped"
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
12
22
|
def instance_accessor?
|
13
23
|
options.fetch(:instance_accessor, true)
|
14
24
|
end
|
@@ -43,6 +43,7 @@ module RbsActivesupport
|
|
43
43
|
options[:instance_reader] = false if %i[cattr_writer mattr_writer].include?(method_call.name)
|
44
44
|
options[:instance_writer] = false if %i[cattr_reader mattr_reader].include?(method_call.name)
|
45
45
|
options[:private] = true if method_call.private?
|
46
|
+
options[:trailing_comment] = method_call.trailing_comment
|
46
47
|
methods.map do |method|
|
47
48
|
AttributeAccessor.new(method, options)
|
48
49
|
end
|
@@ -51,6 +52,7 @@ module RbsActivesupport
|
|
51
52
|
def build_class_attribute(method_call)
|
52
53
|
methods, options = eval_args_with_options(method_call.args)
|
53
54
|
options[:private] = true if method_call.private?
|
55
|
+
options[:trailing_comment] = method_call.trailing_comment
|
54
56
|
methods.map do |method|
|
55
57
|
ClassAttribute.new(method, options)
|
56
58
|
end
|
@@ -86,20 +88,20 @@ module RbsActivesupport
|
|
86
88
|
|
87
89
|
def render_attribute_accessor(decl)
|
88
90
|
methods = []
|
89
|
-
methods << "def self.#{decl.name}: () ->
|
90
|
-
methods << "def self.#{decl.name}=: (
|
91
|
-
methods << "def #{decl.name}: () ->
|
92
|
-
methods << "def #{decl.name}=: (
|
91
|
+
methods << "def self.#{decl.name}: () -> (#{decl.type})" if decl.singleton_reader?
|
92
|
+
methods << "def self.#{decl.name}=: (#{decl.type}) -> (#{decl.type})" if decl.singleton_writer?
|
93
|
+
methods << "def #{decl.name}: () -> (#{decl.type})" if decl.instance_reader?
|
94
|
+
methods << "def #{decl.name}=: (#{decl.type}) -> (#{decl.type})" if decl.instance_writer?
|
93
95
|
methods.join("\n")
|
94
96
|
end
|
95
97
|
|
96
98
|
def render_class_attribute(decl)
|
97
99
|
methods = []
|
98
|
-
methods << "def self.#{decl.name}: () ->
|
99
|
-
methods << "def self.#{decl.name}=: (
|
100
|
+
methods << "def self.#{decl.name}: () -> (#{decl.type})"
|
101
|
+
methods << "def self.#{decl.name}=: (#{decl.type}) -> (#{decl.type})"
|
100
102
|
methods << "def self.#{decl.name}?: () -> bool" if decl.instance_predicate?
|
101
|
-
methods << "def #{decl.name}: () ->
|
102
|
-
methods << "def #{decl.name}=: (
|
103
|
+
methods << "def #{decl.name}: () -> (#{decl.type})" if decl.instance_reader?
|
104
|
+
methods << "def #{decl.name}=: (#{decl.type}) -> (#{decl.type})" if decl.instance_writer?
|
103
105
|
methods << "def #{decl.name}?: () -> bool" if decl.instance_predicate? && decl.instance_reader?
|
104
106
|
methods.join("\n")
|
105
107
|
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module RbsActivesupport
|
4
|
+
class Parser
|
5
|
+
class CommentParser
|
6
|
+
attr_reader :line_comments, :trailing_comments
|
7
|
+
|
8
|
+
def initialize
|
9
|
+
@line_comments = {}
|
10
|
+
@trailing_comments = {}
|
11
|
+
end
|
12
|
+
|
13
|
+
def parse(string)
|
14
|
+
# @type var code_lines: Hash[Integer, bool]
|
15
|
+
code_lines = {}
|
16
|
+
Ripper.lex(string).each do |(line, _), type, token, _|
|
17
|
+
case type
|
18
|
+
when :on_sp, :on_ignored_nl
|
19
|
+
# ignore
|
20
|
+
when :on_comment
|
21
|
+
if code_lines[line]
|
22
|
+
trailing_comments[line] = token.chomp
|
23
|
+
else
|
24
|
+
line_comments[line] = token.chomp
|
25
|
+
end
|
26
|
+
:here
|
27
|
+
else
|
28
|
+
code_lines[line] = true
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
self
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
@@ -8,12 +8,13 @@ require "rbs/prototype/rb"
|
|
8
8
|
module RbsActivesupport
|
9
9
|
class Parser < ::RBS::Prototype::RB
|
10
10
|
class MethodCall
|
11
|
-
attr_reader :name, :args
|
11
|
+
attr_reader :name, :args, :trailing_comment
|
12
12
|
|
13
|
-
def initialize(name, args, private)
|
13
|
+
def initialize(name, args, private, trailing_comment: nil)
|
14
14
|
@name = name
|
15
15
|
@args = args
|
16
16
|
@private = private
|
17
|
+
@trailing_comment = trailing_comment
|
17
18
|
end
|
18
19
|
|
19
20
|
def private?
|
@@ -27,20 +28,27 @@ module RbsActivesupport
|
|
27
28
|
|
28
29
|
alias process_orig process
|
29
30
|
|
30
|
-
attr_reader :method_calls
|
31
|
+
attr_reader :comment_parser, :method_calls
|
31
32
|
|
32
33
|
def initialize
|
33
34
|
super
|
35
|
+
@comment_parser = CommentParser.new
|
34
36
|
@method_calls = Hash.new { |hash, key| hash[key] = [] }
|
35
37
|
end
|
36
38
|
|
39
|
+
def parse(string)
|
40
|
+
comment_parser.parse(string)
|
41
|
+
super
|
42
|
+
end
|
43
|
+
|
37
44
|
def process(node, decls:, comments:, context:)
|
38
45
|
case node.type
|
39
46
|
when :FCALL, :VCALL
|
40
47
|
args = node.children[1]&.children || []
|
41
48
|
case node.children[0]
|
42
49
|
when *METHODS
|
43
|
-
@method_calls[context.namespace] << MethodCall.new(node.children[0], args, private?(decls)
|
50
|
+
@method_calls[context.namespace] << MethodCall.new(node.children[0], args, private?(decls),
|
51
|
+
trailing_comment: trailing_comment_for(node))
|
44
52
|
else
|
45
53
|
process_orig(node, decls: decls, comments: comments, context: context)
|
46
54
|
end
|
@@ -49,6 +57,10 @@ module RbsActivesupport
|
|
49
57
|
end
|
50
58
|
end
|
51
59
|
|
60
|
+
def trailing_comment_for(node)
|
61
|
+
comment_parser.trailing_comments[node.last_lineno]
|
62
|
+
end
|
63
|
+
|
52
64
|
def private?(decls)
|
53
65
|
current_accessibility(decls) == private
|
54
66
|
end
|
data/lib/rbs_activesupport.rb
CHANGED
@@ -9,6 +9,7 @@ require_relative "rbs_activesupport/generator"
|
|
9
9
|
require_relative "rbs_activesupport/include"
|
10
10
|
require_relative "rbs_activesupport/method_searcher"
|
11
11
|
require_relative "rbs_activesupport/parser"
|
12
|
+
require_relative "rbs_activesupport/parser/comment_parser"
|
12
13
|
require_relative "rbs_activesupport/version"
|
13
14
|
|
14
15
|
module RbsActivesupport
|
data/rbs_collection.lock.yaml
CHANGED
@@ -6,7 +6,7 @@ gems:
|
|
6
6
|
source:
|
7
7
|
type: git
|
8
8
|
name: ruby/gem_rbs_collection
|
9
|
-
revision:
|
9
|
+
revision: e9bc1bf94c262e79a2d599a9c173342915b29808
|
10
10
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
11
11
|
repo_dir: gems
|
12
12
|
- name: actionview
|
@@ -14,7 +14,7 @@ gems:
|
|
14
14
|
source:
|
15
15
|
type: git
|
16
16
|
name: ruby/gem_rbs_collection
|
17
|
-
revision:
|
17
|
+
revision: e9bc1bf94c262e79a2d599a9c173342915b29808
|
18
18
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
19
19
|
repo_dir: gems
|
20
20
|
- name: activesupport
|
@@ -22,7 +22,7 @@ gems:
|
|
22
22
|
source:
|
23
23
|
type: git
|
24
24
|
name: ruby/gem_rbs_collection
|
25
|
-
revision:
|
25
|
+
revision: e9bc1bf94c262e79a2d599a9c173342915b29808
|
26
26
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
27
27
|
repo_dir: gems
|
28
28
|
- name: ast
|
@@ -30,7 +30,7 @@ gems:
|
|
30
30
|
source:
|
31
31
|
type: git
|
32
32
|
name: ruby/gem_rbs_collection
|
33
|
-
revision:
|
33
|
+
revision: e9bc1bf94c262e79a2d599a9c173342915b29808
|
34
34
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
35
35
|
repo_dir: gems
|
36
36
|
- name: base64
|
@@ -50,7 +50,7 @@ gems:
|
|
50
50
|
source:
|
51
51
|
type: git
|
52
52
|
name: ruby/gem_rbs_collection
|
53
|
-
revision:
|
53
|
+
revision: e9bc1bf94c262e79a2d599a9c173342915b29808
|
54
54
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
55
55
|
repo_dir: gems
|
56
56
|
- name: connection_pool
|
@@ -58,7 +58,7 @@ gems:
|
|
58
58
|
source:
|
59
59
|
type: git
|
60
60
|
name: ruby/gem_rbs_collection
|
61
|
-
revision:
|
61
|
+
revision: e9bc1bf94c262e79a2d599a9c173342915b29808
|
62
62
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
63
63
|
repo_dir: gems
|
64
64
|
- name: date
|
@@ -82,7 +82,7 @@ gems:
|
|
82
82
|
source:
|
83
83
|
type: git
|
84
84
|
name: ruby/gem_rbs_collection
|
85
|
-
revision:
|
85
|
+
revision: e9bc1bf94c262e79a2d599a9c173342915b29808
|
86
86
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
87
87
|
repo_dir: gems
|
88
88
|
- name: io-console
|
@@ -114,7 +114,7 @@ gems:
|
|
114
114
|
source:
|
115
115
|
type: git
|
116
116
|
name: ruby/gem_rbs_collection
|
117
|
-
revision:
|
117
|
+
revision: e9bc1bf94c262e79a2d599a9c173342915b29808
|
118
118
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
119
119
|
repo_dir: gems
|
120
120
|
- name: optparse
|
@@ -126,7 +126,7 @@ gems:
|
|
126
126
|
source:
|
127
127
|
type: git
|
128
128
|
name: ruby/gem_rbs_collection
|
129
|
-
revision:
|
129
|
+
revision: e9bc1bf94c262e79a2d599a9c173342915b29808
|
130
130
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
131
131
|
repo_dir: gems
|
132
132
|
- name: parser
|
@@ -134,7 +134,7 @@ gems:
|
|
134
134
|
source:
|
135
135
|
type: git
|
136
136
|
name: ruby/gem_rbs_collection
|
137
|
-
revision:
|
137
|
+
revision: e9bc1bf94c262e79a2d599a9c173342915b29808
|
138
138
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
139
139
|
repo_dir: gems
|
140
140
|
- name: pathname
|
@@ -154,7 +154,7 @@ gems:
|
|
154
154
|
source:
|
155
155
|
type: git
|
156
156
|
name: ruby/gem_rbs_collection
|
157
|
-
revision:
|
157
|
+
revision: e9bc1bf94c262e79a2d599a9c173342915b29808
|
158
158
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
159
159
|
repo_dir: gems
|
160
160
|
- name: rails-dom-testing
|
@@ -162,7 +162,7 @@ gems:
|
|
162
162
|
source:
|
163
163
|
type: git
|
164
164
|
name: ruby/gem_rbs_collection
|
165
|
-
revision:
|
165
|
+
revision: e9bc1bf94c262e79a2d599a9c173342915b29808
|
166
166
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
167
167
|
repo_dir: gems
|
168
168
|
- name: railties
|
@@ -170,7 +170,7 @@ gems:
|
|
170
170
|
source:
|
171
171
|
type: git
|
172
172
|
name: ruby/gem_rbs_collection
|
173
|
-
revision:
|
173
|
+
revision: e9bc1bf94c262e79a2d599a9c173342915b29808
|
174
174
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
175
175
|
repo_dir: gems
|
176
176
|
- name: rainbow
|
@@ -178,7 +178,7 @@ gems:
|
|
178
178
|
source:
|
179
179
|
type: git
|
180
180
|
name: ruby/gem_rbs_collection
|
181
|
-
revision:
|
181
|
+
revision: e9bc1bf94c262e79a2d599a9c173342915b29808
|
182
182
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
183
183
|
repo_dir: gems
|
184
184
|
- name: rake
|
@@ -186,7 +186,7 @@ gems:
|
|
186
186
|
source:
|
187
187
|
type: git
|
188
188
|
name: ruby/gem_rbs_collection
|
189
|
-
revision:
|
189
|
+
revision: e9bc1bf94c262e79a2d599a9c173342915b29808
|
190
190
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
191
191
|
repo_dir: gems
|
192
192
|
- name: rbs
|
@@ -202,15 +202,19 @@ gems:
|
|
202
202
|
source:
|
203
203
|
type: git
|
204
204
|
name: ruby/gem_rbs_collection
|
205
|
-
revision:
|
205
|
+
revision: e9bc1bf94c262e79a2d599a9c173342915b29808
|
206
206
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
207
207
|
repo_dir: gems
|
208
|
+
- name: ripper
|
209
|
+
version: '0'
|
210
|
+
source:
|
211
|
+
type: stdlib
|
208
212
|
- name: rubocop
|
209
213
|
version: '1.57'
|
210
214
|
source:
|
211
215
|
type: git
|
212
216
|
name: ruby/gem_rbs_collection
|
213
|
-
revision:
|
217
|
+
revision: e9bc1bf94c262e79a2d599a9c173342915b29808
|
214
218
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
215
219
|
repo_dir: gems
|
216
220
|
- name: rubocop-ast
|
@@ -218,7 +222,7 @@ gems:
|
|
218
222
|
source:
|
219
223
|
type: git
|
220
224
|
name: ruby/gem_rbs_collection
|
221
|
-
revision:
|
225
|
+
revision: e9bc1bf94c262e79a2d599a9c173342915b29808
|
222
226
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
223
227
|
repo_dir: gems
|
224
228
|
- name: securerandom
|
@@ -242,7 +246,7 @@ gems:
|
|
242
246
|
source:
|
243
247
|
type: git
|
244
248
|
name: ruby/gem_rbs_collection
|
245
|
-
revision:
|
249
|
+
revision: e9bc1bf94c262e79a2d599a9c173342915b29808
|
246
250
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
247
251
|
repo_dir: gems
|
248
252
|
- name: time
|
@@ -262,7 +266,7 @@ gems:
|
|
262
266
|
source:
|
263
267
|
type: git
|
264
268
|
name: ruby/gem_rbs_collection
|
265
|
-
revision:
|
269
|
+
revision: e9bc1bf94c262e79a2d599a9c173342915b29808
|
266
270
|
remote: https://github.com/ruby/gem_rbs_collection.git
|
267
271
|
repo_dir: gems
|
268
272
|
- name: uri
|
data/rbs_collection.yaml
CHANGED
@@ -4,6 +4,7 @@ module RbsActivesupport
|
|
4
4
|
attr_reader options: Hash[untyped, untyped]
|
5
5
|
|
6
6
|
def initialize: (Symbol name, Hash[untyped, untyped] options) -> void
|
7
|
+
def type: () -> String
|
7
8
|
def singleton_reader?: () -> bool
|
8
9
|
def singleton_writer?: () -> bool
|
9
10
|
def instance_accessor?: () -> bool
|
@@ -4,6 +4,7 @@ module RbsActivesupport
|
|
4
4
|
attr_reader options: Hash[untyped, untyped]
|
5
5
|
|
6
6
|
def initialize: (Symbol name, Hash[untyped, untyped] options) -> void
|
7
|
+
def type: () -> String
|
7
8
|
def instance_accessor?: () -> bool
|
8
9
|
def instance_reader?: () -> bool
|
9
10
|
def instance_writer?: () -> bool
|
@@ -3,10 +3,11 @@ module RbsActivesupport
|
|
3
3
|
class MethodCall
|
4
4
|
attr_reader name: t
|
5
5
|
attr_reader args: Array[RubyVM::AbstractSyntaxTree::Node]
|
6
|
+
attr_reader trailing_comment: String?
|
6
7
|
|
7
8
|
@private: bool
|
8
9
|
|
9
|
-
def initialize: (t name, Array[RubyVM::AbstractSyntaxTree::Node] args, bool private) -> void
|
10
|
+
def initialize: (t name, Array[RubyVM::AbstractSyntaxTree::Node] args, bool private, ?trailing_comment: String?) -> void
|
10
11
|
def private?: () -> bool
|
11
12
|
end
|
12
13
|
|
@@ -15,8 +16,11 @@ module RbsActivesupport
|
|
15
16
|
|
16
17
|
alias process_orig process
|
17
18
|
|
19
|
+
attr_reader comment_parser: CommentParser
|
18
20
|
attr_reader method_calls: Hash[RBS::Namespace, Array[MethodCall]]
|
19
21
|
|
22
|
+
def parse: (String) -> void
|
23
|
+
def trailing_comment_for: (RubyVM::AbstractSyntaxTree::Node) -> String?
|
20
24
|
def private?: (Array[RBS::AST::Declarations::t | RBS::AST::Members::t] decls) -> bool
|
21
25
|
end
|
22
26
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rbs_activesupport
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Takeshi KOMIYA
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-09-
|
11
|
+
date: 2024-09-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -78,6 +78,7 @@ files:
|
|
78
78
|
- lib/rbs_activesupport/include.rb
|
79
79
|
- lib/rbs_activesupport/method_searcher.rb
|
80
80
|
- lib/rbs_activesupport/parser.rb
|
81
|
+
- lib/rbs_activesupport/parser/comment_parser.rb
|
81
82
|
- lib/rbs_activesupport/rake_task.rb
|
82
83
|
- lib/rbs_activesupport/version.rb
|
83
84
|
- rbs_collection.lock.yaml
|
@@ -92,6 +93,7 @@ files:
|
|
92
93
|
- sig/rbs_activesupport/include.rbs
|
93
94
|
- sig/rbs_activesupport/method_searcher.rbs
|
94
95
|
- sig/rbs_activesupport/parser.rbs
|
96
|
+
- sig/rbs_activesupport/parser/comment_parser.rbs
|
95
97
|
- sig/rbs_activesupport/rake_task.rbs
|
96
98
|
homepage: https://github.com/tk0miya/rbs_activesupport
|
97
99
|
licenses:
|
@@ -115,7 +117,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
115
117
|
- !ruby/object:Gem::Version
|
116
118
|
version: '0'
|
117
119
|
requirements: []
|
118
|
-
rubygems_version: 3.5.
|
120
|
+
rubygems_version: 3.5.16
|
119
121
|
signing_key:
|
120
122
|
specification_version: 4
|
121
123
|
summary: A RBS files generatorfor activesupport
|