rbs_activesupport 1.1.0 → 1.2.1

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.
Files changed (33) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +9 -0
  3. data/.vscode/settings.json +3 -1
  4. data/README.md +7 -0
  5. data/lib/generators/rbs_activesupport/install_generator.rb +2 -0
  6. data/lib/rbs_activesupport/ast.rb +4 -2
  7. data/lib/rbs_activesupport/attribute_accessor.rb +13 -10
  8. data/lib/rbs_activesupport/class_attribute.rb +12 -9
  9. data/lib/rbs_activesupport/declaration_builder.rb +31 -13
  10. data/lib/rbs_activesupport/delegate.rb +11 -6
  11. data/lib/rbs_activesupport/generator.rb +18 -8
  12. data/lib/rbs_activesupport/include.rb +14 -8
  13. data/lib/rbs_activesupport/method_searcher.rb +28 -9
  14. data/lib/rbs_activesupport/parser/comment_parser.rb +5 -3
  15. data/lib/rbs_activesupport/parser.rb +26 -9
  16. data/lib/rbs_activesupport/rake_task.rb +21 -12
  17. data/lib/rbs_activesupport/version.rb +1 -1
  18. data/rbs_collection.lock.yaml +20 -20
  19. data/sig/generators/rbs_activesupport/install_generator.rbs +7 -0
  20. data/sig/rbs_activesupport/ast.rbs +8 -2
  21. data/sig/rbs_activesupport/attribute_accessor.rbs +13 -0
  22. data/sig/rbs_activesupport/class_attribute.rbs +12 -0
  23. data/sig/rbs_activesupport/declaration_builder.rbs +32 -4
  24. data/sig/rbs_activesupport/delegate.rbs +11 -0
  25. data/sig/rbs_activesupport/generator.rbs +14 -0
  26. data/sig/rbs_activesupport/include.rbs +14 -0
  27. data/sig/rbs_activesupport/method_searcher.rbs +14 -1
  28. data/sig/rbs_activesupport/parser/comment_parser.rbs +5 -0
  29. data/sig/rbs_activesupport/parser.rbs +25 -2
  30. data/sig/rbs_activesupport/rake_task.rbs +10 -0
  31. data/sig/rbs_activesupport/version.rbs +5 -0
  32. data/sig/rbs_activesupport.rbs +4 -2
  33. metadata +4 -2
@@ -5,13 +5,20 @@ require "rake/tasklib"
5
5
 
6
6
  module RbsActivesupport
7
7
  class RakeTask < Rake::TaskLib
8
- attr_accessor :name, :signature_root_dir
8
+ attr_accessor :name #: Symbol
9
+ attr_accessor :signature_root_dir #: Pathname
10
+ attr_accessor :target_directories #: Array[Pathname]
9
11
 
10
- def initialize(name = :'rbs:activesupport', &block)
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
- (Rails.root / "app").glob("**/*.rb").each do |file|
40
- rbs = Generator.new(file, rbs_builder).generate
41
- next unless rbs
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
- rbs_path = signature_root_dir / file.sub_ext(".rbs").relative_path_from(Rails.root)
44
- rbs_path.dirname.mkpath
45
- rbs_path.write(rbs)
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"))
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RbsActivesupport
4
- VERSION = "1.1.0"
4
+ VERSION = "1.2.1" #: String
5
5
  end
@@ -6,7 +6,7 @@ gems:
6
6
  source:
7
7
  type: git
8
8
  name: ruby/gem_rbs_collection
