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.
Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +9 -0
  3. data/.vscode/settings.json +6 -2
  4. data/README.md +69 -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 +22 -9
  8. data/lib/rbs_activesupport/class_attribute.rb +21 -8
  9. data/lib/rbs_activesupport/declaration_builder.rb +41 -21
  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 +8 -4
  14. data/lib/rbs_activesupport/parser/comment_parser.rb +38 -0
  15. data/lib/rbs_activesupport/parser.rb +37 -8
  16. data/lib/rbs_activesupport/rake_task.rb +21 -12
  17. data/lib/rbs_activesupport/version.rb +1 -1
  18. data/lib/rbs_activesupport.rb +1 -0
  19. data/rbs_collection.lock.yaml +24 -20
  20. data/rbs_collection.yaml +2 -4
  21. data/sig/generators/rbs_activesupport/install_generator.rbs +7 -0
  22. data/sig/rbs_activesupport/ast.rbs +8 -2
  23. data/sig/rbs_activesupport/attribute_accessor.rbs +14 -0
  24. data/sig/rbs_activesupport/class_attribute.rbs +13 -0
  25. data/sig/rbs_activesupport/declaration_builder.rbs +32 -4
  26. data/sig/rbs_activesupport/delegate.rbs +11 -0
  27. data/sig/rbs_activesupport/generator.rbs +14 -0
  28. data/sig/rbs_activesupport/include.rbs +14 -0
  29. data/sig/rbs_activesupport/method_searcher.rbs +8 -1
  30. data/sig/rbs_activesupport/parser/comment_parser.rbs +16 -0
  31. data/sig/rbs_activesupport/parser.rbs +28 -1
  32. data/sig/rbs_activesupport/rake_task.rbs +10 -0
  33. data/sig/rbs_activesupport/version.rbs +5 -0
  34. data/sig/rbs_activesupport.rbs +4 -2
  35. metadata +7 -3
@@ -1,22 +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]
6
9
 
10
+ attr_reader trailing_comment: String?
11
+
7
12
  @private: bool
8
13
 
9
- def initialize: (t name, Array[RubyVM::AbstractSyntaxTree::Node] args, bool private) -> void
14
+ # @rbs name: t
15
+ # @rbs args: Array[RubyVM::AbstractSyntaxTree::Node]
16
+ # @rbs private: bool
17
+ # @rbs trailing_comment: String?
18
+ def initialize: (t name, Array[RubyVM::AbstractSyntaxTree::Node] args, bool private, ?trailing_comment: String?) -> void
19
+
10
20
  def private?: () -> bool
11
21
  end
12
22
 
13
23
  type t = :class_attribute | :delegate | :cattr_accessor | :mattr_accessor | :cattr_reader | :mattr_reader | :cattr_writer | :mattr_writer | :include
24
+
14
25
  METHODS: Array[t]
15
26
 
16
27
  alias process_orig process
17
28
 
29
+ attr_reader comment_parser: CommentParser
30
+
18
31
  attr_reader method_calls: Hash[RBS::Namespace, Array[MethodCall]]
19
32
 
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]
20
45
  def private?: (Array[RBS::AST::Declarations::t | RBS::AST::Members::t] decls) -> bool
46
+
47
+ private
21
48
  end
22
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.0.0
4
+ version: 1.2.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-02 00:00:00.000000000 Z
11
+ date: 2024-10-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -78,10 +78,12 @@ 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
84
85
  - rbs_collection.yaml
86
+ - sig/generators/rbs_activesupport/install_generator.rbs
85
87
  - sig/rbs_activesupport.rbs
86
88
  - sig/rbs_activesupport/ast.rbs
87
89
  - sig/rbs_activesupport/attribute_accessor.rbs
@@ -92,7 +94,9 @@ files:
92
94
  - sig/rbs_activesupport/include.rbs
93
95
  - sig/rbs_activesupport/method_searcher.rbs
94
96
  - sig/rbs_activesupport/parser.rbs
97
+ - sig/rbs_activesupport/parser/comment_parser.rbs
95
98
  - sig/rbs_activesupport/rake_task.rbs
99
+ - sig/rbs_activesupport/version.rbs
96
100
  homepage: https://github.com/tk0miya/rbs_activesupport
97
101
  licenses:
98
102
  - MIT
@@ -115,7 +119,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
115
119
  - !ruby/object:Gem::Version
116
120
  version: '0'
117
121
  requirements: []
118
- rubygems_version: 3.5.11
122
+ rubygems_version: 3.5.16
119
123
  signing_key:
120
124
  specification_version: 4
121
125
  summary: A RBS files generatorfor activesupport