u-struct 0.11.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ci.yml +5 -5
  3. data/.rubocop.yml +129 -0
  4. data/.rubocop_todo.yml +10 -0
  5. data/.tool-versions +1 -0
  6. data/CHANGELOG.md +558 -13
  7. data/Gemfile +14 -3
  8. data/README.md +682 -16
  9. data/Rakefile +5 -5
  10. data/bin/console +3 -3
  11. data/bin/prepare_coverage +7 -9
  12. data/bin/run_ci +17 -0
  13. data/bin/tapioca +28 -0
  14. data/examples/rgb/number.rb +1 -1
  15. data/examples/rgb_1.rb +7 -6
  16. data/examples/rgb_2.rb +2 -2
  17. data/examples/rgb_3.rb +1 -1
  18. data/lib/micro/struct/factory/create_struct.rb +95 -69
  19. data/lib/micro/struct/factory/members.rb +1 -0
  20. data/lib/micro/struct/factory.rb +13 -4
  21. data/lib/micro/struct/features.rb +35 -16
  22. data/lib/micro/struct/normalize_names.rb +4 -3
  23. data/lib/micro/struct/version.rb +2 -1
  24. data/lib/micro/struct.rb +37 -5
  25. data/lib/u-struct.rb +2 -0
  26. data/rbi/micro/struct/factory/create_struct.rbi +60 -0
  27. data/rbi/micro/struct/factory/members.rbi +67 -0
  28. data/rbi/micro/struct/factory.rbi +41 -0
  29. data/rbi/micro/struct/features.rbi +41 -0
  30. data/rbi/micro/struct/normalize_names.rbi +20 -0
  31. data/rbi/micro/struct/version.rbi +3 -0
  32. data/rbi/micro/struct.rbi +68 -0
  33. data/sorbet/config +8 -0
  34. data/sorbet/rbi/gems/ast@2.4.2.rbi +54 -0
  35. data/sorbet/rbi/gems/coderay@1.1.3.rbi +8 -0
  36. data/sorbet/rbi/gems/diff-lcs@1.5.0.rbi +11 -0
  37. data/sorbet/rbi/gems/docile@1.4.0.rbi +54 -0
  38. data/sorbet/rbi/gems/method_source@1.0.0.rbi +8 -0
  39. data/sorbet/rbi/gems/minitest@5.15.0.rbi +345 -0
  40. data/sorbet/rbi/gems/parser@3.1.0.0.rbi +1196 -0
  41. data/sorbet/rbi/gems/pry@0.14.1.rbi +8 -0
  42. data/sorbet/rbi/gems/rake@13.0.6.rbi +806 -0
  43. data/sorbet/rbi/gems/rbi@0.0.9.rbi +1602 -0
  44. data/sorbet/rbi/gems/simplecov-html@0.12.3.rbi +89 -0
  45. data/sorbet/rbi/gems/simplecov@0.21.2.rbi +577 -0
  46. data/sorbet/rbi/gems/simplecov_json_formatter@0.1.3.rbi +8 -0
  47. data/sorbet/rbi/gems/spoom@1.1.8.rbi +1252 -0
  48. data/sorbet/rbi/gems/tapioca@0.6.2.rbi +1232 -0
  49. data/sorbet/rbi/gems/thor@1.2.1.rbi +844 -0
  50. data/sorbet/rbi/gems/unparser@0.6.3.rbi +8 -0
  51. data/sorbet/rbi/gems/webrick@1.7.0.rbi +601 -0
  52. data/sorbet/rbi/gems/yard-sorbet@0.6.1.rbi +199 -0
  53. data/sorbet/rbi/gems/yard@0.9.27.rbi +4112 -0
  54. data/sorbet/tapioca/config.yml +13 -0
  55. data/sorbet/tapioca/require.rb +4 -0
  56. data/u-struct.gemspec +3 -3
  57. metadata +38 -4
  58. data/bin/test +0 -8