9
- revision: e9bc1bf94c262e79a2d599a9c173342915b29808
9
+ revision: f88536536950701925e9293f7fa7d3629965c53f
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: e9bc1bf94c262e79a2d599a9c173342915b29808
17
+ revision: f88536536950701925e9293f7fa7d3629965c53f
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: e9bc1bf94c262e79a2d599a9c173342915b29808
25
+ revision: f88536536950701925e9293f7fa7d3629965c53f
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: e9bc1bf94c262e79a2d599a9c173342915b29808
33
+ revision: f88536536950701925e9293f7fa7d3629965c53f
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: e9bc1bf94c262e79a2d599a9c173342915b29808
53
+ revision: f88536536950701925e9293f7fa7d3629965c53f
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: e9bc1bf94c262e79a2d599a9c173342915b29808
61
+ revision: f88536536950701925e9293f7fa7d3629965c53f
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: e9bc1bf94c262e79a2d599a9c173342915b29808
85
+ revision: f88536536950701925e9293f7fa7d3629965c53f
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: e9bc1bf94c262e79a2d599a9c173342915b29808
117
+ revision: f88536536950701925e9293f7fa7d3629965c53f
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: e9bc1bf94c262e79a2d599a9c173342915b29808
129
+ revision: f88536536950701925e9293f7fa7d3629965c53f
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: e9bc1bf94c262e79a2d599a9c173342915b29808
137
+ revision: f88536536950701925e9293f7fa7d3629965c53f
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: e9bc1bf94c262e79a2d599a9c173342915b29808
157
+ revision: f88536536950701925e9293f7fa7d3629965c53f
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: e9bc1bf94c262e79a2d599a9c173342915b29808
165
+ revision: f88536536950701925e9293f7fa7d3629965c53f
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: e9bc1bf94c262e79a2d599a9c173342915b29808
173
+ revision: f88536536950701925e9293f7fa7d3629965c53f
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: e9bc1bf94c262e79a2d599a9c173342915b29808
181
+ revision: f88536536950701925e9293f7fa7d3629965c53f
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: e9bc1bf94c262e79a2d599a9c173342915b29808
189
+ revision: f88536536950701925e9293f7fa7d3629965c53f
190
190
  remote: https://github.com/ruby/gem_rbs_collection.git
191
191
  repo_dir: gems
192
192
  - name: rbs
@@ -202,7 +202,7 @@ gems:
202
202
  source:
203
203
  type: git
204
204
  name: ruby/gem_rbs_collection
205
- revision: e9bc1bf94c262e79a2d599a9c173342915b29808
205
+ revision: f88536536950701925e9293f7fa7d3629965c53f
206
206
  remote: https://github.com/ruby/gem_rbs_collection.git
207
207
  repo_dir: gems
208
208
  - name: ripper
@@ -214,7 +214,7 @@ gems:
214
214
  source:
215
215
  type: git
216
216
  name: ruby/gem_rbs_collection
217
- revision: e9bc1bf94c262e79a2d599a9c173342915b29808
217
+ revision: f88536536950701925e9293f7fa7d3629965c53f
218
218
  remote: https://github.com/ruby/gem_rbs_collection.git
219
219
  repo_dir: gems
220
220
  - name: rubocop-ast
@@ -222,7 +222,7 @@ gems:
222
222
  source:
223
223
  type: git
224
224
  name: ruby/gem_rbs_collection
225
- revision: e9bc1bf94c262e79a2d599a9c173342915b29808
225
+ revision: f88536536950701925e9293f7fa7d3629965c53f
226
226
  remote: https://github.com/ruby/gem_rbs_collection.git
227
227
  repo_dir: gems
228
228
  - name: securerandom
@@ -246,7 +246,7 @@ gems:
246
246
  source:
247
247
  type: git
248
248
  name: ruby/gem_rbs_collection
249
- revision: e9bc1bf94c262e79a2d599a9c173342915b29808
249
+ revision: f88536536950701925e9293f7fa7d3629965c53f
250
250
  remote: https://github.com/ruby/gem_rbs_collection.git
251
251
  repo_dir: gems
252
252
  - name: time
@@ -266,7 +266,7 @@ gems:
266
266
  source:
267
267
  type: git
268
268
  name: ruby/gem_rbs_collection
269
- revision: e9bc1bf94c262e79a2d599a9c173342915b29808
269
+ revision: f88536536950701925e9293f7fa7d3629965c53f
270
270
  remote: https://github.com/ruby/gem_rbs_collection.git
