rbs_activesupport 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.
- checksums.yaml +4 -4
- data/.rubocop.yml +9 -0
- data/.vscode/settings.json +6 -2
- data/README.md +69 -0
- data/lib/generators/rbs_activesupport/install_generator.rb +2 -0
- data/lib/rbs_activesupport/ast.rb +4 -2
- data/lib/rbs_activesupport/attribute_accessor.rb +22 -9
- data/lib/rbs_activesupport/class_attribute.rb +21 -8
- data/lib/rbs_activesupport/declaration_builder.rb +41 -21
- data/lib/rbs_activesupport/delegate.rb +11 -6
- data/lib/rbs_activesupport/generator.rb +18 -8
- data/lib/rbs_activesupport/include.rb +14 -8
- data/lib/rbs_activesupport/method_searcher.rb +8 -4
- data/lib/rbs_activesupport/parser/comment_parser.rb +38 -0
- data/lib/rbs_activesupport/parser.rb +37 -8
- data/lib/rbs_activesupport/rake_task.rb +21 -12
- 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/generators/rbs_activesupport/install_generator.rbs +7 -0
- data/sig/rbs_activesupport/ast.rbs +8 -2
- data/sig/rbs_activesupport/attribute_accessor.rbs +14 -0
- data/sig/rbs_activesupport/class_attribute.rbs +13 -0
- data/sig/rbs_activesupport/declaration_builder.rbs +32 -4
- data/sig/rbs_activesupport/delegate.rbs +11 -0
- data/sig/rbs_activesupport/generator.rbs +14 -0
- data/sig/rbs_activesupport/include.rbs +14 -0
- data/sig/rbs_activesupport/method_searcher.rbs +8 -1
- data/sig/rbs_activesupport/parser/comment_parser.rbs +16 -0
- data/sig/rbs_activesupport/parser.rbs +28 -1
- data/sig/rbs_activesupport/rake_task.rbs +10 -0
- data/sig/rbs_activesupport/version.rbs +5 -0
- data/sig/rbs_activesupport.rbs +4 -2
- metadata +7 -3
@@ -8,39 +8,62 @@ require "rbs/prototype/rb"
|
|
8
8
|
module RbsActivesupport
|
9
9
|
class Parser < ::RBS::Prototype::RB
|
10
10
|
class MethodCall
|
11
|
-
attr_reader :name
|
11
|
+
attr_reader :name #: t
|
12
|
+
attr_reader :args #: Array[RubyVM::AbstractSyntaxTree::Node]
|
13
|
+
attr_reader :trailing_comment #: String?
|
12
14
|
|
13
|
-
|
15
|
+
# @rbs @private: bool
|
16
|
+
|
17
|
+
# @rbs name: t
|
18
|
+
# @rbs args: Array[RubyVM::AbstractSyntaxTree::Node]
|
19
|
+
# @rbs private: bool
|
20
|
+
# @rbs trailing_comment: String?
|
21
|
+
def initialize(name, args, private, trailing_comment: nil) #: void
|
14
22
|
@name = name
|
15
23
|
@args = args
|
16
24
|
@private = private
|
25
|
+
@trailing_comment = trailing_comment
|
17
26
|
end
|
18
27
|
|
19
|
-
def private?
|
28
|
+
def private? #: bool
|
20
29
|
@private
|
21
30
|
end
|
22
31
|
end
|
23
32
|
|
33
|
+
# @rbs!
|
34
|
+
# type t = :class_attribute | :delegate | :cattr_accessor | :mattr_accessor | :cattr_reader | :mattr_reader |
|
35
|
+
# :cattr_writer | :mattr_writer | :include
|
36
|
+
|
24
37
|
METHODS = %i[
|
25
38
|
class_attribute delegate cattr_accessor mattr_accessor cattr_reader mattr_reader cattr_writer mattr_writer include
|
26
|
-
].freeze # steep:ignore IncompatibleAssignment
|
39
|
+
].freeze #: Array[t] # steep:ignore IncompatibleAssignment
|
27
40
|
|
28
41
|
alias process_orig process
|
29
42
|
|
30
|
-
attr_reader :
|
43
|
+
attr_reader :comment_parser #: CommentParser
|
44
|
+
attr_reader :method_calls #: Hash[RBS::Namespace, Array[MethodCall]]
|
31
45
|
|
32
|
-
def initialize
|
46
|
+
def initialize #: void
|
33
47
|
super
|
48
|
+
@comment_parser = CommentParser.new
|
34
49
|
@method_calls = Hash.new { |hash, key| hash[key] = [] }
|
35
50
|
end
|
36
51
|
|
52
|
+
# @rbs string: String
|
53
|
+
def parse(string) #: void
|
54
|
+
comment_parser.parse(string)
|
55
|
+
super
|
56
|
+
end
|
57
|
+
|
58
|
+
# @rbs override
|
37
59
|
def process(node, decls:, comments:, context:)
|
38
60
|
case node.type
|
39
61
|
when :FCALL, :VCALL
|
40
62
|
args = node.children[1]&.children || []
|
41
63
|
case node.children[0]
|
42
64
|
when *METHODS
|
43
|
-
@method_calls[context.namespace] << MethodCall.new(node.children[0], args, private?(decls)
|
65
|
+
@method_calls[context.namespace] << MethodCall.new(node.children[0], args, private?(decls),
|
66
|
+
trailing_comment: trailing_comment_for(node))
|
44
67
|
else
|
45
68
|
process_orig(node, decls: decls, comments: comments, context: context)
|
46
69
|
end
|
@@ -49,7 +72,13 @@ module RbsActivesupport
|
|
49
72
|
end
|
50
73
|
end
|
51
74
|
|
52
|
-
|
75
|
+
# @rbs node: RubyVM::AbstractSyntaxTree::Node
|
76
|
+
def trailing_comment_for(node) #: String?
|
77
|
+
comment_parser.trailing_comments[node.last_lineno]
|
78
|
+
end
|
79
|
+
|
80
|
+
# @rbs decls: Array[RBS::AST::Declarations::t | RBS::AST::Members::t]
|
81
|
+
def private?(decls) #: bool
|
53
82
|
current_accessibility(decls) == private
|
54
83
|
end
|
55
84
|
end
|
@@ -5,13 +5,20 @@ require "rake/tasklib"
|
|
5
5
|
|
6
6
|
module RbsActivesupport
|
7
7
|
class RakeTask < Rake::TaskLib
|
8
|
-
attr_accessor :name
|
8
|
+
attr_accessor :name #: Symbol
|
9
|
+
attr_accessor :signature_root_dir #: Pathname
|
10
|
+
attr_accessor :target_directories #: Array[Pathname]
|
9
11
|
|
10
|
-
|
12
|
+
# @rbs @rbs_builder: RBS::DefinitionBuilder
|
13
|
+
|
14
|
+
# @rbs name: Symbol
|
15
|
+
# @rbs &block: ?(self) -> void
|
16
|
+
def initialize(name = :'rbs:activesupport', &block) #: void
|
11
17
|
super()
|
12
18
|
|
13
19
|
@name = name
|
14
20
|
@signature_root_dir = Pathname(Rails.root / "sig/activesupport")
|
21
|
+
@target_directories = [Rails.root / "app"]
|
15
22
|
|
16
23
|
block&.call(self)
|
17
24
|
|
@@ -20,14 +27,14 @@ module RbsActivesupport
|
|
20
27
|
define_setup_task
|
21
28
|
end
|
22
29
|
|
23
|
-
def define_setup_task
|
30
|
+
def define_setup_task #: void
|
24
31
|
desc "Run all tasks of rbs_activesupport"
|
25
32
|
|
26
33
|
deps = [:"#{name}:clean", :"#{name}:generate"]
|
27
34
|
task("#{name}:setup" => deps)
|
28
35
|
end
|
29
36
|
|
30
|
-
def define_generate_task
|
37
|
+
def define_generate_task #: void
|
31
38
|
desc "Generate RBS files for activesupport gem"
|
32
39
|
task("#{name}:generate": :environment) do
|
33
40
|
require "rbs_activesupport" # load RbsActivesupport lazily
|
@@ -36,18 +43,20 @@ module RbsActivesupport
|
|
36
43
|
|
37
44
|
signature_root_dir.mkpath
|
38
45
|
|
39
|
-
|
40
|
-
|
41
|
-
|
46
|
+
target_directories.each do |dir|
|
47
|
+
dir.glob("**/*.rb").each do |file|
|
48
|
+
rbs = Generator.new(file, rbs_builder).generate
|
49
|
+
next unless rbs
|
42
50
|
|
43
|
-
|
44
|
-
|
45
|
-
|
51
|
+
rbs_path = signature_root_dir / file.sub_ext(".rbs").relative_path_from(Rails.root)
|
52
|
+
rbs_path.dirname.mkpath
|
53
|
+
rbs_path.write(rbs)
|
54
|
+
end
|
46
55
|
end
|
47
56
|
end
|
48
57
|
end
|
49
58
|
|
50
|
-
def define_clean_task
|
59
|
+
def define_clean_task #: void
|
51
60
|
desc "Clean RBS files for config gem"
|
52
61
|
task "#{name}:clean" do
|
53
62
|
signature_root_dir.rmtree if signature_root_dir.exist?
|
@@ -56,7 +65,7 @@ module RbsActivesupport
|
|
56
65
|
|
57
66
|
private
|
58
67
|
|
59
|
-
def rbs_builder
|
68
|
+
def rbs_builder #: RBS::DefinitionBuilder
|
60
69
|
@rbs_builder ||= begin
|
61
70
|
loader = RBS::CLI::LibraryOptions.new.loader
|
62
71
|
loader.add(path: Pathname("sig"))
|
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: 4f55d83688a772342f0d96966cd51d06af03c2c8
|
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: 4f55d83688a772342f0d96966cd51d06af03c2c8
|
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: 4f55d83688a772342f0d96966cd51d06af03c2c8
|
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: 4f55d83688a772342f0d96966cd51d06af03c2c8
|
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: 4f55d83688a772342f0d96966cd51d06af03c2c8
|
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: 4f55d83688a772342f0d96966cd51d06af03c2c8
|
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: 4f55d83688a772342f0d96966cd51d06af03c2c8
|
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: 4f55d83688a772342f0d96966cd51d06af03c2c8
|
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: 4f55d83688a772342f0d96966cd51d06af03c2c8
|
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: 4f55d83688a772342f0d96966cd51d06af03c2c8
|
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: 4f55d83688a772342f0d96966cd51d06af03c2c8
|
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: 4f55d83688a772342f0d96966cd51d06af03c2c8
|
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: 4f55d83688a772342f0d96966cd51d06af03c2c8
|
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: 4f55d83688a772342f0d96966cd51d06af03c2c8
|
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: 4f55d83688a772342f0d96966cd51d06af03c2c8
|
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: 4f55d83688a772342f0d96966cd51d06af03c2c8
|
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: 4f55d83688a772342f0d96966cd51d06af03c2c8
|
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: 4f55d83688a772342f0d96966cd51d06af03c2c8
|
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: 4f55d83688a772342f0d96966cd51d06af03c2c8
|
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: 4f55d83688a772342f0d96966cd51d06af03c2c8
|
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
@@ -1,7 +1,13 @@
|
|
1
|
+
# Generated from lib/rbs_activesupport/ast.rb with RBS::Inline
|
2
|
+
|
1
3
|
module RbsActivesupport
|
2
4
|
module AST
|
3
|
-
|
4
|
-
def
|
5
|
+
# @rbs node: Array[untyped]
|
6
|
+
def eval_args: (Array[untyped] node) -> Array[Array[Symbol?]]
|
7
|
+
|
8
|
+
# @rbs node: Array[untyped]
|
9
|
+
def eval_args_with_options: (Array[untyped] node) -> [ Array[Symbol], Hash[Symbol, untyped] ]
|
10
|
+
|
5
11
|
def eval_node: (untyped node) -> untyped
|
6
12
|
end
|
7
13
|
end
|
@@ -1,15 +1,29 @@
|
|
1
|
+
# Generated from lib/rbs_activesupport/attribute_accessor.rb with RBS::Inline
|
2
|
+
|
1
3
|
module RbsActivesupport
|
2
4
|
class AttributeAccessor
|
3
5
|
attr_reader name: Symbol
|
6
|
+
|
4
7
|
attr_reader options: Hash[untyped, untyped]
|
5
8
|
|
9
|
+
# @rbs name: Symbol
|
10
|
+
# @rbs options: Hash[untyped, untyped]
|
6
11
|
def initialize: (Symbol name, Hash[untyped, untyped] options) -> void
|
12
|
+
|
13
|
+
def type: () -> String
|
14
|
+
|
7
15
|
def singleton_reader?: () -> bool
|
16
|
+
|
8
17
|
def singleton_writer?: () -> bool
|
18
|
+
|
9
19
|
def instance_accessor?: () -> bool
|
20
|
+
|
10
21
|
def instance_reader?: () -> bool
|
22
|
+
|
11
23
|
def instance_writer?: () -> bool
|
24
|
+
|
12
25
|
def public?: () -> bool
|
26
|
+
|
13
27
|
def private?: () -> bool
|
14
28
|
end
|
15
29
|
end
|
@@ -1,14 +1,27 @@
|
|
1
|
+
# Generated from lib/rbs_activesupport/class_attribute.rb with RBS::Inline
|
2
|
+
|
1
3
|
module RbsActivesupport
|
2
4
|
class ClassAttribute
|
3
5
|
attr_reader name: Symbol
|
6
|
+
|
4
7
|
attr_reader options: Hash[untyped, untyped]
|
5
8
|
|
9
|
+
# @rbs name: Symbol
|
10
|
+
# @rbs options: Hash[untyped, untyped]
|
6
11
|
def initialize: (Symbol name, Hash[untyped, untyped] options) -> void
|
12
|
+
|
13
|
+
def type: () -> String
|
14
|
+
|
7
15
|
def instance_accessor?: () -> bool
|
16
|
+
|
8
17
|
def instance_reader?: () -> bool
|
18
|
+
|
9
19
|
def instance_writer?: () -> bool
|
20
|
+
|
10
21
|
def instance_predicate?: () -> bool
|
22
|
+
|
11
23
|
def public?: () -> bool
|
24
|
+
|
12
25
|
def private?: () -> bool
|
13
26
|
end
|
14
27
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# Generated from lib/rbs_activesupport/declaration_builder.rb with RBS::Inline
|
2
|
+
|
1
3
|
module RbsActivesupport
|
2
4
|
class DeclarationBuilder
|
3
5
|
type t = AttributeAccessor | ClassAttribute | Delegate | Include
|
@@ -6,20 +8,46 @@ module RbsActivesupport
|
|
6
8
|
|
7
9
|
attr_reader method_searcher: MethodSearcher
|
8
10
|
|
11
|
+
# @rbs method_searcher: MethodSearcher
|
9
12
|
def initialize: (MethodSearcher method_searcher) -> void
|
10
|
-
|
13
|
+
|
14
|
+
# @rbs namespace: RBS::Namespace
|
15
|
+
# @rbs method_calls: Array[Parser::MethodCall]
|
16
|
+
def build: (RBS::Namespace namespace, Array[Parser::MethodCall] method_calls) -> [ Array[String], Array[String] ]
|
11
17
|
|
12
18
|
private
|
13
19
|
|
20
|
+
# @rbs namespace: RBS::Namespace
|
21
|
+
# @rbs method_calls: Array[Parser::MethodCall]
|
14
22
|
def build_method_calls: (RBS::Namespace namespace, Array[Parser::MethodCall] method_calls) -> Array[t]
|
23
|
+
|
24
|
+
# @rbs method_call: Parser::MethodCall
|
15
25
|
def build_attribute_accessor: (Parser::MethodCall method_call) -> Array[AttributeAccessor]
|
16
|
-
|
17
|
-
|
18
|
-
def
|
26
|
+
|
27
|
+
# @rbs method_call: Parser::MethodCall
|
28
|
+
def build_class_attribute: (Parser::MethodCall method_call) -> Array[ClassAttribute]
|
29
|
+
|
30
|
+
# @rbs namespace: RBS::Namespace
|
31
|
+
# @rbs method_call: Parser::MethodCall
|
32
|
+
def build_delegate: (RBS::Namespace namespace, Parser::MethodCall method_call) -> Array[Delegate]
|
33
|
+
|
34
|
+
# @rbs namespace: RBS::Namespace
|
35
|
+
# @rbs method_call: Parser::MethodCall
|
36
|
+
def build_include: (RBS::Namespace namespace, Parser::MethodCall method_call) -> Array[Include]
|
37
|
+
|
38
|
+
# @rbs decl: t
|
19
39
|
def render: (t decl) -> String?
|
40
|
+
|
41
|
+
# @rbs decl: AttributeAccessor
|
20
42
|
def render_attribute_accessor: (AttributeAccessor decl) -> String
|
43
|
+
|
44
|
+
# @rbs decl: ClassAttribute
|
21
45
|
def render_class_attribute: (ClassAttribute decl) -> String
|
46
|
+
|
47
|
+
# @rbs decl: Delegate
|
22
48
|
def render_delegate: (Delegate decl) -> String
|
49
|
+
|
50
|
+
# @rbs decl: Include
|
23
51
|
def render_include: (Include decl) -> String?
|
24
52
|
end
|
25
53
|
end
|
@@ -1,13 +1,24 @@
|
|
1
|
+
# Generated from lib/rbs_activesupport/delegate.rb with RBS::Inline
|
2
|
+
|
1
3
|
module RbsActivesupport
|
2
4
|
class Delegate
|
3
5
|
attr_reader namespace: RBS::Namespace
|
6
|
+
|
4
7
|
attr_reader method: Symbol
|
8
|
+
|
5
9
|
attr_reader options: Hash[Symbol, untyped]
|
6
10
|
|
11
|
+
# @rbs namespace: RBS::Namespace
|
12
|
+
# @rbs method: Symbol
|
13
|
+
# @rbs options: Hash[Symbol, untyped]
|
7
14
|
def initialize: (RBS::Namespace namespace, Symbol method, Hash[Symbol, untyped] options) -> void
|
15
|
+
|
8
16
|
def to: () -> Symbol
|
17
|
+
|
9
18
|
def method_name: () -> Symbol
|
19
|
+
|
10
20
|
def public?: () -> bool
|
21
|
+
|
11
22
|
def private?: () -> bool
|
12
23
|
end
|
13
24
|
end
|
@@ -1,20 +1,34 @@
|
|
1
|
+
# Generated from lib/rbs_activesupport/generator.rb with RBS::Inline
|
2
|
+
|
1
3
|
module RbsActivesupport
|
2
4
|
class Generator
|
5
|
+
# @rbs pathname: Pathname
|
6
|
+
# @rbs rbs_builder: RBS::DefinitionBuilder
|
3
7
|
def self.generate: (Pathname pathname, RBS::DefinitionBuilder rbs_builder) -> String?
|
4
8
|
|
5
9
|
include AST
|
6
10
|
|
7
11
|
attr_reader pathname: Pathname
|
12
|
+
|
8
13
|
attr_reader declaration_builder: DeclarationBuilder
|
9
14
|
|
15
|
+
# @rbs pathname: Pathname
|
16
|
+
# @rbs rbs_builder: RBS::DefinitionBuilder
|
10
17
|
def initialize: (Pathname pathname, RBS::DefinitionBuilder rbs_builder) -> void
|
18
|
+
|
11
19
|
def generate: () -> String?
|
12
20
|
|
13
21
|
private
|
14
22
|
|
23
|
+
# @rbs rbs: String
|
15
24
|
def format: (String rbs) -> String
|
25
|
+
|
16
26
|
def parse_source_code: () -> Hash[RBS::Namespace, Array[Parser::MethodCall]]
|
27
|
+
|
28
|
+
# @rbs namespace: RBS::Namespace
|
17
29
|
def header: (RBS::Namespace namespace) -> String
|
30
|
+
|
31
|
+
# @rbs namespace: RBS::Namespace
|
18
32
|
def footer: (RBS::Namespace namespace) -> String
|
19
33
|
end
|
20
34
|
end
|
@@ -1,16 +1,30 @@
|
|
1
|
+
# Generated from lib/rbs_activesupport/include.rb with RBS::Inline
|
2
|
+
|
1
3
|
module RbsActivesupport
|
2
4
|
class Include
|
3
5
|
attr_reader context: RBS::Namespace
|
6
|
+
|
4
7
|
attr_reader module_path: Array[Symbol?]
|
8
|
+
|
5
9
|
attr_reader options: Hash[Symbol, untyped]
|
6
10
|
|
11
|
+
# @rbs context: RBS::Namespace
|
12
|
+
# @rbs module_path: Array[Symbol?]
|
13
|
+
# @rbs options: Hash[Symbol, untyped]
|
7
14
|
def initialize: (RBS::Namespace context, Array[Symbol?] module_path, Hash[Symbol, untyped] options) -> void
|
15
|
+
|
8
16
|
def argument: () -> RBS::Namespace
|
17
|
+
|
18
|
+
# @rbs %a{pure}
|
9
19
|
%a{pure}
|
10
20
|
def module_name: () -> RBS::Namespace?
|
21
|
+
|
11
22
|
def concern?: () -> bool
|
23
|
+
|
12
24
|
def classmethods?: () -> bool
|
25
|
+
|
13
26
|
def public?: () -> bool
|
27
|
+
|
14
28
|
def private?: () -> bool
|
15
29
|
end
|
16
30
|
end
|
@@ -1,12 +1,19 @@
|
|
1
|
+
# Generated from lib/rbs_activesupport/method_searcher.rb with RBS::Inline
|
2
|
+
|
1
3
|
module RbsActivesupport
|
2
4
|
class MethodSearcher
|
3
5
|
attr_reader rbs_builder: RBS::DefinitionBuilder
|
4
6
|
|
7
|
+
# @rbs rbs_builder: RBS::DefinitionBuilder
|
5
8
|
def initialize: (RBS::DefinitionBuilder rbs_builder) -> void
|
9
|
+
|
10
|
+
# @rbs delegate: Delegate
|
6
11
|
def method_types_for: (Delegate delegate) -> Array[String]
|
7
12
|
|
8
13
|
private
|
9
14
|
|
10
|
-
|
15
|
+
# @rbs type_name: RBS::TypeName
|
16
|
+
# @rbs method: Symbol
|
17
|
+
def lookup_method_types: (RBS::TypeName type_name, Symbol method) -> Array[RBS::MethodType]
|
11
18
|
end
|
12
19
|
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# Generated from lib/rbs_activesupport/parser/comment_parser.rb with RBS::Inline
|
2
|
+
|
3
|
+
module RbsActivesupport
|
4
|
+
class Parser
|
5
|
+
class CommentParser
|
6
|
+
attr_reader line_comments: Hash[Integer, String]
|
7
|
+
|
8
|
+
attr_reader trailing_comments: Hash[Integer, String]
|
9
|
+
|
10
|
+
def initialize: () -> void
|
11
|
+
|
12
|
+
# @rbs string: String
|
13
|
+
def parse: (String string) -> self
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|