@@ -0,0 +1,199 @@
1
+ # typed: true
2
+
3
+ # DO NOT EDIT MANUALLY
4
+ # This is an autogenerated file for types exported from the `yard-sorbet` gem.
5
+ # Please instead update this file by running `bin/tapioca gem yard-sorbet`.
6
+
7
+ module YARDSorbet; end
8
+
9
+ module YARDSorbet::Directives
10
+ class << self
11
+ sig { params(docstring: String, directives: T::Array[String]).void }
12
+ def add_directives(docstring, directives); end
13
+
14
+ sig { params(docstring: T.nilable(String)).returns([YARD::Docstring, T::Array[String]]) }
15
+ def extract_directives(docstring); end
16
+ end
17
+ end
18
+
19
+ module YARDSorbet::Handlers; end
20
+
21
+ class YARDSorbet::Handlers::AbstractDSLHandler < ::YARD::Handlers::Ruby::Base
22
+ sig { void }
23
+ def process; end
24
+ end
25
+
26
+ YARDSorbet::Handlers::AbstractDSLHandler::CLASS_TAG_TEXT = T.let(T.unsafe(nil), String)
27
+ YARDSorbet::Handlers::AbstractDSLHandler::TAG_TEXT = T.let(T.unsafe(nil), String)
28
+
29
+ class YARDSorbet::Handlers::EnumsHandler < ::YARD::Handlers::Ruby::Base
30
+ sig { void }
31
+ def process; end
32
+
33
+ private
34
+
35
+ sig { params(node: YARD::Parser::Ruby::AstNode).returns(T::Boolean) }
36
+ def const_assign_node?(node); end
37
+ end
38
+
39
+ class YARDSorbet::Handlers::IncludeHandler < ::YARD::Handlers::Ruby::Base
40
+ sig { void }
41
+ def process; end
42
+
43
+ private
44
+
45
+ sig { returns(YARD::CodeObjects::NamespaceObject) }
46
+ def included_in; end
47
+ end
48
+
49
+ class YARDSorbet::Handlers::MixesInClassMethodsHandler < ::YARD::Handlers::Ruby::Base
50
+ sig { void }
51
+ def process; end
52
+
53
+ class << self
54
+ sig { params(code_obj: String).returns(T.nilable(String)) }
55
+ def mixed_in_class_methods(code_obj); end
56
+ end
57
+ end
58
+
59
+ class YARDSorbet::Handlers::SigHandler < ::YARD::Handlers::Ruby::Base
60
+ sig { void }
61
+ def process; end
62
+
63
+ private
64
+
65
+ sig { params(method_node: YARD::Parser::Ruby::AstNode, node: YARD::Parser::Ruby::AstNode, docstring: YARD::Docstring).void }
66
+ def parse_params(method_node, node, docstring); end
67
+
68
+ sig { params(node: YARD::Parser::Ruby::AstNode, docstring: YARD::Docstring).void }
69
+ def parse_return(node, docstring); end
70
+
71
+ sig { params(method_node: YARD::Parser::Ruby::AstNode, docstring: YARD::Docstring).void }
72
+ def parse_sig(method_node, docstring); end
73
+ end
74
+
75
+ YARDSorbet::Handlers::SigHandler::ATTR_NODE_TYPES = T.let(T.unsafe(nil), Array)
76
+
77
+ module YARDSorbet::Handlers::StructClassHandler
78
+ sig { void }
79
+ def process; end
80
+
81
+ private
82
+
83
+ sig { params(object: YARD::CodeObjects::MethodObject, props: T::Array[YARDSorbet::TStructProp], docstring: YARD::Docstring, directives: T::Array[String]).void }
84
+ def decorate_t_struct_init(object, props, docstring, directives); end
85
+
86
+ sig { params(props: T::Array[YARDSorbet::TStructProp], class_ns: YARD::CodeObjects::ClassObject).void }
87
+ def process_t_struct_props(props, class_ns); end
88
+
89
+ sig { params(props: T::Array[YARDSorbet::TStructProp]).returns(T::Array[[String, T.nilable(String)]]) }
90
+ def to_object_parameters(props); end
91
+ end
92
+
93
+ class YARDSorbet::Handlers::StructPropHandler < ::YARD::Handlers::Ruby::Base
94
+ sig { void }
95
+ def process; end
96
+
97
+ private
98
+
99
+ sig { params(object: YARD::CodeObjects::MethodObject, prop: YARDSorbet::TStructProp).void }
100
+ def decorate_object(object, prop); end
101
+
102
+ sig { returns(T.nilable(String)) }
103
+ def default_value; end
104
+
105
+ sig { params(name: String).returns(YARDSorbet::TStructProp) }
106
+ def make_prop(name); end
107
+
108
+ sig { params(object: YARD::CodeObjects::MethodObject, name: String).void }
109
+ def register_attrs(object, name); end
110
+
111
+ sig { params(prop: YARDSorbet::TStructProp).void }
112
+ def update_state(prop); end
113
+ end
114
+
115
+ module YARDSorbet::NodeUtils
116
+ class << self
117
+ sig { params(node: YARD::Parser::Ruby::AstNode, _blk: T.proc.params(n: YARD::Parser::Ruby::AstNode).void).void }
118
+ def bfs_traverse(node, &_blk); end
119
+
120
+ sig { params(node: YARD::Parser::Ruby::AstNode).returns(T.any(YARD::Parser::Ruby::MethodCallNode, YARD::Parser::Ruby::MethodDefinitionNode)) }
121
+ def get_method_node(node); end
122
+
123
+ sig { params(node: YARD::Parser::Ruby::AstNode).returns(YARD::Parser::Ruby::AstNode) }
124
+ def sibling_node(node); end
125
+ end
126
+ end
127
+
128
+ YARDSorbet::NodeUtils::ATTRIBUTE_METHODS = T.let(T.unsafe(nil), Array)
129
+ YARDSorbet::NodeUtils::SIGABLE_NODE = T.type_alias { T.any(YARD::Parser::Ruby::MethodCallNode, YARD::Parser::Ruby::MethodDefinitionNode) }
130
+ YARDSorbet::NodeUtils::SKIP_METHOD_CONTENTS = T.let(T.unsafe(nil), Array)
131
+
132
+ module YARDSorbet::SigToYARD
133
+ class << self
134
+ sig { params(node: YARD::Parser::Ruby::AstNode).returns(T::Array[String]) }
135
+ def convert(node); end
136
+
137
+ private
138
+
139
+ sig { params(node: YARD::Parser::Ruby::AstNode).returns(String) }
140
+ def build_generic_type(node); end
141
+
142
+ sig { params(node: YARD::Parser::Ruby::AstNode).returns(T::Array[String]) }
143
+ def convert_aref(node); end
144
+
145
+ sig { params(node: YARD::Parser::Ruby::AstNode).returns(T::Array[String]) }
146
+ def convert_array(node); end
147
+
148
+ sig { params(node: YARD::Parser::Ruby::MethodCallNode).returns(T::Array[String]) }
149
+ def convert_call(node); end
150
+
151
+ sig { params(node: YARD::Parser::Ruby::AstNode).returns(T::Array[String]) }
152
+ def convert_collection(node); end
153
+
154
+ sig { params(node: YARD::Parser::Ruby::AstNode).returns(T::Array[String]) }
155
+ def convert_hash(node); end
156
+
157
+ sig { params(node: YARD::Parser::Ruby::AstNode).returns(T::Array[String]) }
158
+ def convert_list(node); end
159
+
160
+ sig { params(node: YARD::Parser::Ruby::AstNode).returns(T::Array[String]) }
161
+ def convert_node(node); end
162
+
163
+ sig { params(node: YARD::Parser::Ruby::AstNode).returns(T::Array[String]) }
164
+ def convert_node_type(node); end
165
+
166
+ sig { params(node: YARD::Parser::Ruby::AstNode).returns(T::Array[String]) }
167
+ def convert_ref(node); end
168
+
169
+ sig { params(node: YARD::Parser::Ruby::MethodCallNode).returns(T::Array[String]) }
170
+ def convert_t_method(node); end
171
+
172
+ sig { params(node: YARD::Parser::Ruby::AstNode).returns(T::Array[String]) }
173
+ def convert_unknown(node); end
174
+ end
175
+ end
176
+
177
+ class YARDSorbet::TStructProp < ::T::Struct
178
+ const :default, T.nilable(String)
179
+ const :doc, String
180
+ const :prop_name, String
181
+ const :source, String
182
+ const :types, T::Array[String]
183
+
184
+ class << self
185
+ def inherited(s); end
186
+ end
187
+ end
188
+
189
+ module YARDSorbet::TagUtils
190
+ class << self
191
+ sig { params(docstring: YARD::Docstring, tag_name: String, name: T.nilable(String)).returns(T.nilable(YARD::Tags::Tag)) }
192
+ def find_tag(docstring, tag_name, name); end
193
+
194
+ sig { params(docstring: YARD::Docstring, tag_name: String, types: T.nilable(T::Array[String]), name: T.nilable(String), text: String).void }
195
+ def upsert_tag(docstring, tag_name, types = T.unsafe(nil), name = T.unsafe(nil), text = T.unsafe(nil)); end
196
+ end
197
+ end
198
+
199
+ YARDSorbet::VERSION = T.let(T.unsafe(nil), String)