271
271
  repo_dir: gems
272
272
  - name: uri
@@ -0,0 +1,7 @@
1
+ # Generated from lib/generators/rbs_activesupport/install_generator.rb with RBS::Inline
2
+
3
+ module RbsActivesupport
4
+ class InstallGenerator < Rails::Generators::Base
5
+ def create_raketask: () -> untyped
6
+ end
7
+ end
@@ -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
- def eval_args: (Array[untyped] args) -> Array[Array[Symbol?]]
4
- def eval_args_with_options: (Array[untyped] args) -> [Array[Symbol], Hash[Symbol, untyped]]
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,16 +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
+
7
13
  def type: () -> String
14
+
8
15
  def singleton_reader?: () -> bool
16
+
9
17
  def singleton_writer?: () -> bool
18
+
10
19
  def instance_accessor?: () -> bool
20
+
11
21
  def instance_reader?: () -> bool
22
+
12
23
  def instance_writer?: () -> bool
24
+
13
25
  def public?: () -> bool
26
+
14
27
  def private?: () -> bool
15
28
  end
16
29
  end
@@ -1,15 +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
+
7
13
  def type: () -> String
14
+
8
15
  def instance_accessor?: () -> bool
16
+
9
17
  def instance_reader?: () -> bool
18
+
10
19
  def instance_writer?: () -> bool
20
+
11
21
  def instance_predicate?: () -> bool
22
+
12
23
  def public?: () -> bool
24
+
13
25
  def private?: () -> bool
14
26
  end
15
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
- def build: (RBS::Namespace namespace, Array[Parser::MethodCall] method_calls) -> [Array[String], Array[String]]
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
- def build_class_attribute: (Parser::MethodCall method_calls) -> Array[ClassAttribute]
17
- def build_delegate: (RBS::Namespace namespace, Parser::MethodCall method_calls) -> Array[Delegate]
18
- def build_include: (RBS::Namespace namespace, Parser::MethodCall method_calls) -> Array[Include]
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,25 @@
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
- def lookup_method_types: (RBS::TypeName namespace, Symbol method) -> Array[RBS::MethodType]
15
+ # @rbs delegate_to: Array[RBS::MethodType]
16
+ def return_type_names_for: (Array[RBS::MethodType] delegate_to) -> Array[RBS::TypeName]
17
+
18
+ # @rbs type: RBS::Types::t
19
+ def type_name_for: (RBS::Types::t type) -> RBS::TypeName?
20
+
21
+ # @rbs type_name: RBS::TypeName
22
+ # @rbs method: Symbol
23
+ def lookup_method_types: (RBS::TypeName type_name, Symbol method) -> Array[RBS::MethodType]
11
24
  end
12
25
  end
@@ -1,10 +1,15 @@
1
+ # Generated from lib/rbs_activesupport/parser/comment_parser.rb with RBS::Inline
2
+
1
3
  module RbsActivesupport
2
4
  class Parser
3
5
  class CommentParser
4
6
  attr_reader line_comments: Hash[Integer, String]
7
+
5
8
  attr_reader trailing_comments: Hash[Integer, String]
6
9
 
7
10
  def initialize: () -> void
11
+
12
+ # @rbs string: String
8
13
  def parse: (String string) -> self
9
14
  end
10
15
  end
@@ -1,26 +1,49 @@
1
+ # Generated from lib/rbs_activesupport/parser.rb with RBS::Inline
2
+
1
3
  module RbsActivesupport
2
4
  class Parser < ::RBS::Prototype::RB
3
5
  class MethodCall
4
6
  attr_reader name: t
7
+
5
8
  attr_reader args: Array[RubyVM::AbstractSyntaxTree::Node]
9
+
6
10
  attr_reader trailing_comment: String?
7
11
 
8
12
  @private: bool
9
13
 
14
+ # @rbs name: t
15
+ # @rbs args: Array[RubyVM::AbstractSyntaxTree::Node]
16
+ # @rbs private: bool
17
+ # @rbs trailing_comment: String?
10
18
  def initialize: (t name, Array[RubyVM::AbstractSyntaxTree::Node] args, bool private, ?trailing_comment: String?) -> void
