u-struct 1.0.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 +115 -27
  7. data/Gemfile +14 -3
  8. data/README.md +166 -62
  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 +3 -3
  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 +12 -5
  19. data/lib/micro/struct/factory/members.rb +1 -0
  20. data/lib/micro/struct/factory.rb +10 -5
  21. data/lib/micro/struct/features.rb +18 -23
  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 +32 -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 +37 -3
  58. data/bin/test +0 -8
@@ -0,0 +1,8 @@
1
+ # typed: true
2
+
3
+ # DO NOT EDIT MANUALLY
4
+ # This is an autogenerated file for types exported from the `method_source` gem.
5
+ # Please instead update this file by running `bin/tapioca gem method_source`.
6
+
7
+ # THIS IS AN EMPTY RBI FILE.
8
+ # see https://github.com/Shopify/tapioca/wiki/Manual-Gem-Requires
@@ -0,0 +1,345 @@
1
+ # typed: true
2
+
3
+ # DO NOT EDIT MANUALLY
4
+ # This is an autogenerated file for types exported from the `minitest` gem.
5
+ # Please instead update this file by running `bin/tapioca gem minitest`.
6
+
7
+ module Minitest
8
+ class << self
9
+ def __run(reporter, options); end
10
+ def after_run(&block); end
11
+ def autorun; end
12
+ def backtrace_filter; end
13
+ def backtrace_filter=(_arg0); end
14
+ def clock_time; end
15
+ def extensions; end
16
+ def extensions=(_arg0); end
17
+ def filter_backtrace(bt); end
18
+ def info_signal; end
19
+ def info_signal=(_arg0); end
20
+ def init_plugins(options); end
21
+ def load_plugins; end
22
+ def parallel_executor; end
23
+ def parallel_executor=(_arg0); end
24
+ def process_args(args = T.unsafe(nil)); end
25
+ def reporter; end
26
+ def reporter=(_arg0); end
27
+ def run(args = T.unsafe(nil)); end
28
+ def run_one_method(klass, method_name); end
29
+ end
30
+ end
31
+
32
+ class Minitest::AbstractReporter
33
+ include ::Mutex_m
34
+
35
+ def lock; end
36
+ def locked?; end
37
+ def passed?; end
38
+ def prerecord(klass, name); end
39
+ def record(result); end
40
+ def report; end
41
+ def start; end
42
+ def synchronize(&block); end
43
+ def try_lock; end
44
+ def unlock; end
45
+ end
46
+
47
+ class Minitest::Assertion < ::Exception
48
+ def error; end
49
+ def location; end
50
+ def result_code; end
51
+ def result_label; end
52
+ end
53
+
54
+ module Minitest::Assertions
55
+ def _synchronize; end
56
+ def assert(test, msg = T.unsafe(nil)); end
57
+ def assert_empty(obj, msg = T.unsafe(nil)); end
58
+ def assert_equal(exp, act, msg = T.unsafe(nil)); end
59
+ def assert_in_delta(exp, act, delta = T.unsafe(nil), msg = T.unsafe(nil)); end
60
+ def assert_in_epsilon(exp, act, epsilon = T.unsafe(nil), msg = T.unsafe(nil)); end
61
+ def assert_includes(collection, obj, msg = T.unsafe(nil)); end
62
+ def assert_instance_of(cls, obj, msg = T.unsafe(nil)); end
63
+ def assert_kind_of(cls, obj, msg = T.unsafe(nil)); end
64
+ def assert_match(matcher, obj, msg = T.unsafe(nil)); end
65
+ def assert_nil(obj, msg = T.unsafe(nil)); end
66
+ def assert_operator(o1, op, o2 = T.unsafe(nil), msg = T.unsafe(nil)); end
67
+ def assert_output(stdout = T.unsafe(nil), stderr = T.unsafe(nil)); end
68
+ def assert_path_exists(path, msg = T.unsafe(nil)); end
69
+ def assert_predicate(o1, op, msg = T.unsafe(nil)); end
70
+ def assert_raises(*exp); end
71
+ def assert_respond_to(obj, meth, msg = T.unsafe(nil)); end
72
+ def assert_same(exp, act, msg = T.unsafe(nil)); end
73
+ def assert_send(send_ary, m = T.unsafe(nil)); end
74
+ def assert_silent; end
75
+ def assert_throws(sym, msg = T.unsafe(nil)); end
76
+ def capture_io; end
77
+ def capture_subprocess_io; end
78
+ def diff(exp, act); end
79
+ def exception_details(e, msg); end
80
+ def fail_after(y, m, d, msg); end
81
+ def flunk(msg = T.unsafe(nil)); end
82
+ def message(msg = T.unsafe(nil), ending = T.unsafe(nil), &default); end
83
+ def mu_pp(obj); end
84
+ def mu_pp_for_diff(obj); end
85
+ def pass(_msg = T.unsafe(nil)); end
86
+ def refute(test, msg = T.unsafe(nil)); end
87
+ def refute_empty(obj, msg = T.unsafe(nil)); end
88
+ def refute_equal(exp, act, msg = T.unsafe(nil)); end
89
+ def refute_in_delta(exp, act, delta = T.unsafe(nil), msg = T.unsafe(nil)); end
90
+ def refute_in_epsilon(a, b, epsilon = T.unsafe(nil), msg = T.unsafe(nil)); end
91
+ def refute_includes(collection, obj, msg = T.unsafe(nil)); end
92
+ def refute_instance_of(cls, obj, msg = T.unsafe(nil)); end
93
+ def refute_kind_of(cls, obj, msg = T.unsafe(nil)); end
94
+ def refute_match(matcher, obj, msg = T.unsafe(nil)); end
95
+ def refute_nil(obj, msg = T.unsafe(nil)); end
96
+ def refute_operator(o1, op, o2 = T.unsafe(nil), msg = T.unsafe(nil)); end
97
+ def refute_path_exists(path, msg = T.unsafe(nil)); end
98
+ def refute_predicate(o1, op, msg = T.unsafe(nil)); end
99
+ def refute_respond_to(obj, meth, msg = T.unsafe(nil)); end
100
+ def refute_same(exp, act, msg = T.unsafe(nil)); end
101
+ def skip(msg = T.unsafe(nil), bt = T.unsafe(nil)); end
102
+ def skip_until(y, m, d, msg); end
103
+ def skipped?; end
104
+ def things_to_diff(exp, act); end
105
+
106
+ class << self
107
+ def diff; end
108
+ def diff=(o); end
109
+ end
110
+ end
111
+
112
+ Minitest::Assertions::E = T.let(T.unsafe(nil), String)
113
+ Minitest::Assertions::UNDEFINED = T.let(T.unsafe(nil), Object)
114
+
115
+ class Minitest::BacktraceFilter
116
+ def filter(bt); end
117
+ end
118
+
119
+ Minitest::BacktraceFilter::MT_RE = T.let(T.unsafe(nil), Regexp)
120
+
121
+ class Minitest::CompositeReporter < ::Minitest::AbstractReporter
122
+ def initialize(*reporters); end
123
+
124
+ def <<(reporter); end
125
+ def io; end
126
+ def passed?; end
127
+ def prerecord(klass, name); end
128
+ def record(result); end
129
+ def report; end
130
+ def reporters; end
131
+ def reporters=(_arg0); end
132
+ def start; end
133
+ end
134
+
135
+ Minitest::ENCS = T.let(T.unsafe(nil), TrueClass)
136
+
137
+ module Minitest::Guard
138
+ def jruby?(platform = T.unsafe(nil)); end
139
+ def maglev?(platform = T.unsafe(nil)); end
140
+ def mri?(platform = T.unsafe(nil)); end
141
+ def osx?(platform = T.unsafe(nil)); end
142
+ def rubinius?(platform = T.unsafe(nil)); end
143
+ def windows?(platform = T.unsafe(nil)); end
144
+ end
145
+
146
+ module Minitest::Parallel; end
147
+
148
+ class Minitest::Parallel::Executor
149
+ def initialize(size); end
150
+
151
+ def <<(work); end
152
+ def shutdown; end
153
+ def size; end
154
+ def start; end
155
+ end
156
+
157
+ module Minitest::Parallel::Test
158
+ def _synchronize; end
159
+ end
160
+
161
+ module Minitest::Parallel::Test::ClassMethods
162
+ def run_one_method(klass, method_name, reporter); end
163
+ def test_order; end
164
+ end
165
+
166
+ class Minitest::ProgressReporter < ::Minitest::Reporter
167
+ def prerecord(klass, name); end
168
+ def record(result); end
169
+ end
170
+
171
+ module Minitest::Reportable
172
+ def class_name; end
173
+ def error?; end
174
+ def location; end
175
+ def passed?; end
176
+ def result_code; end
177
+ def skipped?; end
178
+ end
179
+
180
+ class Minitest::Reporter < ::Minitest::AbstractReporter
181
+ def initialize(io = T.unsafe(nil), options = T.unsafe(nil)); end
182
+
183
+ def io; end
184
+ def io=(_arg0); end
185
+ def options; end
186
+ def options=(_arg0); end
187
+ end
188
+
189
+ class Minitest::Result < ::Minitest::Runnable
190
+ include ::Minitest::Reportable
191
+
192
+ def class_name; end
193
+ def klass; end
194
+ def klass=(_arg0); end
195
+ def source_location; end
196
+ def source_location=(_arg0); end
197
+ def to_s; end
198
+
199
+ class << self
200
+ def from(runnable); end
201
+ end
202
+ end
203
+
204
+ class Minitest::Runnable
205
+ def initialize(name); end
206
+
207
+ def assertions; end
208
+ def assertions=(_arg0); end
209
+ def failure; end
210
+ def failures; end
211
+ def failures=(_arg0); end
212
+ def marshal_dump; end
213
+ def marshal_load(ary); end
214
+ def name; end
215
+ def name=(o); end
216
+ def passed?; end
217
+ def result_code; end
218
+ def run; end
219
+ def skipped?; end
220
+ def time; end
221
+ def time=(_arg0); end
222
+ def time_it; end
223
+
224
+ class << self
225
+ def inherited(klass); end
226
+ def methods_matching(re); end
227
+ def on_signal(name, action); end
228
+ def reset; end
229
+ def run(reporter, options = T.unsafe(nil)); end
230
+ def run_one_method(klass, method_name, reporter); end
231
+ def runnable_methods; end
232
+ def runnables; end
233
+ def with_info_handler(reporter, &block); end
234
+ end
235
+ end
236
+
237
+ Minitest::Runnable::SIGNALS = T.let(T.unsafe(nil), Hash)
238
+
239
+ class Minitest::Skip < ::Minitest::Assertion
240
+ def result_label; end
241
+ end
242
+
243
+ class Minitest::StatisticsReporter < ::Minitest::Reporter
244
+ def initialize(io = T.unsafe(nil), options = T.unsafe(nil)); end
245
+
246
+ def assertions; end
247
+ def assertions=(_arg0); end
248
+ def count; end
249
+ def count=(_arg0); end
250
+ def errors; end
251
+ def errors=(_arg0); end
252
+ def failures; end
253
+ def failures=(_arg0); end
254
+ def passed?; end
255
+ def record(result); end
256
+ def report; end
257
+ def results; end
258
+ def results=(_arg0); end
259
+ def skips; end
260
+ def skips=(_arg0); end
261
+ def start; end
262
+ def start_time; end
263
+ def start_time=(_arg0); end
264
+ def total_time; end
265
+ def total_time=(_arg0); end
266
+ end
267
+
268
+ class Minitest::SummaryReporter < ::Minitest::StatisticsReporter
269
+ def aggregated_results(io); end
270
+ def old_sync; end
271
+ def old_sync=(_arg0); end
272
+ def report; end
273
+ def start; end
274
+ def statistics; end
275
+ def summary; end
276
+ def sync; end
277
+ def sync=(_arg0); end
278
+ def to_s; end
279
+
280
+ private
281
+
282
+ def binary_string; end
283
+ end
284
+
285
+ class Minitest::Test < ::Minitest::Runnable
286
+ include ::Minitest::Assertions
287
+ include ::Minitest::Reportable
288
+ include ::Minitest::Test::LifecycleHooks
289
+ include ::Minitest::Guard
290
+ extend ::Minitest::Guard
291
+
292
+ def capture_exceptions; end
293
+ def class_name; end
294
+ def run; end
295
+ def sanitize_exception(e); end
296
+ def with_info_handler(&block); end
297
+
298
+ class << self
299
+ def i_suck_and_my_tests_are_order_dependent!; end
300
+ def io_lock; end
301
+ def io_lock=(_arg0); end
302
+ def make_my_diffs_pretty!; end
303
+ def parallelize_me!; end
304
+ def runnable_methods; end
305
+ def test_order; end
306
+ end
307
+ end
308
+
309
+ module Minitest::Test::LifecycleHooks
310
+ def after_setup; end
311
+ def after_teardown; end
312
+ def before_setup; end
313
+ def before_teardown; end
314
+ def setup; end
315
+ def teardown; end
316
+ end
317
+
318
+ Minitest::Test::PASSTHROUGH_EXCEPTIONS = T.let(T.unsafe(nil), Array)
319
+ Minitest::Test::TEARDOWN_METHODS = T.let(T.unsafe(nil), Array)
320
+
321
+ class Minitest::UnexpectedError < ::Minitest::Assertion
322
+ def initialize(error); end
323
+
324
+ def backtrace; end
325
+ def error; end
326
+ def error=(_arg0); end
327
+ def message; end
328
+ def result_label; end
329
+ end
330
+
331
+ class Minitest::Unit
332
+ class << self
333
+ def after_tests(&b); end
334
+ def autorun; end
335
+ end
336
+ end
337
+
338
+ class Minitest::Unit::TestCase < ::Minitest::Test
339
+ class << self
340
+ def inherited(klass); end
341
+ end
342
+ end
343
+
344
+ Minitest::Unit::VERSION = T.let(T.unsafe(nil), String)
345
+ Minitest::VERSION = T.let(T.unsafe(nil), String)