19
+
11
20
  def private?: () -> bool
12
21
  end
13
22
 
14
23
  type t = :class_attribute | :delegate | :cattr_accessor | :mattr_accessor | :cattr_reader | :mattr_reader | :cattr_writer | :mattr_writer | :include
24
+
15
25
  METHODS: Array[t]
16
26
 
17
27
  alias process_orig process
18
28
 
19
29
  attr_reader comment_parser: CommentParser
30
+
20
31
  attr_reader method_calls: Hash[RBS::Namespace, Array[MethodCall]]
21
32
 
22
- def parse: (String) -> void
23
- def trailing_comment_for: (RubyVM::AbstractSyntaxTree::Node) -> String?
33
+ def initialize: () -> void
34
+
35
+ # @rbs string: String
36
+ def parse: (String string) -> void
37
+
38
+ # @rbs override
39
+ def process: ...
40
+
41
+ # @rbs node: RubyVM::AbstractSyntaxTree::Node
42
+ def trailing_comment_for: (RubyVM::AbstractSyntaxTree::Node node) -> String?
43
+
44
+ # @rbs decls: Array[RBS::AST::Declarations::t | RBS::AST::Members::t]
24
45
  def private?: (Array[RBS::AST::Declarations::t | RBS::AST::Members::t] decls) -> bool
46
+
47
+ private
25
48
  end
26
49
  end
@@ -1,13 +1,23 @@
1
+ # Generated from lib/rbs_activesupport/rake_task.rb with RBS::Inline
2
+
1
3
  module RbsActivesupport
2
4
  class RakeTask < Rake::TaskLib
3
5
  attr_accessor name: Symbol
6
+
4
7
  attr_accessor signature_root_dir: Pathname
5
8
 
9
+ attr_accessor target_directories: Array[Pathname]
10
+
6
11
  @rbs_builder: RBS::DefinitionBuilder
7
12
 
13
+ # @rbs name: Symbol
14
+ # @rbs &block: ?(self) -> void
8
15
  def initialize: (?Symbol name) ?{ (self) -> void } -> void
16
+
9
17
  def define_setup_task: () -> void
18
+
10
19
  def define_generate_task: () -> void
20
+
11
21
  def define_clean_task: () -> void
12
22
 
13
23
  private
@@ -0,0 +1,5 @@
1
+ # Generated from lib/rbs_activesupport/version.rb with RBS::Inline
2
+
3
+ module RbsActivesupport
4
+ VERSION: String
5
+ end
@@ -1,4 +1,6 @@
1
+ # Generated from lib/rbs_activesupport.rb with RBS::Inline
2
+
1
3
  module RbsActivesupport
2
- VERSION: String
3
- # See the writing guide of rbs: https://github.com/ruby/rbs#guides
4
+ class Error < StandardError
5
+ end
4
6
  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.1.0
4
+ version: 1.2.1
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-12 00:00:00.000000000 Z
11
+ date: 2024-10-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -83,6 +83,7 @@ files:
83
83
  - lib/rbs_activesupport/version.rb
84
84
  - rbs_collection.lock.yaml
85
85
  - rbs_collection.yaml
86
+ - sig/generators/rbs_activesupport/install_generator.rbs
86
87
  - sig/rbs_activesupport.rbs
87
88
  - sig/rbs_activesupport/ast.rbs
88
89
  - sig/rbs_activesupport/attribute_accessor.rbs
@@ -95,6 +96,7 @@ files:
95
96
  - sig/rbs_activesupport/parser.rbs
96
97
  - sig/rbs_activesupport/parser/comment_parser.rbs
97
98
  - sig/rbs_activesupport/rake_task.rbs
99
+ - sig/rbs_activesupport/version.rbs
98
100
  homepage: https://github.com/tk0miya/rbs_activesupport
99
101
  licenses:
100
102
  - MIT