blib/lib/Venus/Task/Venus/Gen.pm

filter: Statementstmt 39.5% 291 / 736 Branchbran 41.5% 88 / 212 Conditioncond 29.6% 8 / 27 MC/DCmcdc 12.5% 2 / 16 Subroutinesub 32.9% 29 / 88 Podpod 3.7% 3 / 81 totaltotal 36.2% 421 / 1160 CC 117 SCAR 54.6
CC
117
Cov
40%
perform
896.2
render_unit_builders
59.3
render_unit_type
48.4
CRAP 236.0
« blib/lib/Venus/Test.pm ↑ Summary blib/lib/Venus/Role/Mappable.pm »
1 package Venus::Task::Venus::Gen;
2  
3 2 ▶use 5.018;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 # IMPORTS
9  
10 2 ▶use Venus::Class 'attr', 'base';
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 # IMPORTS
13  
14 2 ▶use Venus::Path;
Subroutine BEGIN: called CC=1 SCAR=0.0
15 2 ▶use Venus::Space;
Subroutine BEGIN: called CC=1 SCAR=0.0
16  
17 # REQUIRES
18  
19 2 require Venus;
20  
21 # INHERITS
22  
23 2 base 'Venus::Task::Venus';
24  
25 # METHODS
26  
27 0 ▶sub name {
Subroutine name: not called CC=1 SCAR=6.9
Pod documented
28 0 'vns gen'
29 }
30  
31 0 ▶sub footer {
Subroutine footer: not called CC=1 SCAR=6.9
Pod documented
32  
33 0 return <<"EOF";
34 Copyright 2022-2023, Vesion $Venus::VERSION, The Venus "AUTHOR" and "CONTRIBUTORS"
35  
36 More information on "vns" and/or the "Venus" standard library, visit
37 https://p3rl.org/vns.
38 EOF
39 }
40  
41 5 ▶sub perform {
Subroutine perform: called CC=51 SCAR=68.0
42 5 my ($self) = @_;
43  
44 5 my $data = $self->input_options_defined;
45  
46 5 ▶ $data->{name} ||= 'Example';
Condition100%2/2
$data->{"name"} ||= "Example"
l!l
32
MC/DC100%1/1
$data->{"name"} ||= "Example"
$data->{"name"}
Truth table100%2/2
A
A= $data->{"name"}
Aresult
11
00
47  
48 5 my $space = Venus::Space->new($data->{name});
49  
50 5 my $lfile = $data->{lfile} = $space->format('lfile', 'lib/%s');
51 5 my $tfile = $data->{tfile} = $space->format('tfile', 't/%s');
52  
53 5 my %known = map +($_, 1), qw(
54 build-arg
55 build-args
56 build-nil
57 build-self
58 );
59  
60 5 ▶ if (grep {$known{$_}} keys %{$data}) {
Branch: 1 branch
BranchTrueFalseTotal
if (grep {$known{$_};} keys %{$data;}) 0 5 5
61 0 @{$data->{integrates}} = (
62 'Venus::Role::Buildable',
63 0 (grep { !/^Venus::Role::Buildable$/ } @{$data->{integrates}}),
64 );
65 }
66  
67 5 ▶ if (grep {/^build-/ && !$known{$_}} keys %{$data}) {
Branch: 1 branch
BranchTrueFalseTotal
if (grep {/^build-/u and not $known{$_};} keys %{$data;}) 0 5 5
Condition33%1/3
/^build-/u && !$known{$_}
!ll&&!rl&&r
2600
MC/DC0%0/2
/^build-/u && !$known{$_}
/^build-/u !$known{$_}
Truth table33%1/3
A && not(B)
A= /^build-/uB= !$known{$_}
ABresult
0X0
100
111
68 0 @{$data->{integrates}} = (
69 0 (grep { !/^Venus::Role::Optional$/ } @{$data->{integrates}}),
70 'Venus::Role::Optional',
71 );
72 }
73  
74 5 ▶ if ($data->{kind}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($data->{"kind"}) 0 5 5
75 0 @{$data->{inherits}} = (
76 'Venus::Kind',
77 0 (grep { !/^Venus::Kind$/ } @{$data->{inherits}}),
78 );
79 }
80  
81 5 ▶ if ($data->{value}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($data->{"value"}) 0 5 5
82 0 @{$data->{inherits}} = (
83 'Venus::Kind::Value',
84 0 (grep { !/^Venus::Kind::Value$/ } @{$data->{inherits}}),
85 );
86 }
87  
88 5 ▶ if ($data->{utility}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($data->{"utility"}) 0 5 5
89 0 @{$data->{inherits}} = (
90 'Venus::Kind::Utility',
91 0 (grep { !/^Venus::Kind::Utility$/ } @{$data->{inherits}}),
92 );
93 }
94  
95 5 ▶ if ($data->{accessible}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($data->{"accessible"}) 0 5 5
96 0 @{$data->{integrates}} = (
97 'Venus::Role::Accessible',
98 0 (grep { !/^Venus::Role::Accessible$/ } @{$data->{integrates}}),
99 );
100 }
101  
102 5 ▶ if ($data->{boxable}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($data->{"boxable"}) 0 5 5
103 0 @{$data->{integrates}} = (
104 'Venus::Role::Boxable',
105 0 (grep { !/^Venus::Role::Boxable$/ } @{$data->{integrates}}),
106 );
107 }
108  
109 5 ▶ if ($data->{buildable}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($data->{"buildable"}) 0 5 5
110 0 @{$data->{integrates}} = (
111 'Venus::Role::Buildable',
112 0 (grep { !/^Venus::Role::Buildable$/ } @{$data->{integrates}}),
113 );
114 }
115  
116 5 ▶ if ($data->{catchable}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($data->{"catchable"}) 0 5 5
117 0 @{$data->{integrates}} = (
118 'Venus::Role::Catchable',
119 0 (grep { !/^Venus::Role::Catchable$/ } @{$data->{integrates}}),
120 );
121 }
122  
123 5 ▶ if ($data->{coercible}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($data->{"coercible"}) 0 5 5
124 0 @{$data->{integrates}} = (
125 'Venus::Role::Coercible',
126 0 (grep { !/^Venus::Role::Coercible$/ } @{$data->{integrates}}),
127 );
128 }
129  
130 5 ▶ if ($data->{comparable}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($data->{"comparable"}) 0 5 5
131 0 @{$data->{integrates}} = (
132 'Venus::Role::Comparable',
133 0 (grep { !/^Venus::Role::Comparable$/ } @{$data->{integrates}}),
134 );
135 }
136  
137 5 ▶ if ($data->{defaultable}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($data->{"defaultable"}) 0 5 5
138 0 @{$data->{integrates}} = (
139 'Venus::Role::Defaultable',
140 0 (grep { !/^Venus::Role::Defaultable$/ } @{$data->{integrates}}),
141 );
142 }
143  
144 5 ▶ if ($data->{deferrable}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($data->{"deferrable"}) 0 5 5
145 0 @{$data->{integrates}} = (
146 'Venus::Role::Deferrable',
147 0 (grep { !/^Venus::Role::Deferrable$/ } @{$data->{integrates}}),
148 );
149 }
150  
151 5 ▶ if ($data->{digestable}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($data->{"digestable"}) 0 5 5
152 0 @{$data->{integrates}} = (
153 'Venus::Role::Digestable',
154 0 (grep { !/^Venus::Role::Digestable$/ } @{$data->{integrates}}),
155 );
156 }
157  
158 5 ▶ if ($data->{doable}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($data->{"doable"}) 0 5 5
159 0 @{$data->{integrates}} = (
160 'Venus::Role::Doable',
161 0 (grep { !/^Venus::Role::Doable$/ } @{$data->{integrates}}),
162 );
163 }
164  
165 5 ▶ if ($data->{dumpable}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($data->{"dumpable"}) 0 5 5
166 0 @{$data->{integrates}} = (
167 'Venus::Role::Dumpable',
168 0 (grep { !/^Venus::Role::Dumpable$/ } @{$data->{integrates}}),
169 );
170 }
171  
172 5 ▶ if ($data->{encaseable}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($data->{"encaseable"}) 0 5 5
173 0 @{$data->{integrates}} = (
174 'Venus::Role::Encaseable',
175 0 (grep { !/^Venus::Role::Encaseable$/ } @{$data->{integrates}}),
176 );
177 }
178  
179 5 ▶ if ($data->{explainable}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($data->{"explainable"}) 0 5 5
180 0 @{$data->{integrates}} = (
181 'Venus::Role::Explainable',
182 0 (grep { !/^Venus::Role::Explainable$/ } @{$data->{integrates}}),
183 );
184 }
185  
186 5 ▶ if ($data->{fromable}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($data->{"fromable"}) 0 5 5
187 0 @{$data->{integrates}} = (
188 'Venus::Role::Fromable',
189 0 (grep { !/^Venus::Role::Fromable$/ } @{$data->{integrates}}),
190 );
191 }
192  
193 5 ▶ if ($data->{mappable}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($data->{"mappable"}) 0 5 5
194 0 @{$data->{integrates}} = (
195 'Venus::Role::Mappable',
196 0 (grep { !/^Venus::Role::Mappable$/ } @{$data->{integrates}}),
197 );
198 }
199  
200 5 ▶ if ($data->{matchable}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($data->{"matchable"}) 0 5 5
201 0 @{$data->{integrates}} = (
202 'Venus::Role::Matchable',
203 0 (grep { !/^Venus::Role::Matchable$/ } @{$data->{integrates}}),
204 );
205 }
206  
207 5 ▶ if ($data->{mockable}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($data->{"mockable"}) 0 5 5
208 0 @{$data->{integrates}} = (
209 'Venus::Role::Mockable',
210 0 (grep { !/^Venus::Role::Mockable$/ } @{$data->{integrates}}),
211 );
212 }
213  
214 5 ▶ if ($data->{optional}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($data->{"optional"}) 0 5 5
215 0 @{$data->{integrates}} = (
216 'Venus::Role::Optional',
217 0 (grep { !/^Venus::Role::Optional$/ } @{$data->{integrates}}),
218 );
219 }
220  
221 5 ▶ if ($data->{patchable}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($data->{"patchable"}) 0 5 5
222 0 @{$data->{integrates}} = (
223 'Venus::Role::Patchable',
224 0 (grep { !/^Venus::Role::Patchable$/ } @{$data->{integrates}}),
225 );
226 }
227  
228 5 ▶ if ($data->{pluggable}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($data->{"pluggable"}) 0 5 5
229 0 @{$data->{integrates}} = (
230 'Venus::Role::Pluggable',
231 0 (grep { !/^Venus::Role::Pluggable$/ } @{$data->{integrates}}),
232 );
233 }
234  
235 5 ▶ if ($data->{printable}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($data->{"printable"}) 0 5 5
236 0 @{$data->{integrates}} = (
237 'Venus::Role::Printable',
238 0 (grep { !/^Venus::Role::Printable$/ } @{$data->{integrates}}),
239 );
240 }
241  
242 5 ▶ if ($data->{proxyable}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($data->{"proxyable"}) 0 5 5
243 0 @{$data->{integrates}} = (
244 'Venus::Role::Proxyable',
245 0 (grep { !/^Venus::Role::Proxyable$/ } @{$data->{integrates}}),
246 );
247 }
248  
249 5 ▶ if ($data->{reflectable}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($data->{"reflectable"}) 0 5 5
250 0 @{$data->{integrates}} = (
251 'Venus::Role::Reflectable',
252 0 (grep { !/^Venus::Role::Reflectable$/ } @{$data->{integrates}}),
253 );
254 }
255  
256 5 ▶ if ($data->{rejectable}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($data->{"rejectable"}) 0 5 5
257 0 @{$data->{integrates}} = (
258 'Venus::Role::Rejectable',
259 0 (grep { !/^Venus::Role::Rejectable$/ } @{$data->{integrates}}),
260 );
261 }
262  
263 5 ▶ if ($data->{resultable}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($data->{"resultable"}) 0 5 5
264 0 @{$data->{integrates}} = (
265 'Venus::Role::Resultable',
266 0 (grep { !/^Venus::Role::Resultable$/ } @{$data->{integrates}}),
267 );
268 }
269  
270 5 ▶ if ($data->{serializable}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($data->{"serializable"}) 0 5 5
271 0 @{$data->{integrates}} = (
272 'Venus::Role::Serializable',
273 0 (grep { !/^Venus::Role::Serializable$/ } @{$data->{integrates}}),
274 );
275 }
276  
277 5 ▶ if ($data->{stashable}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($data->{"stashable"}) 0 5 5
278 0 @{$data->{integrates}} = (
279 'Venus::Role::Stashable',
280 0 (grep { !/^Venus::Role::Stashable$/ } @{$data->{integrates}}),
281 );
282 }
283  
284 5 ▶ if ($data->{subscribable}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($data->{"subscribable"}) 0 5 5
285 0 @{$data->{integrates}} = (
286 'Venus::Role::Subscribable',
287 0 (grep { !/^Venus::Role::Subscribable$/ } @{$data->{integrates}}),
288 );
289 }
290  
291 5 ▶ if ($data->{superable}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($data->{"superable"}) 0 5 5
292 0 @{$data->{integrates}} = (
293 'Venus::Role::Superable',
294 0 (grep { !/^Venus::Role::Superable$/ } @{$data->{integrates}}),
295 );
296 }
297  
298 5 ▶ if ($data->{testable}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($data->{"testable"}) 0 5 5
299 0 @{$data->{integrates}} = (
300 'Venus::Role::Testable',
301 0 (grep { !/^Venus::Role::Testable$/ } @{$data->{integrates}}),
302 );
303 }
304  
305 5 ▶ if ($data->{throwable}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($data->{"throwable"}) 0 5 5
306 0 @{$data->{integrates}} = (
307 'Venus::Role::Throwable',
308 0 (grep { !/^Venus::Role::Throwable$/ } @{$data->{integrates}}),
309 );
310 }
311  
312 5 ▶ if ($data->{tryable}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($data->{"tryable"}) 0 5 5
313 0 @{$data->{integrates}} = (
314 'Venus::Role::Tryable',
315 0 (grep { !/^Venus::Role::Tryable$/ } @{$data->{integrates}}),
316 );
317 }
318  
319 5 ▶ if ($data->{unacceptable}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($data->{"unacceptable"}) 0 5 5
320 0 @{$data->{integrates}} = (
321 'Venus::Role::Unacceptable',
322 0 (grep { !/^Venus::Role::Unacceptable$/ } @{$data->{integrates}}),
323 );
324 }
325  
326 5 ▶ if ($data->{unpackable}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($data->{"unpackable"}) 0 5 5
327 0 @{$data->{integrates}} = (
328 'Venus::Role::Unpackable',
329 0 (grep { !/^Venus::Role::Unpackable$/ } @{$data->{integrates}}),
330 );
331 }
332  
333 5 ▶ if ($data->{valuable}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($data->{"valuable"}) 0 5 5
334 0 @{$data->{integrates}} = (
335 'Venus::Role::Valuable',
336 0 (grep { !/^Venus::Role::Valuable$/ } @{$data->{integrates}}),
337 );
338 }
339  
340 5 ▶ if (grep {$data->{$_}} 'class', 'mixin', 'role') {
Branch: 1 branch
BranchTrueFalseTotal
if (grep {$data->{$_};} "class", "mixin", "role") 4 1 5
341 4 my $rendered = join "\n", $self->render_unit;
342  
343 4 ▶ if ($data->{stdout}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($data->{'stdout'}) { } 4 0 4
344 4 $self->log_info($rendered);
345 }
346 else {
347 0 my $path = Venus::Path->new($lfile);
348  
349 0 ▶ if (!$path->exists || $data->{overwrite}) {
Branch: 1 branch
BranchTrueFalseTotal
if (not $path->exists or $data->{'overwrite'}) { } 0 0 0
Condition0%0/3
not $path->exists or $data->{"overwrite"}
l!l&&r!l&&!r
000
MC/DC0%0/2
not $path->exists or $data->{"overwrite"}
not $path->exists $data->{"overwrite"}
Truth table0%0/3
not(A) or B
A= not $path->existsB= $data->{"overwrite"}
ABresult
1X1
011
000
350 0 $path->parent->mkdirs;
351 0 $path->write($rendered);
352 0 $self->log_info("$path created");
353 }
354 else {
355 0 $self->log_error("$path exists");
356 }
357 }
358 }
359  
360 5 ▶ if ($data->{test}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($data->{"test"}) 0 5 5
361 0 my $rendered = join "\n", $self->render_test;
362  
363 0 ▶ if ($data->{stdout}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($data->{'stdout'}) { } 0 0 0
364 0 $self->log_info($rendered);
365 }
366 else {
367 0 my $path = Venus::Path->new($tfile);
368  
369 0 ▶ if (!$path->exists || $data->{overwrite}) {
Branch: 1 branch
BranchTrueFalseTotal
if (not $path->exists or $data->{'overwrite'}) { } 0 0 0
Condition0%0/3
not $path->exists or $data->{"overwrite"}
l!l&&r!l&&!r
000
MC/DC0%0/2
not $path->exists or $data->{"overwrite"}
not $path->exists $data->{"overwrite"}
Truth table0%0/3
not(A) or B
A= not $path->existsB= $data->{"overwrite"}
ABresult
1X1
011
000
370 0 $path->parent->mkdirs;
371 0 $path->write($rendered);
372 0 $self->log_info("$path created");
373 }
374 else {
375 0 $self->log_error("$path exists");
376 }
377 }
378 }
379  
380 5 return $self;
381 }
382  
383 6 ▶sub prepare {
Subroutine prepare: called CC=1 SCAR=0.0
Pod documented
384 6 my ($self) = @_;
385  
386 6 $self->summary('generate Venus source code');
387  
388 # help
389 6 $self->option('help', {
390 name => 'help',
391 help => 'Display the help text.',
392 multiples => 0,
393 required => 0,
394 type => 'boolean',
395 wants => 'boolean',
396 });
397  
398 # name
399 6 $self->option('name', {
400 name => 'name',
401 help => 'The name of the package.',
402 aliases => ['package'],
403 multiples => 0,
404 required => 0,
405 type => 'string',
406 wants => 'string',
407 });
408  
409 # abstract
410 6 $self->option('abstract', {
411 name => 'abstract',
412 help => 'The package abstract.',
413 multiples => 0,
414 required => 0,
415 type => 'string',
416 wants => 'string',
417 });
418  
419 # attributes
420 6 $self->option('attribute', {
421 name => 'attributes',
422 help => 'A package attribute.',
423 aliases => ['attr', 'attribute'],
424 multiples => 1,
425 required => 0,
426 type => 'string',
427 wants => 'string',
428 });
429  
430 # build-arg
431 6 $self->option('build-arg', {
432 name => 'build-arg',
433 help => 'A package object construction build condition.',
434 multiples => 0,
435 required => 0,
436 type => 'boolean',
437 wants => 'boolean',
438 });
439  
440 # build-args
441 6 $self->option('build-args', {
442 name => 'build-args',
443 help => 'A package object construction build condition.',
444 multiples => 0,
445 required => 0,
446 type => 'boolean',
447 wants => 'boolean',
448 });
449  
450 # build-asserts
451 6 $self->option('build-assert', {
452 name => 'build-asserts',
453 help => 'A package attribute assert condition.',
454 aliases => ['build-assert'],
455 multiples => 1,
456 required => 0,
457 type => 'string',
458 wants => 'string',
459 });
460  
461 # build-assert-selfs
462 6 $self->option('build-assert-self', {
463 name => 'build-assert-selfs',
464 help => 'A package attribute self-assert condition.',
465 aliases => ['build-assert-self'],
466 multiples => 1,
467 required => 0,
468 type => 'string',
469 wants => 'string',
470 });
471  
472 # build-attributes
473 6 $self->option('build-attribute', {
474 name => 'build-attributes',
475 help => 'A package attribute build-attribute condition.',
476 aliases => ['build-attribute'],
477 multiples => 1,
478 required => 0,
479 type => 'string',
480 wants => 'string',
481 });
482  
483 # build-attribute-lazys
484 6 $self->option('build-attribute-lazy', {
485 name => 'build-attribute-lazys',
486 help => 'A package attribute lazy-build-attribute condition.',
487 aliases => ['build-attribute-lazy'],
488 multiples => 1,
489 required => 0,
490 type => 'string',
491 wants => 'string',
492 });
493  
494 # build-checks
495 6 $self->option('build-check', {
496 name => 'build-checks',
497 help => 'A package attribute check-attribute condition.',
498 aliases => ['build-check'],
499 multiples => 1,
500 required => 0,
501 type => 'string',
502 wants => 'string',
503 });
504  
505 # build-coerces
506 6 $self->option('build-coerce', {
507 name => 'build-coerces',
508 help => 'A package attribute coerce-attribute condition.',
509 aliases => ['build-coerce'],
510 multiples => 1,
511 required => 0,
512 type => 'string',
513 wants => 'string',
514 });
515  
516 # build-coerce-selfs
517 6 $self->option('build-coerce-self', {
518 name => 'build-coerce-selfs',
519 help => 'A package attribute self-coerce-attribute condition.',
520 aliases => ['build-coerce-self'],
521 multiples => 1,
522 required => 0,
523 type => 'string',
524 wants => 'string',
525 });
526  
527 # build-defaults
528 6 $self->option('build-default', {
529 name => 'build-defaults',
530 help => 'A package attribute default-attribute condition.',
531 aliases => ['build-default'],
532 multiples => 1,
533 required => 0,
534 type => 'string',
535 wants => 'string',
536 });
537  
538 # build-initials
539 6 $self->option('build-initial', {
540 name => 'build-initials',
541 help => 'A package attribute initial-attribute value condition.',
542 aliases => ['build-initial'],
543 multiples => 1,
544 required => 0,
545 type => 'string',
546 wants => 'string',
547 });
548  
549 # build-nil
550 6 $self->option('build-nil', {
551 name => 'build-nil',
552 help => 'A package object construction build condition.',
553 multiples => 0,
554 required => 0,
555 type => 'boolean',
556 wants => 'boolean',
557 });
558  
559 # build-reads
560 6 $self->option('build-read', {
561 name => 'build-reads',
562 help => 'A package attribute read-attribute condition.',
563 aliases => ['build-read'],
564 multiples => 1,
565 required => 0,
566 type => 'string',
567 wants => 'string',
568 });
569  
570 # build-readonlys
571 6 $self->option('build-readonly', {
572 name => 'build-readonlys',
573 help => 'A package attribute readonly-attribute condition.',
574 aliases => ['build-readonly'],
575 multiples => 1,
576 required => 0,
577 type => 'string',
578 wants => 'string',
579 });
580  
581 # build-readwrites
582 6 $self->option('build-readwrite', {
583 name => 'build-readwrites',
584 help => 'A package attribute readwrite-attribute condition.',
585 aliases => ['build-readwrite'],
586 multiples => 1,
587 required => 0,
588 type => 'string',
589 wants => 'string',
590 });
591  
592 # build-requires
593 6 $self->option('build-require', {
594 name => 'build-requires',
595 help => 'A package attribute require-attribute condition.',
596 aliases => ['build-require'],
597 multiples => 1,
598 required => 0,
599 type => 'string',
600 wants => 'string',
601 });
602  
603 # build-self
604 6 $self->option('build-self', {
605 name => 'build-self',
606 help => 'A package object construction build condition.',
607 multiples => 0,
608 required => 0,
609 type => 'boolean',
610 wants => 'boolean',
611 });
612  
613 # build-triggers
614 6 $self->option('build-trigger', {
615 name => 'build-triggers',
616 help => 'A package attribute trigger condition.',
617 aliases => ['build-trigger'],
618 multiples => 1,
619 required => 0,
620 type => 'string',
621 wants => 'string',
622 });
623  
624 # build-writes
625 6 $self->option('build-write', {
626 name => 'build-writes',
627 help => 'A package attribute write-attribute condition.',
628 aliases => ['build-write'],
629 multiples => 1,
630 required => 0,
631 type => 'string',
632 wants => 'string',
633 });
634  
635 # class
636 6 $self->option('class', {
637 name => 'class',
638 help => 'Create package as a class.',
639 aliases => ['c'],
640 multiples => 0,
641 required => 0,
642 type => 'boolean',
643 wants => 'boolean',
644 });
645  
646 # description
647 6 $self->option('description', {
648 name => 'description',
649 help => 'A package description.',
650 aliases => ['desc'],
651 multiples => 0,
652 required => 0,
653 type => 'string',
654 wants => 'string',
655 });
656  
657 # errors
658 6 $self->option('error', {
659 name => 'errors',
660 help => 'A package error.',
661 aliases => ['error'],
662 multiples => 1,
663 required => 0,
664 type => 'string',
665 wants => 'string',
666 });
667  
668 # functions
669 6 $self->option('function', {
670 name => 'functions',
671 help => 'A package function.',
672 aliases => ['function'],
673 multiples => 1,
674 required => 0,
675 type => 'string',
676 wants => 'string',
677 });
678  
679 # imports
680 6 $self->option('import', {
681 name => 'imports',
682 help => 'Declare package imports.',
683 aliases => ['use', 'import'],
684 multiples => 1,
685 required => 0,
686 type => 'string',
687 wants => 'string',
688 });
689  
690 # inherits
691 6 $self->option('inherit', {
692 name => 'inherits',
693 help => 'Declare packages to inherit.',
694 aliases => ['base', 'inherit'],
695 multiples => 1,
696 required => 0,
697 type => 'string',
698 wants => 'string',
699 });
700  
701 # integrates
702 6 $self->option('integrate', {
703 name => 'integrates',
704 help => 'Declare packages to integrate.',
705 aliases => ['with', 'integrate'],
706 multiples => 1,
707 required => 0,
708 type => 'string',
709 wants => 'string',
710 });
711  
712 # hook
713 6 $self->option('hook', {
714 name => 'hooks',
715 help => 'Declare a package hook.',
716 aliases => ['hook'],
717 multiples => 1,
718 required => 0,
719 type => 'string',
720 wants => 'string',
721 });
722  
723 # methods
724 6 $self->option('method', {
725 name => 'methods',
726 help => 'A package method.',
727 aliases => ['method'],
728 multiples => 1,
729 required => 0,
730 type => 'string',
731 wants => 'string',
732 });
733  
734 # mixin
735 6 $self->option('mixin', {
736 name => 'mixin',
737 help => 'Create package as a mixin.',
738 aliases => ['m'],
739 multiples => 0,
740 required => 0,
741 type => 'boolean',
742 wants => 'boolean',
743 });
744  
745 # overwrite output file
746 6 $self->option('overwrite', {
747 name => 'overwrite',
748 help => 'Option to overwrite the output file if it already exists.',
749 multiples => 0,
750 required => 0,
751 type => 'boolean',
752 wants => 'boolean',
753 });
754  
755 # ours
756 6 $self->option('our', {
757 name => 'ours',
758 help => 'A package variable.',
759 aliases => ['our'],
760 multiples => 1,
761 required => 0,
762 type => 'string',
763 wants => 'string',
764 });
765  
766 # requires
767 6 $self->option('require', {
768 name => 'requires',
769 help => 'A package require.',
770 aliases => ['require'],
771 multiples => 1,
772 required => 0,
773 type => 'string',
774 wants => 'string',
775 });
776  
777 # role
778 6 $self->option('role', {
779 name => 'role',
780 help => 'Create package as a role.',
781 aliases => ['r'],
782 multiples => 0,
783 required => 0,
784 type => 'boolean',
785 wants => 'boolean',
786 });
787  
788 # routines
789 6 $self->option('routine', {
790 name => 'routines',
791 help => 'A package routine.',
792 aliases => ['routine'],
793 multiples => 1,
794 required => 0,
795 type => 'string',
796 wants => 'string',
797 });
798  
799 # states
800 6 $self->option('state', {
801 name => 'states',
802 help => 'A package state variable.',
803 aliases => ['state'],
804 multiples => 1,
805 required => 0,
806 type => 'string',
807 wants => 'string',
808 });
809  
810 # output to stdout
811 6 $self->option('stdout', {
812 name => 'stdout',
813 help => 'Output the generated code to STDOUT.',
814 aliases => ['p', 'print'],
815 multiples => 0,
816 required => 0,
817 type => 'boolean',
818 wants => 'boolean',
819 });
820  
821 # tagline
822 6 $self->option('tagline', {
823 name => 'tagline',
824 help => 'A package tagline.',
825 multiples => 0,
826 required => 0,
827 type => 'string',
828 wants => 'string',
829 });
830  
831 # test
832 6 $self->option('test', {
833 name => 'test',
834 help => 'Create test for package.',
835 aliases => ['t'],
836 multiples => 0,
837 required => 0,
838 type => 'boolean',
839 wants => 'boolean',
840 });
841  
842 # kind
843 6 $self->option('kind', {
844 name => 'kind',
845 help => 'Inherits from Venus::Kind.',
846 multiples => 0,
847 required => 0,
848 type => 'boolean',
849 wants => 'boolean',
850 });
851  
852 # value
853 6 $self->option('value', {
854 name => 'value',
855 help => 'Inherits from Venus::Kind::Value.',
856 multiples => 0,
857 required => 0,
858 type => 'boolean',
859 wants => 'boolean',
860 });
861  
862 # utility
863 6 $self->option('utility', {
864 name => 'utility',
865 help => 'Inherits from Venus::Kind::Utility.',
866 multiples => 0,
867 required => 0,
868 type => 'boolean',
869 wants => 'boolean',
870 });
871  
872 # accessible
873 6 $self->option('accessible', {
874 name => 'accessible',
875 help => 'Integrate with Venus::Role::Accessible.',
876 multiples => 0,
877 required => 0,
878 type => 'boolean',
879 wants => 'boolean',
880 });
881  
882 # boxable
883 6 $self->option('boxable', {
884 name => 'boxable',
885 help => 'Integrate with Venus::Role::Boxable.',
886 multiples => 0,
887 required => 0,
888 type => 'boolean',
889 wants => 'boolean',
890 });
891  
892 # buildable
893 6 $self->option('buildable', {
894 name => 'buildable',
895 help => 'Integrate with Venus::Role::Buildable.',
896 multiples => 0,
897 required => 0,
898 type => 'boolean',
899 wants => 'boolean',
900 });
901  
902 # catchable
903 6 $self->option('catchable', {
904 name => 'catchable',
905 help => 'Integrate with Venus::Role::Catchable.',
906 multiples => 0,
907 required => 0,
908 type => 'boolean',
909 wants => 'boolean',
910 });
911  
912 # coercible
913 6 $self->option('coercible', {
914 name => 'coercible',
915 help => 'Integrate with Venus::Role::Coercible.',
916 multiples => 0,
917 required => 0,
918 type => 'boolean',
919 wants => 'boolean',
920 });
921  
922 # comparable
923 6 $self->option('comparable', {
924 name => 'comparable',
925 help => 'Integrate with Venus::Role::Comparable.',
926 multiples => 0,
927 required => 0,
928 type => 'boolean',
929 wants => 'boolean',
930 });
931  
932 # defaultable
933 6 $self->option('defaultable', {
934 name => 'defaultable',
935 help => 'Integrate with Venus::Role::Defaultable.',
936 multiples => 0,
937 required => 0,
938 type => 'boolean',
939 wants => 'boolean',
940 });
941  
942 # deferrable
943 6 $self->option('deferrable', {
944 name => 'deferrable',
945 help => 'Integrate with Venus::Role::Deferrable.',
946 multiples => 0,
947 required => 0,
948 type => 'boolean',
949 wants => 'boolean',
950 });
951  
952 # digestable
953 6 $self->option('digestable', {
954 name => 'digestable',
955 help => 'Integrate with Venus::Role::Digestable.',
956 multiples => 0,
957 required => 0,
958 type => 'boolean',
959 wants => 'boolean',
960 });
961  
962 # doable
963 6 $self->option('doable', {
964 name => 'doable',
965 help => 'Integrate with Venus::Role::Doable.',
966 multiples => 0,
967 required => 0,
968 type => 'boolean',
969 wants => 'boolean',
970 });
971  
972 # dumpable
973 6 $self->option('dumpable', {
974 name => 'dumpable',
975 help => 'Integrate with Venus::Role::Dumpable.',
976 multiples => 0,
977 required => 0,
978 type => 'boolean',
979 wants => 'boolean',
980 });
981  
982 # encaseable
983 6 $self->option('encaseable', {
984 name => 'encaseable',
985 help => 'Integrate with Venus::Role::Encaseable.',
986 multiples => 0,
987 required => 0,
988 type => 'boolean',
989 wants => 'boolean',
990 });
991  
992 # explainable
993 6 $self->option('explainable', {
994 name => 'explainable',
995 help => 'Integrate with Venus::Role::Explainable.',
996 multiples => 0,
997 required => 0,
998 type => 'boolean',
999 wants => 'boolean',
1000 });
1001  
1002 # fromable
1003 6 $self->option('fromable', {
1004 name => 'fromable',
1005 help => 'Integrate with Venus::Role::Fromable.',
1006 multiples => 0,
1007 required => 0,
1008 type => 'boolean',
1009 wants => 'boolean',
1010 });
1011  
1012 # mappable
1013 6 $self->option('mappable', {
1014 name => 'mappable',
1015 help => 'Integrate with Venus::Role::Mappable.',
1016 multiples => 0,
1017 required => 0,
1018 type => 'boolean',
1019 wants => 'boolean',
1020 });
1021  
1022 # matchable
1023 6 $self->option('matchable', {
1024 name => 'matchable',
1025 help => 'Integrate with Venus::Role::Matchable.',
1026 multiples => 0,
1027 required => 0,
1028 type => 'boolean',
1029 wants => 'boolean',
1030 });
1031  
1032 # mockable
1033 6 $self->option('mockable', {
1034 name => 'mockable',
1035 help => 'Integrate with Venus::Role::Mockable.',
1036 multiples => 0,
1037 required => 0,
1038 type => 'boolean',
1039 wants => 'boolean',
1040 });
1041  
1042 # optional
1043 6 $self->option('optional', {
1044 name => 'optional',
1045 help => 'Integrate with Venus::Role::Optional.',
1046 multiples => 0,
1047 required => 0,
1048 type => 'boolean',
1049 wants => 'boolean',
1050 });
1051  
1052 # patchable
1053 6 $self->option('patchable', {
1054 name => 'patchable',
1055 help => 'Integrate with Venus::Role::Patchable.',
1056 multiples => 0,
1057 required => 0,
1058 type => 'boolean',
1059 wants => 'boolean',
1060 });
1061  
1062 # pluggable
1063 6 $self->option('pluggable', {
1064 name => 'pluggable',
1065 help => 'Integrate with Venus::Role::Pluggable.',
1066 multiples => 0,
1067 required => 0,
1068 type => 'boolean',
1069 wants => 'boolean',
1070 });
1071  
1072 # printable
1073 6 $self->option('printable', {
1074 name => 'printable',
1075 help => 'Integrate with Venus::Role::Printable.',
1076 multiples => 0,
1077 required => 0,
1078 type => 'boolean',
1079 wants => 'boolean',
1080 });
1081  
1082 # proxyable
1083 6 $self->option('proxyable', {
1084 name => 'proxyable',
1085 help => 'Integrate with Venus::Role::Proxyable.',
1086 multiples => 0,
1087 required => 0,
1088 type => 'boolean',
1089 wants => 'boolean',
1090 });
1091  
1092 # reflectable
1093 6 $self->option('reflectable', {
1094 name => 'reflectable',
1095 help => 'Integrate with Venus::Role::Reflectable.',
1096 multiples => 0,
1097 required => 0,
1098 type => 'boolean',
1099 wants => 'boolean',
1100 });
1101  
1102 # rejectable
1103 6 $self->option('rejectable', {
1104 name => 'rejectable',
1105 help => 'Integrate with Venus::Role::Rejectable.',
1106 multiples => 0,
1107 required => 0,
1108 type => 'boolean',
1109 wants => 'boolean',
1110 });
1111  
1112 # resultable
1113 6 $self->option('resultable', {
1114 name => 'resultable',
1115 help => 'Integrate with Venus::Role::Resultable.',
1116 multiples => 0,
1117 required => 0,
1118 type => 'boolean',
1119 wants => 'boolean',
1120 });
1121  
1122 # serializable
1123 6 $self->option('serializable', {
1124 name => 'serializable',
1125 help => 'Integrate with Venus::Role::Serializable.',
1126 multiples => 0,
1127 required => 0,
1128 type => 'boolean',
1129 wants => 'boolean',
1130 });
1131  
1132 # stashable
1133 6 $self->option('stashable', {
1134 name => 'stashable',
1135 help => 'Integrate with Venus::Role::Stashable.',
1136 multiples => 0,
1137 required => 0,
1138 type => 'boolean',
1139 wants => 'boolean',
1140 });
1141  
1142 # subscribable
1143 6 $self->option('subscribable', {
1144 name => 'subscribable',
1145 help => 'Integrate with Venus::Role::Subscribable.',
1146 multiples => 0,
1147 required => 0,
1148 type => 'boolean',
1149 wants => 'boolean',
1150 });
1151  
1152 # superable
1153 6 $self->option('superable', {
1154 name => 'superable',
1155 help => 'Integrate with Venus::Role::Superable.',
1156 multiples => 0,
1157 required => 0,
1158 type => 'boolean',
1159 wants => 'boolean',
1160 });
1161  
1162 # testable
1163 6 $self->option('testable', {
1164 name => 'testable',
1165 help => 'Integrate with Venus::Role::Testable.',
1166 multiples => 0,
1167 required => 0,
1168 type => 'boolean',
1169 wants => 'boolean',
1170 });
1171  
1172 # throwable
1173 6 $self->option('throwable', {
1174 name => 'throwable',
1175 help => 'Integrate with Venus::Role::Throwable.',
1176 multiples => 0,
1177 required => 0,
1178 type => 'boolean',
1179 wants => 'boolean',
1180 });
1181  
1182 # tryable
1183 6 $self->option('tryable', {
1184 name => 'tryable',
1185 help => 'Integrate with Venus::Role::Tryable.',
1186 multiples => 0,
1187 required => 0,
1188 type => 'boolean',
1189 wants => 'boolean',
1190 });
1191  
1192 # unacceptable
1193 6 $self->option('unacceptable', {
1194 name => 'unacceptable',
1195 help => 'Integrate with Venus::Role::Unacceptable.',
1196 multiples => 0,
1197 required => 0,
1198 type => 'boolean',
1199 wants => 'boolean',
1200 });
1201  
1202 # unpackable
1203 6 $self->option('unpackable', {
1204 name => 'unpackable',
1205 help => 'Integrate with Venus::Role::Unpackable.',
1206 multiples => 0,
1207 required => 0,
1208 type => 'boolean',
1209 wants => 'boolean',
1210 });
1211  
1212 # valuable
1213 6 $self->option('valuable', {
1214 name => 'valuable',
1215 help => 'Integrate with Venus::Role::Valuable.',
1216 multiples => 0,
1217 required => 0,
1218 type => 'boolean',
1219 wants => 'boolean',
1220 });
1221  
1222 # event-args
1223 6 $self->option('event-args', {
1224 name => 'event-args',
1225 help => 'Declare a package "args" lifecycle event.',
1226 multiples => 0,
1227 required => 0,
1228 type => 'boolean',
1229 wants => 'boolean',
1230 });
1231  
1232 # event-attr
1233 6 $self->option('event-attr', {
1234 name => 'event-attr',
1235 help => 'Declare a package "attr" lifecycle event.',
1236 multiples => 0,
1237 required => 0,
1238 type => 'boolean',
1239 wants => 'boolean',
1240 });
1241  
1242 # event-audit
1243 6 $self->option('event-audit', {
1244 name => 'event-audit',
1245 help => 'Declare a package "audit" lifecycle event.',
1246 multiples => 0,
1247 required => 0,
1248 type => 'boolean',
1249 wants => 'boolean',
1250 });
1251  
1252 # event-base
1253 6 $self->option('event-base', {
1254 name => 'event-base',
1255 help => 'Declare a package "base" lifecycle event.',
1256 multiples => 0,
1257 required => 0,
1258 type => 'boolean',
1259 wants => 'boolean',
1260 });
1261  
1262 # event-bless
1263 6 $self->option('event-bless', {
1264 name => 'event-bless',
1265 help => 'Declare a package "bless" lifecycle event.',
1266 multiples => 0,
1267 required => 0,
1268 type => 'boolean',
1269 wants => 'boolean',
1270 });
1271  
1272 # event-build
1273 6 $self->option('event-build', {
1274 name => 'event-build',
1275 help => 'Declare a package "build" lifecycle event.',
1276 multiples => 0,
1277 required => 0,
1278 type => 'boolean',
1279 wants => 'boolean',
1280 });
1281  
1282 # event-buildargs
1283 6 $self->option('event-buildargs', {
1284 name => 'event-buildargs',
1285 help => 'Declare a package "buildargs" lifecycle event.',
1286 multiples => 0,
1287 required => 0,
1288 type => 'boolean',
1289 wants => 'boolean',
1290 });
1291  
1292 # event-clone
1293 6 $self->option('event-clone', {
1294 name => 'event-clone',
1295 help => 'Declare a package "clone" lifecycle event.',
1296 multiples => 0,
1297 required => 0,
1298 type => 'boolean',
1299 wants => 'boolean',
1300 });
1301  
1302 # event-construct
1303 6 $self->option('event-construct', {
1304 name => 'event-construct',
1305 help => 'Declare a package "construct" lifecycle event.',
1306 multiples => 0,
1307 required => 0,
1308 type => 'boolean',
1309 wants => 'boolean',
1310 });
1311  
1312 # event-data
1313 6 $self->option('event-data', {
1314 name => 'event-data',
1315 help => 'Declare a package "data" lifecycle event.',
1316 multiples => 0,
1317 required => 0,
1318 type => 'boolean',
1319 wants => 'boolean',
1320 });
1321  
1322 # event-deconstruct
1323 6 $self->option('event-deconstruct', {
1324 name => 'event-deconstruct',
1325 help => 'Declare a package "deconstruct" lifecycle event.',
1326 multiples => 0,
1327 required => 0,
1328 type => 'boolean',
1329 wants => 'boolean',
1330 });
1331  
1332 # event-destroy
1333 6 $self->option('event-destroy', {
1334 name => 'event-destroy',
1335 help => 'Declare a package "destroy" lifecycle event.',
1336 multiples => 0,
1337 required => 0,
1338 type => 'boolean',
1339 wants => 'boolean',
1340 });
1341  
1342 # event-does
1343 6 $self->option('event-does', {
1344 name => 'event-does',
1345 help => 'Declare a package "does" lifecycle event.',
1346 multiples => 0,
1347 required => 0,
1348 type => 'boolean',
1349 wants => 'boolean',
1350 });
1351  
1352 # event-export
1353 6 $self->option('event-export', {
1354 name => 'event-export',
1355 help => 'Declare a package "export" lifecycle event.',
1356 multiples => 0,
1357 required => 0,
1358 type => 'boolean',
1359 wants => 'boolean',
1360 });
1361  
1362 # event-from
1363 6 $self->option('event-from', {
1364 name => 'event-from',
1365 help => 'Declare a package "from" lifecycle event.',
1366 multiples => 0,
1367 required => 0,
1368 type => 'boolean',
1369 wants => 'boolean',
1370 });
1371  
1372 # event-get
1373 6 $self->option('event-get', {
1374 name => 'event-get',
1375 help => 'Declare a package "get" lifecycle event.',
1376 multiples => 0,
1377 required => 0,
1378 type => 'boolean',
1379 wants => 'boolean',
1380 });
1381  
1382 # event-import
1383 6 $self->option('event-import', {
1384 name => 'event-import',
1385 help => 'Declare a package "import" lifecycle event.',
1386 multiples => 0,
1387 required => 0,
1388 type => 'boolean',
1389 wants => 'boolean',
1390 });
1391  
1392 # event-item
1393 6 $self->option('event-item', {
1394 name => 'event-item',
1395 help => 'Declare a package "item" lifecycle event.',
1396 multiples => 0,
1397 required => 0,
1398 type => 'boolean',
1399 wants => 'boolean',
1400 });
1401  
1402 # event-mask
1403 6 $self->option('event-mask', {
1404 name => 'event-mask',
1405 help => 'Declare a package "mask" lifecycle event.',
1406 multiples => 0,
1407 required => 0,
1408 type => 'boolean',
1409 wants => 'boolean',
1410 });
1411  
1412 # event-meta
1413 6 $self->option('event-meta', {
1414 name => 'event-meta',
1415 help => 'Declare a package "meta" lifecycle event.',
1416 multiples => 0,
1417 required => 0,
1418 type => 'boolean',
1419 wants => 'boolean',
1420 });
1421  
1422 # event-metacache
1423 6 $self->option('event-metacache', {
1424 name => 'event-metacache',
1425 help => 'Declare a package "metacache" lifecycle event.',
1426 multiples => 0,
1427 required => 0,
1428 type => 'boolean',
1429 wants => 'boolean',
1430 });
1431  
1432 # event-mixin
1433 6 $self->option('event-mixin', {
1434 name => 'event-mixin',
1435 help => 'Declare a package "mixin" lifecycle event.',
1436 multiples => 0,
1437 required => 0,
1438 type => 'boolean',
1439 wants => 'boolean',
1440 });
1441  
1442 # event-name
1443 6 $self->option('event-name', {
1444 name => 'event-name',
1445 help => 'Declare a package "name" lifecycle event.',
1446 multiples => 0,
1447 required => 0,
1448 type => 'boolean',
1449 wants => 'boolean',
1450 });
1451  
1452 # event-role
1453 6 $self->option('event-role', {
1454 name => 'event-role',
1455 help => 'Declare a package "role" lifecycle event.',
1456 multiples => 0,
1457 required => 0,
1458 type => 'boolean',
1459 wants => 'boolean',
1460 });
1461  
1462 # event-set
1463 6 $self->option('event-set', {
1464 name => 'event-set',
1465 help => 'Declare a package "set" lifecycle event.',
1466 multiples => 0,
1467 required => 0,
1468 type => 'boolean',
1469 wants => 'boolean',
1470 });
1471  
1472 # event-store
1473 6 $self->option('event-store', {
1474 name => 'event-store',
1475 help => 'Declare a package "store" lifecycle event.',
1476 multiples => 0,
1477 required => 0,
1478 type => 'boolean',
1479 wants => 'boolean',
1480 });
1481  
1482 # event-subs
1483 6 $self->option('event-subs', {
1484 name => 'event-subs',
1485 help => 'Declare a package "subs" lifecycle event.',
1486 multiples => 0,
1487 required => 0,
1488 type => 'boolean',
1489 wants => 'boolean',
1490 });
1491  
1492 # event-test
1493 6 $self->option('event-test', {
1494 name => 'event-test',
1495 help => 'Declare a package "test" lifecycle event.',
1496 multiples => 0,
1497 required => 0,
1498 type => 'boolean',
1499 wants => 'boolean',
1500 });
1501  
1502 # event-unimport
1503 6 $self->option('event-unimport', {
1504 name => 'event-unimport',
1505 help => 'Declare a package "unimport" lifecycle event.',
1506 multiples => 0,
1507 required => 0,
1508 type => 'boolean',
1509 wants => 'boolean',
1510 });
1511  
1512 # event-use
1513 6 $self->option('event-use', {
1514 name => 'event-use',
1515 help => 'Declare a package "use" lifecycle event.',
1516 multiples => 0,
1517 required => 0,
1518 type => 'boolean',
1519 wants => 'boolean',
1520 });
1521  
1522 # authority
1523 6 $self->option('authority', {
1524 name => 'authority',
1525 help => 'The authority of the package.',
1526 multiples => 0,
1527 required => 0,
1528 type => 'string',
1529 wants => 'string',
1530 });
1531  
1532 # version
1533 6 $self->option('version', {
1534 name => 'version',
1535 help => 'The version of the package.',
1536 multiples => 0,
1537 required => 0,
1538 type => 'string',
1539 wants => 'string',
1540 });
1541  
1542 6 return $self;
1543 }
1544  
1545 0 ▶sub render_test {
Subroutine render_test: not called CC=1 SCAR=6.9
Pod undocumented
1546 0 my ($self) = @_;
1547  
1548 0 my $data = $self->input_options;
1549  
1550 return (
1551 0 $self->render_test_head,
1552 $self->render_test_name,
1553 $self->render_test_tagline,
1554 $self->render_test_abstract,
1555 $self->render_test_includes,
1556 $self->render_test_synopsis,
1557 $self->render_test_description,
1558 $self->render_test_inherits,
1559 $self->render_test_integrates,
1560 $self->render_test_attributes,
1561 $self->render_test_functions,
1562 $self->render_test_methods,
1563 $self->render_test_routines,
1564 $self->render_test_errors,
1565 $self->render_test_tail,
1566 "\$test->done;",
1567 );
1568 }
1569  
1570 0 ▶sub render_test_abstract {
Subroutine render_test_abstract: not called CC=2 SCAR=17.9
Pod undocumented
1571 0 my ($self) = @_;
1572  
1573 0 my $data = $self->input_options;
1574  
1575 0 my $abstract = $data->{abstract};
1576  
1577 0 ▶ return () if !$abstract;
Branch: 1 branch
BranchTrueFalseTotal
unless $abstract 0 0 0
1578  
1579 0 my $text = <<"EOF";
1580 +=abstract
1581  
1582 ${abstract}
1583  
1584 +=cut
1585  
1586 \$test->for('abstract');
1587 EOF
1588  
1589 0 $text =~ s/^\+=/=/gm;
1590  
1591 0 return ($text);
1592 }
1593  
1594 0 ▶sub render_test_attribute {
Subroutine render_test_attribute: not called CC=1 SCAR=6.9
Pod undocumented
1595 0 my ($self, $data) = @_;
1596  
1597 0 my $text = <<"EOF";
1598 +=attribute ${data}
1599  
1600 The ${data} attribute ...
1601  
1602 +=signature ${data}
1603  
1604 ${data}(any \@data) (any)
1605  
1606 +=metadata ${data}
1607  
1608 {
1609 since => '0.00',
1610 }
1611  
1612 +=example-1 ${data}
1613  
1614 # given: synopsis
1615  
1616 package main;
1617  
1618 my \$${data} = \$self->${data};
1619  
1620 # ()
1621  
1622 +=cut
1623  
1624 \$test->for('example', 1, '${data}', sub {
1625 my (\$tryable) = \@_;
1626 my \$result = \$tryable->result;
1627 ok \$result;
1628  
1629 \$result
1630 });
1631 EOF
1632  
1633 0 $text =~ s/^\+=/=/gm;
1634  
1635 0 return ($text);
1636 }
1637  
1638 0 ▶sub render_test_attributes {
Subroutine render_test_attributes: not called CC=2 SCAR=17.9
Pod undocumented
1639 0 my ($self) = @_;
1640  
1641 0 my $data = $self->input_options;
1642  
1643 return $data->{attributes}
1644 ? (
1645 map $self->render_test_attribute($_),
1646 0 ▶ @{$data->{attributes}}
Branch: 1 branch
BranchTrueFalseTotal
$data->{'attributes'} ? : 0 0 0
1647 )
1648 : ();
1649 }
1650  
1651 0 ▶sub render_test_build_assert {
Subroutine render_test_build_assert: not called CC=1 SCAR=6.9
Pod undocumented
1652 0 my ($self, $data) = @_;
1653  
1654 0 my $text = <<"EOF";
1655 sub assert_${data} {
1656 my (\$self, \$data) = \@_;
1657  
1658 return 'any';
1659 }
1660 EOF
1661  
1662 0 chomp $text;
1663  
1664 0 return ($text);
1665 }
1666  
1667 0 ▶sub render_test_build_assert_self {
Subroutine render_test_build_assert_self: not called CC=1 SCAR=6.9
Pod undocumented
1668 0 my ($self, $data) = @_;
1669  
1670 0 my $text = <<"EOF";
1671 sub self_assert_${data} {
1672 my (\$self, \$data) = \@_;
1673  
1674 die 'Bad ${data}' if \$data;
1675 }
1676 EOF
1677  
1678 0 chomp $text;
1679  
1680 0 return ($text);
1681 }
1682  
1683 0 ▶sub render_test_description {
Subroutine render_test_description: not called CC=2 SCAR=17.9
Pod undocumented
1684 0 my ($self) = @_;
1685  
1686 0 my $data = $self->input_options;
1687  
1688 0 my $description = $data->{description};
1689  
1690 0 ▶ return () if !$description;
Branch: 1 branch
BranchTrueFalseTotal
unless $description 0 0 0
1691  
1692 0 my $text = <<"EOF";
1693 +=description
1694  
1695 ${description}
1696  
1697 +=cut
1698  
1699 \$test->for('description');
1700 EOF
1701  
1702 0 $text =~ s/^\+=/=/gm;
1703  
1704 0 return ($text);
1705 }
1706  
1707 0 ▶sub render_test_error {
Subroutine render_test_error: not called CC=1 SCAR=6.9
Pod undocumented
1708 0 my ($self, $data) = @_;
1709  
1710 0 my $text = <<"EOF";
1711 +=error error_on_${data}
1712  
1713 This package may raise an C<on.${data}> error, as an instance of
1714 C<Example::Error>, via the C<error_on_${data}> method.
1715  
1716 +=cut
1717  
1718 \$test->for('error', 'error_on_${data}');
1719  
1720 +=example-1 error_on_${data}
1721  
1722 # given: synopsis;
1723  
1724 my \$error = \$self->error_on_${data}({});
1725  
1726 # ...
1727  
1728 # my \$name = \$error->name;
1729  
1730 # "on.${data}"
1731  
1732 # my \$render = \$error->render;
1733  
1734 # "Exception!"
1735  
1736 +=cut
1737  
1738 \$test->for('example', 1, 'error_on_${data}', sub {
1739 my (\$tryable) = \@_;
1740 my \$result = \$tryable->result;
1741 isa_ok \$result, 'Venus::Error';
1742 my \$name = \$result->name;
1743 is \$name, "on.${data}";
1744 my \$render = \$result->render;
1745 is \$render, "...";
1746  
1747 \$result
1748 });
1749 EOF
1750  
1751 0 $text =~ s/^\+=/=/gm;
1752  
1753 0 chomp $text;
1754  
1755 0 return ($text);
1756 }
1757  
1758 0 ▶sub render_test_errors {
Subroutine render_test_errors: not called CC=2 SCAR=17.9
Pod undocumented
1759 0 my ($self) = @_;
1760  
1761 0 my $data = $self->input_options;
1762  
1763 return $data->{errors}
1764 0 ▶ ? ((map $self->render_test_error($_), @{$data->{errors}}), "")
Branch: 1 branch
BranchTrueFalseTotal
$data->{'errors'} ? : 0 0 0
1765 : ();
1766 }
1767  
1768 0 ▶sub render_test_function {
Subroutine render_test_function: not called CC=1 SCAR=6.9
Pod undocumented
1769 0 my ($self, $data) = @_;
1770  
1771 0 my $text = <<"EOF";
1772 +=function ${data}
1773  
1774 The ${data} function ...
1775  
1776 +=signature ${data}
1777  
1778 ${data}(any \@data) (any)
1779  
1780 +=metadata ${data}
1781  
1782 {
1783 since => '0.00',
1784 }
1785  
1786 +=example-1 ${data}
1787  
1788 # given: synopsis
1789  
1790 package main;
1791  
1792 my \$${data} = ${data}\(\);
1793  
1794 # ()
1795  
1796 +=cut
1797  
1798 \$test->for('example', 1, '${data}', sub {
1799 my (\$tryable) = \@_;
1800 my \$result = \$tryable->result;
1801 ok \$result;
1802  
1803 \$result
1804 });
1805 EOF
1806  
1807 0 $text =~ s/^\+=/=/gm;
1808  
1809 0 return ($text);
1810 }
1811  
1812 0 ▶sub render_test_functions {
Subroutine render_test_functions: not called CC=2 SCAR=17.9
Pod undocumented
1813 0 my ($self) = @_;
1814  
1815 0 my $data = $self->input_options;
1816  
1817 return $data->{functions}
1818 0 ▶ ? (map $self->render_test_function($_), @{$data->{functions}})
Branch: 1 branch
BranchTrueFalseTotal
$data->{'functions'} ? : 0 0 0
1819 : ();
1820 }
1821  
1822 0 ▶sub render_test_head {
Subroutine render_test_head: not called CC=1 SCAR=6.9
Pod undocumented
1823 0 my ($self) = @_;
1824  
1825 0 my $data = $self->input_options;
1826  
1827 0 my $text = <<"EOF";
1828 package main;
1829  
1830 use 5.018;
1831  
1832 use strict;
1833 use warnings;
1834  
1835 use Test::More;
1836 use Venus::Test;
1837  
1838 my \$test = test(__FILE__);
1839 EOF
1840  
1841 0 return ($text);
1842 }
1843  
1844 0 ▶sub render_test_includes {
Subroutine render_test_includes: not called CC=5 SCAR=34.0
Pod undocumented
1845 0 my ($self) = @_;
1846  
1847 0 my $data = $self->input_options;
1848  
1849 0 my @text;
1850  
1851 push @text, $data->{functions}
1852 ? (
1853 map "function: $_",
1854 0 ▶ @{$data->{functions}}
Branch: 1 branch
BranchTrueFalseTotal
$data->{'functions'} ? : 0 0 0
1855 )
1856 : ();
1857  
1858 push @text, $data->{methods}
1859 ? (
1860 map "method: $_",
1861 0 ▶ @{$data->{methods}}
Branch: 1 branch
BranchTrueFalseTotal
$data->{'methods'} ? : 0 0 0
1862 )
1863 : ();
1864  
1865 push @text, $data->{routines}
1866 ? (
1867 map "routine: $_",
1868 0 ▶ @{$data->{routines}}
Branch: 1 branch
BranchTrueFalseTotal
$data->{'routines'} ? : 0 0 0
1869 )
1870 : ();
1871  
1872 0 ▶ @text = @text ? ("=includes", "", @text, "", "=cut", "", "\$test->for('includes');", "") : ();
Branch: 1 branch
BranchTrueFalseTotal
@text ? : 0 0 0
1873  
1874 0 return (@text);
1875 }
1876  
1877 0 ▶sub render_test_inherit {
Subroutine render_test_inherit: not called CC=1 SCAR=6.9
Pod undocumented
1878 0 my ($self, $data) = @_;
1879  
1880 0 return ("${data}");
1881 }
1882  
1883 0 ▶sub render_test_inherits {
Subroutine render_test_inherits: not called CC=2 SCAR=17.9
Pod undocumented
1884 0 my ($self) = @_;
1885  
1886 0 my $data = $self->input_options;
1887  
1888 return $data->{inherits}
1889 ? (
1890 0 ▶ "=inherits", "", (map $self->render_test_inherit($_), @{$data->{inherits}}),
Branch: 1 branch
BranchTrueFalseTotal
$data->{'inherits'} ? : 0 0 0
1891 "", "=cut", "", "\$test->for('inherits');", ""
1892 )
1893 : ();
1894 }
1895  
1896 0 ▶sub render_test_integrate {
Subroutine render_test_integrate: not called CC=1 SCAR=6.9
Pod undocumented
1897 0 my ($self, $data) = @_;
1898  
1899 0 return ("${data}");
1900 }
1901  
1902 0 ▶sub render_test_integrates {
Subroutine render_test_integrates: not called CC=2 SCAR=17.9
Pod undocumented
1903 0 my ($self) = @_;
1904  
1905 0 my $data = $self->input_options;
1906  
1907 return $data->{integrates}
1908 ? (
1909 "=integrates", "",
1910 0 ▶ (map $self->render_test_integrate($_), sort @{$data->{integrates}}),
Branch: 1 branch
BranchTrueFalseTotal
$data->{'integrates'} ? : 0 0 0
1911 "", "=cut", "", "\$test->for('integrates');", ""
1912 )
1913 : ();
1914 }
1915  
1916 0 ▶sub render_test_method {
Subroutine render_test_method: not called CC=1 SCAR=6.9
Pod undocumented
1917 0 my ($self, $data) = @_;
1918  
1919 0 my $text = <<"EOF";
1920 +=method ${data}
1921  
1922 The ${data} method ...
1923  
1924 +=signature ${data}
1925  
1926 ${data}(any \@data) (any)
1927  
1928 +=metadata ${data}
1929  
1930 {
1931 since => '0.00',
1932 }
1933  
1934 +=example-1 ${data}
1935  
1936 # given: synopsis
1937  
1938 package main;
1939  
1940 my \$${data} = \$self->${data};
1941  
1942 # ()
1943  
1944 +=cut
1945  
1946 \$test->for('example', 1, '${data}', sub {
1947 my (\$tryable) = \@_;
1948 my \$result = \$tryable->result;
1949 ok \$result;
1950  
1951 \$result
1952 });
1953 EOF
1954  
1955 0 $text =~ s/^\+=/=/gm;
1956  
1957 0 return ($text);
1958 }
1959  
1960 0 ▶sub render_test_methods {
Subroutine render_test_methods: not called CC=2 SCAR=17.9
Pod undocumented
1961 0 my ($self) = @_;
1962  
1963 0 my $data = $self->input_options;
1964  
1965 return $data->{methods}
1966 0 ▶ ? (map $self->render_test_method($_), @{$data->{methods}})
Branch: 1 branch
BranchTrueFalseTotal
$data->{'methods'} ? : 0 0 0
1967 : ();
1968 }
1969  
1970 0 ▶sub render_test_name {
Subroutine render_test_name: not called CC=1 SCAR=6.9
Pod undocumented
1971 0 my ($self) = @_;
1972  
1973 0 my $data = $self->input_options;
1974  
1975 0 my $name = $data->{name};
1976  
1977 0 my $text = <<"EOF";
1978 =name
1979  
1980 ${name}
1981  
1982 =cut
1983  
1984 \$test->for('name');
1985 EOF
1986  
1987 0 return ($text);
1988 }
1989  
1990 0 ▶sub render_test_require {
Subroutine render_test_require: not called CC=1 SCAR=6.9
Pod undocumented
1991 0 my ($self, $data) = @_;
1992  
1993 0 return ("require ${data};");
1994 }
1995  
1996 0 ▶sub render_test_requires {
Subroutine render_test_requires: not called CC=2 SCAR=17.9
Pod undocumented
1997 0 my ($self) = @_;
1998  
1999 0 my $data = $self->input_options;
2000  
2001 return $data->{requires}
2002 ? ("# REQUIRES", "", (map $self->render_test_require($_),
2003 0 ▶ @{$data->{requires}}), "")
Branch: 1 branch
BranchTrueFalseTotal
$data->{'requires'} ? : 0 0 0
2004 : ();
2005 }
2006  
2007 0 ▶sub render_test_routine {
Subroutine render_test_routine: not called CC=1 SCAR=6.9
Pod undocumented
2008 0 my ($self, $data) = @_;
2009  
2010 0 my $name = $self->input_options->{name};
2011  
2012 0 my $text = <<"EOF";
2013 +=routine ${data}
2014  
2015 The ${data} routine ...
2016  
2017 +=signature ${data}
2018  
2019 ${data}(any \@data) (any)
2020  
2021 +=metadata ${data}
2022  
2023 {
2024 since => '0.00',
2025 }
2026  
2027 +=example-1 ${data}
2028  
2029 package main;
2030  
2031 my \$${data} = ${name}->${data};
2032  
2033 # ()
2034  
2035 +=cut
2036  
2037 \$test->for('example', 1, '${data}', sub {
2038 my (\$tryable) = \@_;
2039 my \$result = \$tryable->result;
2040 ok \$result;
2041  
2042 \$result
2043 });
2044 EOF
2045  
2046 0 $text =~ s/^\+=/=/gm;
2047  
2048 0 return ($text);
2049 }
2050  
2051 0 ▶sub render_test_routines {
Subroutine render_test_routines: not called CC=2 SCAR=17.9
Pod undocumented
2052 0 my ($self) = @_;
2053  
2054 0 my $data = $self->input_options;
2055  
2056 return $data->{routines}
2057 0 ▶ ? (map $self->render_test_routine($_), @{$data->{routines}})
Branch: 1 branch
BranchTrueFalseTotal
$data->{'routines'} ? : 0 0 0
2058 : ();
2059 }
2060  
2061 0 ▶sub render_test_synopsis {
Subroutine render_test_synopsis: not called CC=1 SCAR=6.9
Pod undocumented
2062 0 my ($self) = @_;
2063  
2064 0 my $data = $self->input_options;
2065  
2066 0 my $name = $data->{name};
2067  
2068 0 my $text = <<"EOF";
2069 +=synopsis
2070  
2071 package main;
2072  
2073 use ${name};
2074  
2075 my \$self = ${name}->new;
2076  
2077 # ()
2078  
2079 +=cut
2080  
2081 \$test->for('synopsis', sub {
2082 my (\$tryable) = \@_;
2083 my \$result = \$tryable->result;
2084 ok \$result;
2085  
2086 \$result
2087 });
2088 EOF
2089  
2090 0 $text =~ s/^\+=/=/gm;
2091  
2092 0 return ($text);
2093 }
2094  
2095 0 ▶sub render_test_tagline {
Subroutine render_test_tagline: not called CC=2 SCAR=17.9
Pod undocumented
2096 0 my ($self) = @_;
2097  
2098 0 my $data = $self->input_options;
2099  
2100 0 my $tagline = $data->{tagline};
2101  
2102 0 ▶ return () if !$tagline;
Branch: 1 branch
BranchTrueFalseTotal
unless $tagline 0 0 0
2103  
2104 0 my $text = <<"EOF";
2105 +=tagline
2106  
2107 ${tagline}
2108  
2109 +=cut
2110  
2111 \$test->for('tagline');
2112 EOF
2113  
2114 0 $text =~ s/^\+=/=/gm;
2115  
2116 0 return ($text);
2117 }
2118  
2119 0 ▶sub render_test_tail {
Subroutine render_test_tail: not called CC=1 SCAR=6.9
Pod undocumented
2120 0 my ($self) = @_;
2121  
2122 0 my $data = $self->input_options;
2123  
2124 0 my $space = Venus::Space->new($data->{name});
2125  
2126 0 my $pfile = $space->format('pfile', 'lib/%s');
2127  
2128 0 my $text = <<"EOF";
2129 \$test->render('$pfile');
2130 EOF
2131  
2132 0 return ($text);
2133 }
2134  
2135 4 ▶sub render_unit {
Subroutine render_unit: called CC=1 SCAR=0.0
Pod undocumented
2136 4 my ($self) = @_;
2137  
2138 return (
2139 4 $self->render_unit_name,
2140 $self->render_unit_version,
2141 $self->render_unit_authority,
2142 $self->render_unit_type,
2143 $self->render_unit_imports,
2144 $self->render_unit_ours,
2145 $self->render_unit_states,
2146 $self->render_unit_attributes,
2147 $self->render_unit_inherits,
2148 $self->render_unit_integrates,
2149 $self->render_unit_requires,
2150 $self->render_unit_builders,
2151 $self->render_unit_hooks,
2152 $self->render_unit_functions,
2153 $self->render_unit_methods,
2154 $self->render_unit_routines,
2155 $self->render_unit_errors,
2156 $self->render_unit_events,
2157 "1;",
2158 );
2159 }
2160  
2161 1 ▶sub render_unit_attribute {
Subroutine render_unit_attribute: called CC=1 SCAR=0.0
Pod undocumented
2162 1 my ($self, $data) = @_;
2163  
2164 1 return ("attr '$data';");
2165 }
2166  
2167 4 ▶sub render_unit_attributes {
Subroutine render_unit_attributes: called CC=2 SCAR=6.9
Pod undocumented
2168 4 my ($self) = @_;
2169  
2170 4 my $data = $self->input_options;
2171  
2172 return $data->{attributes}
2173 ? ("# ATTRIBUTES", "", (map $self->render_unit_attribute($_),
2174 4 ▶ @{$data->{attributes}}), "")
Branch: 1 branch
BranchTrueFalseTotal
$data->{'attributes'} ? : 1 3 4
2175 : ();
2176 }
2177  
2178 4 ▶sub render_unit_authority {
Subroutine render_unit_authority: called CC=3 SCAR=13.1
Pod undocumented
2179 4 my ($self) = @_;
2180  
2181 4 my $data = $self->input_options;
2182  
2183 return $data->{authority}
2184 ? ( "# AUTHORITY", "", (
2185 4 ▶ sprintf("our \$AUTHORITY = '%s';", uc $data->{authority} || 'me')
Branch: 1 branch
BranchTrueFalseTotal
$data->{'authority'} ? : 0 4 4
Condition0%0/2
uc $data->{'authority'} || 'me'
l!l
00
MC/DC0%0/1
uc $data->{'authority'} || 'me'
uc $data->{'authority'}
Truth table0%0/2
A
A= uc $data->{'authority'}
Aresult
11
00
2186 ), "")
2187 : ();
2188 }
2189  
2190 0 ▶sub render_unit_build_arg {
Subroutine render_unit_build_arg: not called CC=1 SCAR=6.9
Pod undocumented
2191 0 my ($self) = @_;
2192  
2193 0 my $data = $self->input_options;
2194  
2195 0 my $text = <<"EOF";
2196 sub build_arg {
2197 my (\$self, \$data) = \@_;
2198  
2199 return {};
2200 }
2201 EOF
2202  
2203 0 chomp $text;
2204  
2205 0 return ($text);
2206 }
2207  
2208 0 ▶sub render_unit_build_args {
Subroutine render_unit_build_args: not called CC=1 SCAR=6.9
Pod undocumented
2209 0 my ($self) = @_;
2210  
2211 0 my $data = $self->input_options;
2212  
2213 0 my $text = <<"EOF";
2214 sub build_args {
2215 my (\$self, \$data) = \@_;
2216  
2217 return \$data;
2218 }
2219 EOF
2220  
2221 0 chomp $text;
2222  
2223 0 return ($text);
2224 }
2225  
2226 0 ▶sub render_unit_build_assert {
Subroutine render_unit_build_assert: not called CC=1 SCAR=6.9
Pod undocumented
2227 0 my ($self, $data) = @_;
2228  
2229 0 my $text = <<"EOF";
2230 sub assert_${data} {
2231 my (\$self, \$data) = \@_;
2232  
2233 return 'any';
2234 }
2235 EOF
2236  
2237 0 chomp $text;
2238  
2239 0 return ($text);
2240 }
2241  
2242 0 ▶sub render_unit_build_assert_self {
Subroutine render_unit_build_assert_self: not called CC=1 SCAR=6.9
Pod undocumented
2243 0 my ($self, $data) = @_;
2244  
2245 0 my $text = <<"EOF";
2246 sub self_assert_${data} {
2247 my (\$self, \$data) = \@_;
2248  
2249 die 'Bad ${data}' if !\$data;
2250 }
2251 EOF
2252  
2253 0 chomp $text;
2254  
2255 0 return ($text);
2256 }
2257  
2258 0 ▶sub render_unit_build_attribute {
Subroutine render_unit_build_attribute: not called CC=1 SCAR=6.9
Pod undocumented
2259 0 my ($self, $data) = @_;
2260  
2261 0 my $text = <<"EOF";
2262 sub build_${data} {
2263 my (\$self, \$data) = \@_;
2264  
2265 return \$data;
2266 }
2267 EOF
2268  
2269 0 chomp $text;
2270  
2271 0 return ($text);
2272 }
2273  
2274 0 ▶sub render_unit_build_attribute_lazy {
Subroutine render_unit_build_attribute_lazy: not called CC=1 SCAR=6.9
Pod undocumented
2275 0 my ($self, $data) = @_;
2276  
2277 0 my $text = <<"EOF";
2278 sub lazy_build_${data} {
2279 my (\$self, \$data) = \@_;
2280  
2281 return \$data;
2282 }
2283 EOF
2284  
2285 0 chomp $text;
2286  
2287 0 return ($text);
2288 }
2289  
2290 0 ▶sub render_unit_build_check {
Subroutine render_unit_build_check: not called CC=1 SCAR=6.9
Pod undocumented
2291 0 my ($self, $data) = @_;
2292  
2293 0 my $text = <<"EOF";
2294 sub check_${data} {
2295 my (\$self, \$data) = \@_;
2296  
2297 return \$data ? true : false;
2298 }
2299 EOF
2300  
2301 0 chomp $text;
2302  
2303 0 return ($text);
2304 }
2305  
2306 0 ▶sub render_unit_build_coerce {
Subroutine render_unit_build_coerce: not called CC=1 SCAR=6.9
Pod undocumented
2307 0 my ($self, $data) = @_;
2308  
2309 0 my $text = <<"EOF";
2310 sub coerce_${data} {
2311 my (\$self, \$data) = \@_;
2312  
2313 return 'Venus::Box';
2314 }
2315 EOF
2316  
2317 0 chomp $text;
2318  
2319 0 return ($text);
2320 }
2321  
2322 0 ▶sub render_unit_build_coerce_self {
Subroutine render_unit_build_coerce_self: not called CC=1 SCAR=6.9
Pod undocumented
2323 0 my ($self, $data) = @_;
2324  
2325 0 my $text = <<"EOF";
2326 sub self_coerce_${data} {
2327 my (\$self, \$data) = \@_;
2328  
2329 require Venus::Box;
2330  
2331 return Venus::Box->new(\$data);
2332 }
2333 EOF
2334  
2335 0 chomp $text;
2336  
2337 0 return ($text);
2338 }
2339  
2340 0 ▶sub render_unit_build_default {
Subroutine render_unit_build_default: not called CC=1 SCAR=6.9
Pod undocumented
2341 0 my ($self, $data) = @_;
2342  
2343 0 my $text = <<"EOF";
2344 sub default_${data} {
2345 my (\$self, \$data) = \@_;
2346  
2347 return \$data;
2348 }
2349 EOF
2350  
2351 0 chomp $text;
2352  
2353 0 return ($text);
2354 }
2355  
2356 0 ▶sub render_unit_build_initial {
Subroutine render_unit_build_initial: not called CC=1 SCAR=6.9
Pod undocumented
2357 0 my ($self, $data) = @_;
2358  
2359 0 my $text = <<"EOF";
2360 sub initial_${data} {
2361 my (\$self, \$data) = \@_;
2362  
2363 return \$data;
2364 }
2365 EOF
2366  
2367 0 chomp $text;
2368  
2369 0 return ($text);
2370 }
2371  
2372 0 ▶sub render_unit_build_nil {
Subroutine render_unit_build_nil: not called CC=1 SCAR=6.9
Pod undocumented
2373 0 my ($self) = @_;
2374  
2375 0 my $data = $self->input_options;
2376  
2377 0 my $text = <<"EOF";
2378 sub build_nil {
2379 my (\$self, \$data) = \@_;
2380  
2381 return {};
2382 }
2383 EOF
2384  
2385 0 chomp $text;
2386  
2387 0 return ($text);
2388 }
2389  
2390 0 ▶sub render_unit_build_read {
Subroutine render_unit_build_read: not called CC=1 SCAR=6.9
Pod undocumented
2391 0 my ($self, $data) = @_;
2392  
2393 0 my $text = <<"EOF";
2394 sub read_${data} {
2395 my (\$self, \$data) = \@_;
2396  
2397 return \$data;
2398 }
2399 EOF
2400  
2401 0 chomp $text;
2402  
2403 0 return ($text);
2404 }
2405  
2406 0 ▶sub render_unit_build_readonly {
Subroutine render_unit_build_readonly: not called CC=1 SCAR=6.9
Pod undocumented
2407 0 my ($self, $data) = @_;
2408  
2409 0 my $text = <<"EOF";
2410 sub readonly_${data} {
2411 my (\$self, \$data) = \@_;
2412  
2413 return true;
2414 }
2415 EOF
2416  
2417 0 chomp $text;
2418  
2419 0 return ($text);
2420 }
2421  
2422 0 ▶sub render_unit_build_readwrite {
Subroutine render_unit_build_readwrite: not called CC=1 SCAR=6.9
Pod undocumented
2423 0 my ($self, $data) = @_;
2424  
2425 0 my $text = <<"EOF";
2426 sub readwrite_${data} {
2427 my (\$self, \$data) = \@_;
2428  
2429 return true;
2430 }
2431 EOF
2432  
2433 0 chomp $text;
2434  
2435 0 return ($text);
2436 }
2437  
2438 0 ▶sub render_unit_build_require {
Subroutine render_unit_build_require: not called CC=1 SCAR=6.9
Pod undocumented
2439 0 my ($self, $data) = @_;
2440  
2441 0 my $text = <<"EOF";
2442 sub require_${data} {
2443 my (\$self, \$data) = \@_;
2444  
2445 return true;
2446 }
2447 EOF
2448  
2449 0 chomp $text;
2450  
2451 0 return ($text);
2452 }
2453  
2454 0 ▶sub render_unit_build_self {
Subroutine render_unit_build_self: not called CC=1 SCAR=6.9
Pod undocumented
2455 0 my ($self) = @_;
2456  
2457 0 my $data = $self->input_options;
2458  
2459 0 my $text = <<"EOF";
2460 sub build_self {
2461 my (\$self, \$data) = \@_;
2462  
2463 return \$self;
2464 }
2465 EOF
2466  
2467 0 chomp $text;
2468  
2469 0 return ($text);
2470 }
2471  
2472 0 ▶sub render_unit_build_trigger {
Subroutine render_unit_build_trigger: not called CC=1 SCAR=6.9
Pod undocumented
2473 0 my ($self, $data) = @_;
2474  
2475 0 my $text = <<"EOF";
2476 sub trigger_${data} {
2477 my (\$self, \$data) = \@_;
2478  
2479 return \$data;
2480 }
2481 EOF
2482  
2483 0 chomp $text;
2484  
2485 0 return ($text);
2486 }
2487  
2488 0 ▶sub render_unit_build_write {
Subroutine render_unit_build_write: not called CC=1 SCAR=6.9
Pod undocumented
2489 0 my ($self, $data) = @_;
2490  
2491 0 my $text = <<"EOF";
2492 sub write_${data} {
2493 my (\$self, \$data) = \@_;
2494  
2495 return \$data;
2496 }
2497 EOF
2498  
2499 0 chomp $text;
2500  
2501 0 return ($text);
2502 }
2503  
2504 4 ▶sub render_unit_builders {
Subroutine render_unit_builders: called CC=21 SCAR=40.8
Pod undocumented
2505 4 my ($self) = @_;
2506  
2507 4 my $data = $self->input_options;
2508  
2509 4 my @text;
2510  
2511 push @text,
2512 4 ▶ $data->{"build-arg"}
Branch: 1 branch
BranchTrueFalseTotal
$data->{'build-arg'} ? : 0 4 4
2513 ? $self->render_unit_build_arg
2514 : ();
2515  
2516 push @text,
2517 4 ▶ $data->{"build-args"}
Branch: 1 branch
BranchTrueFalseTotal
$data->{'build-args'} ? : 0 4 4
2518 ? $self->render_unit_build_args
2519 : ();
2520  
2521 push @text,
2522 4 ▶ $data->{"build-nil"}
Branch: 1 branch
BranchTrueFalseTotal
$data->{'build-nil'} ? : 0 4 4
2523 ? $self->render_unit_build_nil
2524 : ();
2525  
2526 push @text,
2527 4 ▶ $data->{"build-self"}
Branch: 1 branch
BranchTrueFalseTotal
$data->{'build-self'} ? : 0 4 4
2528 ? $self->render_unit_build_self
2529 : ();
2530  
2531 push @text,
2532 $data->{"build-asserts"}
2533 ? (join "\n\n", map $self->render_unit_build_assert($_),
2534 0 ▶ @{$data->{"build-asserts"}})
Branch: 1 branch
BranchTrueFalseTotal
$data->{'build-asserts'} ? : 0 4 4
2535 : ();
2536  
2537 push @text,
2538 $data->{"build-checks"}
2539 ? (join "\n\n", map $self->render_unit_build_check($_),
2540 0 ▶ @{$data->{"build-checks"}})
Branch: 1 branch
BranchTrueFalseTotal
$data->{'build-checks'} ? : 0 4 4
2541 : ();
2542  
2543 push @text,
2544 $data->{"build-coerces"}
2545 ? (join "\n\n", map $self->render_unit_build_coerce($_),
2546 0 ▶ @{$data->{"build-coerces"}})
Branch: 1 branch
BranchTrueFalseTotal
$data->{'build-coerces'} ? : 0 4 4
2547 : ();
2548  
2549 push @text,
2550 $data->{"build-attributes"}
2551 ? (join "\n\n", map $self->render_unit_build_attribute($_),
2552 0 ▶ @{$data->{"build-attributes"}})
Branch: 1 branch
BranchTrueFalseTotal
$data->{'build-attributes'} ? : 0 4 4
2553 : ();
2554  
2555 push @text,
2556 $data->{"build-defaults"}
2557 ? (join "\n\n", map $self->render_unit_build_default($_),
2558 0 ▶ @{$data->{"build-defaults"}})
Branch: 1 branch
BranchTrueFalseTotal
$data->{'build-defaults'} ? : 0 4 4
2559 : ();
2560  
2561 push @text,
2562 $data->{"build-initials"}
2563 ? (join "\n\n", map $self->render_unit_build_initial($_),
2564 0 ▶ @{$data->{"build-initials"}})
Branch: 1 branch
BranchTrueFalseTotal
$data->{'build-initials'} ? : 0 4 4
2565 : ();
2566  
2567 push @text,
2568 $data->{"build-attribute-lazys"}
2569 ? (join "\n\n", map $self->render_unit_build_attribute_lazy($_),
2570 0 ▶ @{$data->{"build-attribute-lazys"}})
Branch: 1 branch
BranchTrueFalseTotal
$data->{'build-attribute-lazys'} ? : 0 4 4
2571 : ();
2572  
2573 push @text,
2574 $data->{"build-assert-selfs"}
2575 ? (join "\n\n", map $self->render_unit_build_assert_self($_),
2576 0 ▶ @{$data->{"build-assert-selfs"}})
Branch: 1 branch
BranchTrueFalseTotal
$data->{'build-assert-selfs'} ? : 0 4 4
2577 : ();
2578  
2579 push @text,
2580 $data->{"build-coerce-selfs"}
2581 ? (join "\n\n", map $self->render_unit_build_coerce_self($_),
2582 0 ▶ @{$data->{"build-coerce-selfs"}})
Branch: 1 branch
BranchTrueFalseTotal
$data->{'build-coerce-selfs'} ? : 0 4 4
2583 : ();
2584  
2585 push @text,
2586 $data->{"build-reads"}
2587 ? (join "\n\n", map $self->render_unit_build_read($_),
2588 0 ▶ @{$data->{"build-reads"}})
Branch: 1 branch
BranchTrueFalseTotal
$data->{'build-reads'} ? : 0 4 4
2589 : ();
2590  
2591 push @text,
2592 $data->{"build-writes"}
2593 ? (join "\n\n", map $self->render_unit_build_write($_),
2594 0 ▶ @{$data->{"build-writes"}})
Branch: 1 branch
BranchTrueFalseTotal
$data->{'build-writes'} ? : 0 4 4
2595 : ();
2596  
2597 push @text,
2598 $data->{"build-readonlys"}
2599 ? (join "\n\n", map $self->render_unit_build_readonly($_),
2600 0 ▶ @{$data->{"build-readonlys"}})
Branch: 1 branch
BranchTrueFalseTotal
$data->{'build-readonlys'} ? : 0 4 4
2601 : ();
2602  
2603 push @text,
2604 $data->{"build-readwrites"}
2605 ? (join "\n\n", map $self->render_unit_build_readwrite($_),
2606 0 ▶ @{$data->{"build-readwrites"}})
Branch: 1 branch
BranchTrueFalseTotal
$data->{'build-readwrites'} ? : 0 4 4
2607 : ();
2608  
2609 push @text,
2610 $data->{"build-requires"}
2611 ? (join "\n\n", map $self->render_unit_build_require($_),
2612 0 ▶ @{$data->{"build-requires"}})
Branch: 1 branch
BranchTrueFalseTotal
$data->{'build-requires'} ? : 0 4 4
2613 : ();
2614  
2615 push @text,
2616 $data->{"build-triggers"}
2617 ? (join "\n\n", map $self->render_unit_build_trigger($_),
2618 0 ▶ @{$data->{"build-triggers"}})
Branch: 1 branch
BranchTrueFalseTotal
$data->{'build-triggers'} ? : 0 4 4
2619 : ();
2620  
2621 4 ▶ @text = ("# BUILDERS", "", join("\n\n", @text), "") if @text;
Branch: 1 branch
BranchTrueFalseTotal
if @text 0 4 4
2622  
2623 4 return (@text);
2624 }
2625  
2626 0 ▶sub render_unit_error {
Subroutine render_unit_error: not called CC=1 SCAR=6.9
Pod undocumented
2627 0 my ($self, $data) = @_;
2628  
2629 0 my $text = <<"EOF";
2630 sub error_on_${data} {
2631 my (\$self, \$data) = \@_;
2632  
2633 my \$error = \$self->error;
2634  
2635 my \$message = '...';
2636  
2637 \$error->name('on.${data}');
2638 \$error->message(\$message);
2639 \$error->offset(1);
2640 \$error->stash(\$data);
2641 \$error->reset;
2642  
2643 return \$error;
2644 }
2645 EOF
2646  
2647 0 chomp $text;
2648  
2649 0 return ($text);
2650 }
2651  
2652 4 ▶sub render_unit_errors {
Subroutine render_unit_errors: called CC=2 SCAR=7.6
Pod undocumented
2653 4 my ($self) = @_;
2654  
2655 4 my $data = $self->input_options;
2656  
2657 return $data->{errors}
2658 ? ("# ERRORS", "", (join "\n\n", map $self->render_unit_error($_),
2659 0 ▶ @{$data->{errors}}), "")
Branch: 1 branch
BranchTrueFalseTotal
$data->{'errors'} ? : 0 4 4
2660 : ();
2661 }
2662  
2663 0 ▶sub render_unit_event {
Subroutine render_unit_event: not called CC=1 SCAR=6.9
Pod undocumented
2664 0 my ($self, $data) = @_;
2665  
2666 0 my $text = <<"EOF";
2667 sub ${data} {
2668 my (\$self, \@args) = \@_;
2669  
2670 # return \$self->SUPER::${data}(\@args);
2671 }
2672 EOF
2673  
2674 0 chomp $text;
2675  
2676 0 return ($text);
2677 }
2678  
2679 4 ▶sub render_unit_events {
Subroutine render_unit_events: called CC=2 SCAR=7.0
Pod undocumented
2680 4 my ($self) = @_;
2681  
2682 4 my $data = $self->input_options;
2683  
2684 4 my @events = (sort map /^event-(.*)/, grep /^event-/, keys %{$data});
2685  
2686 return @events
2687 4 ▶ ? ("# EVENTS", "", (join "\n\n", map $self->render_unit_event(uc $_), @events), "")
Branch: 1 branch
BranchTrueFalseTotal
@events ? : 0 4 4
2688 : ();
2689 }
2690  
2691 0 ▶sub render_unit_function {
Subroutine render_unit_function: not called CC=1 SCAR=6.9
Pod undocumented
2692 0 my ($self, $data) = @_;
2693  
2694 0 my $text = <<"EOF";
2695 sub ${data} {
2696 my (\@args) = \@_;
2697  
2698 return (\@args);
2699 }
2700 EOF
2701  
2702 0 chomp $text;
2703  
2704 0 return ($text);
2705 }
2706  
2707 4 ▶sub render_unit_functions {
Subroutine render_unit_functions: called CC=2 SCAR=7.6
Pod undocumented
2708 4 my ($self) = @_;
2709  
2710 4 my $data = $self->input_options;
2711  
2712 return $data->{functions}
2713 ? ("# FUNCTIONS", "", (join "\n\n", map $self->render_unit_function($_),
2714 0 ▶ @{$data->{functions}}), "")
Branch: 1 branch
BranchTrueFalseTotal
$data->{'functions'} ? : 0 4 4
2715 : ();
2716 }
2717  
2718 0 ▶sub render_unit_hook {
Subroutine render_unit_hook: not called CC=1 SCAR=6.9
Pod undocumented
2719 0 my ($self, $data) = @_;
2720  
2721 0 my $text = <<"EOF";
2722 sub ${data} {
2723  
2724 return;
2725 }
2726 EOF
2727  
2728 0 chomp $text;
2729  
2730 0 return ($text);
2731 }
2732  
2733 4 ▶sub render_unit_hooks {
Subroutine render_unit_hooks: called CC=2 SCAR=7.6
Pod undocumented
2734 4 my ($self) = @_;
2735  
2736 4 my $data = $self->input_options;
2737  
2738 return $data->{hooks}
2739 ? ( "# HOOKS", "", (join "\n\n", map $self->render_unit_hook($_),
2740 0 ▶ @{$data->{hooks}}), "")
Branch: 1 branch
BranchTrueFalseTotal
$data->{'hooks'} ? : 0 4 4
2741 : ();
2742 }
2743  
2744 0 ▶sub render_unit_import {
Subroutine render_unit_import: not called CC=1 SCAR=6.9
Pod undocumented
2745 0 my ($self, $data) = @_;
2746  
2747 0 return ("use ${data};");
2748 }
2749  
2750 4 ▶sub render_unit_imports {
Subroutine render_unit_imports: called CC=2 SCAR=7.6
Pod undocumented
2751 4 my ($self) = @_;
2752  
2753 4 my $data = $self->input_options;
2754  
2755 return $data->{imports}
2756 ? ("# IMPORTS", "", (map $self->render_unit_import($_),
2757 0 ▶ @{$data->{imports}}), "")
Branch: 1 branch
BranchTrueFalseTotal
$data->{'imports'} ? : 0 4 4
2758 : ();
2759 }
2760  
2761 0 ▶sub render_unit_inherit {
Subroutine render_unit_inherit: not called CC=1 SCAR=6.9
Pod undocumented
2762 0 my ($self, $data) = @_;
2763  
2764 0 return ("base '${data}';");
2765 }
2766  
2767 4 ▶sub render_unit_inherits {
Subroutine render_unit_inherits: called CC=2 SCAR=7.6
Pod undocumented
2768 4 my ($self) = @_;
2769  
2770 4 my $data = $self->input_options;
2771  
2772 return $data->{inherits}
2773 ? ( "# INHERITS", "", (map $self->render_unit_inherit($_),
2774 0 ▶ @{$data->{inherits}}), "")
Branch: 1 branch
BranchTrueFalseTotal
$data->{'inherits'} ? : 0 4 4
2775 : ();
2776 }
2777  
2778 0 ▶sub render_unit_integrate {
Subroutine render_unit_integrate: not called CC=1 SCAR=6.9
Pod undocumented
2779 0 my ($self, $data) = @_;
2780  
2781 0 return ("with '${data}';");
2782 }
2783  
2784 4 ▶sub render_unit_integrates {
Subroutine render_unit_integrates: called CC=2 SCAR=7.6
Pod undocumented
2785 4 my ($self) = @_;
2786  
2787 4 my $data = $self->input_options;
2788  
2789 return $data->{integrates}
2790 ? ( "# INTEGRATES", "", (map $self->render_unit_integrate($_),
2791 0 ▶ sort @{$data->{integrates}}), "")
Branch: 1 branch
BranchTrueFalseTotal
$data->{'integrates'} ? : 0 4 4
2792 : ();
2793 }
2794  
2795 2 ▶sub render_unit_method {
Subroutine render_unit_method: called CC=1 SCAR=0.0
Pod undocumented
2796 2 my ($self, $data) = @_;
2797  
2798 2 my $text = <<"EOF";
2799 sub ${data} {
2800 my (\$self, \@args) = \@_;
2801  
2802 return \$self;
2803 }
2804 EOF
2805  
2806 2 chomp $text;
2807  
2808 2 return ($text);
2809 }
2810  
2811 4 ▶sub render_unit_methods {
Subroutine render_unit_methods: called CC=2 SCAR=6.9
Pod undocumented
2812 4 my ($self) = @_;
2813  
2814 4 my $data = $self->input_options;
2815  
2816 return $data->{methods}
2817 ? ( "# METHODS", "", (join "\n\n", map $self->render_unit_method($_),
2818 4 ▶ @{$data->{methods}}), "")
Branch: 1 branch
BranchTrueFalseTotal
$data->{'methods'} ? : 2 2 4
2819 : ();
2820 }
2821  
2822 4 ▶sub render_unit_name {
Subroutine render_unit_name: called CC=1 SCAR=0.0
Pod undocumented
2823 4 my ($self) = @_;
2824  
2825 4 my $data = $self->input_options;
2826  
2827 4 my $name = $data->{name};
2828  
2829 4 my $text = <<"EOF";
2830 package ${name};
2831  
2832 use 5.018;
2833  
2834 use strict;
2835 use warnings;
2836 EOF
2837  
2838 4 return ($text);
2839 }
2840  
2841 0 ▶sub render_unit_our {
Subroutine render_unit_our: not called CC=1 SCAR=6.9
Pod undocumented
2842 0 my ($self, $data) = @_;
2843  
2844 0 return ("our \$${data};");
2845 }
2846  
2847 4 ▶sub render_unit_ours {
Subroutine render_unit_ours: called CC=2 SCAR=7.6
Pod undocumented
2848 4 my ($self) = @_;
2849  
2850 4 my $data = $self->input_options;
2851  
2852 return $data->{ours}
2853 ? ("# VARIABLES", "", (map $self->render_unit_our($_),
2854 0 ▶ @{$data->{ours}}), "")
Branch: 1 branch
BranchTrueFalseTotal
$data->{'ours'} ? : 0 4 4
2855 : ();
2856 }
2857  
2858 0 ▶sub render_unit_require {
Subroutine render_unit_require: not called CC=1 SCAR=6.9
Pod undocumented
2859 0 my ($self, $data) = @_;
2860  
2861 0 return ("require ${data};");
2862 }
2863  
2864 4 ▶sub render_unit_requires {
Subroutine render_unit_requires: called CC=2 SCAR=7.6
Pod undocumented
2865 4 my ($self) = @_;
2866  
2867 4 my $data = $self->input_options;
2868  
2869 return $data->{requires}
2870 ? ( "# REQUIRES", "", (map $self->render_unit_require($_),
2871 0 ▶ @{$data->{requires}}), "")
Branch: 1 branch
BranchTrueFalseTotal
$data->{'requires'} ? : 0 4 4
2872 : ();
2873 }
2874  
2875 0 ▶sub render_unit_routine {
Subroutine render_unit_routine: not called CC=1 SCAR=6.9
Pod undocumented
2876 0 my ($self, $data) = @_;
2877  
2878 0 my $text = <<"EOF";
2879 sub ${data} {
2880 my (\$self, \@args) = \@_;
2881  
2882 return \$self;
2883 }
2884 EOF
2885  
2886 0 chomp $text;
2887  
2888 0 return ($text);
2889 }
2890  
2891 4 ▶sub render_unit_routines {
Subroutine render_unit_routines: called CC=2 SCAR=7.6
Pod undocumented
2892 4 my ($self) = @_;
2893  
2894 4 my $data = $self->input_options;
2895  
2896 return $data->{routines}
2897 ? ( "# ROUTINES", "", (join "\n\n", map $self->render_unit_routine($_),
2898 0 ▶ @{$data->{routines}}), "")
Branch: 1 branch
BranchTrueFalseTotal
$data->{'routines'} ? : 0 4 4
2899 : ();
2900 }
2901  
2902 0 ▶sub render_unit_state {
Subroutine render_unit_state: not called CC=1 SCAR=6.9
Pod undocumented
2903 0 my ($self, $data) = @_;
2904  
2905 0 return ("state \$${data};");
2906 }
2907  
2908 4 ▶sub render_unit_states {
Subroutine render_unit_states: called CC=2 SCAR=7.6
Pod undocumented
2909 4 my ($self) = @_;
2910  
2911 4 my $data = $self->input_options;
2912  
2913 return $data->{states}
2914 ? ("# STATE", "", (map $self->render_unit_state($_),
2915 0 ▶ @{$data->{states}}), "")
Branch: 1 branch
BranchTrueFalseTotal
$data->{'states'} ? : 0 4 4
2916 : ();
2917 }
2918  
2919 4 ▶sub render_unit_type {
Subroutine render_unit_type: called CC=15 SCAR=38.8
Pod undocumented
2920 4 my ($self) = @_;
2921  
2922 4 my $data = $self->input_options;
2923  
2924 4 my @text;
2925 my @with;
2926  
2927 4 ▶ if ($data->{attributes} && @{$data->{attributes}}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($data->{"attributes"} and @{$data->{"attributes"};}) 1 3 4
Condition66%2/3
$data->{"attributes"} and @{$data->{"attributes"};}
!ll&&!rl&&r
301
MC/DC50%1/2
$data->{"attributes"} and @{$data->{"attributes"};}
$data->{"attributes"} @{$data->{"attributes"};}
Truth table66%2/3
A and B
A= $data->{"attributes"}B= @{$data->{"attributes"};}
ABresult
0X0
100
111
2928 1 push @with, 'attr';
2929 }
2930  
2931 0 ▶ if ($data->{inherits} && @{$data->{inherits}}) {
Branch: 1 branch
BranchTrueFalseTotal
if ($data->{"inherits"} and @{$data->{"inherits"};}) 0 4 4
Condition33%1/3
$data->{"inherits"} and @{$data->{"inherits"};}
!ll&&!rl&&r
400
MC/DC0%0/2
$data->{"inherits"} and @{$data->{"inherits"};}
$data->{"inherits"} @{$data->{"inherits"};}
Truth table33%1/3
A and B
A= $data->{"inherits"}B= @{$data->{"inherits"};}
ABresult
0X0
100
111
2932 0 push @with, 'base';
2933 }
2934  
2935 0 ▶ if (($data->{integrates} && @{$data->{integrates}}) || grep /^build-/,
Branch: 1 branch
BranchTrueFalseTotal
if ($data->{"integrates"} and @{$data->{"integrates"};} or grep /^build-/u, keys %{$data;}) 0 4 4
Condition33%2/6
$data->{"integrates"} and @{$data->{"integrates"};} or grep /^build-/u, keys %{$data;}
l!l&&r!l&&!r
004
$data->{"integrates"} and @{$data->{"integrates"};}
!ll&&!rl&&r
400
MC/DC0%0/3
$data->{"integrates"} and @{$data->{"integrates"};} or grep /^build-/u, keys %{$data;}
$data->{"integrates"} @{$data->{"integrates"};} grep /^build-/u, keys %{$data;}
Truth table20%1/5
A and B or C
A= $data->{"integrates"}B= @{$data->{"integrates"};}C= grep /^build-/u, keys %{$data;}
ABCresult
11X1
0X11
1011
0X00
1000
2936 4 keys %{$data})
2937 {
2938 0 push @with, 'with';
2939 }
2940  
2941 4 ▶ if ($data->{class}) {
Branch: 3 branches
BranchTrueFalseTotal
if ($data->{'class'}) { } 4 0 4
elsif ($data->{'mixin'}) { } 0 0 0
elsif ($data->{'role'}) { } 0 0 0
2942 4 ▶ push @text, ((join ' ', 'use Venus::Class',
Branch: 1 branch
BranchTrueFalseTotal
@with ? : 1 3 4
2943 @with ? (join ', ', map "'$_'", @with) : ()) . ";");
2944 }
2945 elsif ($data->{mixin}) {
2946 0 ▶ push @text, ((join ' ', 'use Venus::Mixin',
Branch: 1 branch
BranchTrueFalseTotal
@with ? : 0 0 0
2947 @with ? (join ', ', map "'$_'", @with) : ()) . ";");
2948 }
2949 elsif ($data->{role}) {
2950 0 ▶ push @text, ((join ' ', 'use Venus::Role',
Branch: 1 branch
BranchTrueFalseTotal
@with ? : 0 0 0
2951 @with ? (join ', ', map "'$_'", @with) : ()) . ";");
2952 }
2953 else {
2954 0 ▶ push @text, ((join ' ', 'use Venus::Class',
Branch: 1 branch
BranchTrueFalseTotal
@with ? : 0 0 0
2955 @with ? (join ', ', map "'$_'", @with) : ()) . ";");
2956 }
2957  
2958 4 return ("# VENUS", "", @text, "");
2959 }
2960  
2961 4 ▶sub render_unit_version {
Subroutine render_unit_version: called CC=3 SCAR=13.1
Pod undocumented
2962 4 my ($self) = @_;
2963  
2964 4 my $data = $self->input_options;
2965  
2966 return $data->{version}
2967 ? ( "# VERSION", "", (
2968 4 ▶ sprintf("our \$VERSION = '%s';", $data->{version} || 0.00)
Branch: 1 branch
BranchTrueFalseTotal
$data->{'version'} ? : 0 4 4
Condition0%0/2
$data->{'version'} || 0.0
l!l
00
MC/DC0%0/1
$data->{'version'} || 0.0
$data->{'version'}
Truth table0%0/2
A
A= $data->{'version'}
Aresult
11
00
2969 ), "")
2970 : ();
2971 }
2972  
2973 2 1;
2974  
2975  
2976  
2977 =head1 NAME
2978  
2979 Venus::Task::Venus::Gen - vns gen
2980  
2981 =cut
2982  
2983 =head1 ABSTRACT
2984  
2985 Task Class for Venus CLI
2986  
2987 =cut
2988  
2989 =head1 SYNOPSIS
2990  
2991 package main;
2992  
2993 use Venus::Task::Venus::Gen;
2994  
2995 my $task = Venus::Task::Venus::Gen->new;
2996  
2997 # bless(.., 'Venus::Task::Venus::Gen')
2998  
2999 =cut
3000  
3001 =head1 DESCRIPTION
3002  
3003 This package is a task class for the C<vns-gen> CLI, and C<vns gen>
3004 sub-command.
3005  
3006 =cut
3007  
3008 =head1 INHERITS
3009  
3010 This package inherits behaviors from:
3011  
3012 L<Venus::Task::Venus>
3013  
3014 =cut
3015  
3016 =head1 METHODS
3017  
3018 This package provides the following methods:
3019  
3020 =cut
3021  
3022 =head2 new
3023  
3024 new(any @args) (Venus::Task::Venus::Gen)
3025  
3026 The new method constructs an instance of the package.
3027  
3028 I<Since C<4.15>>
3029  
3030 =over 4
3031  
3032 =item new example 1
3033  
3034 package main;
3035  
3036 use Venus::Task::Venus::Gen;
3037  
3038 my $task = Venus::Task::Venus::Gen->new;
3039  
3040 # bless({...}, 'Venus::Task::Venus::Gen')
3041  
3042 =back
3043  
3044 =cut
3045  
3046 =head2 perform
3047  
3048 perform() (Venus::Task::Venus::Gen)
3049  
3050 The perform method executes the CLI logic.
3051  
3052 I<Since C<4.15>>
3053  
3054 =over 4
3055  
3056 =item perform example 1
3057  
3058 # given: synopsis
3059  
3060 package main;
3061  
3062 $task->prepare;
3063  
3064 my $perform = $task->perform;
3065  
3066 # bless(.., 'Venus::Task::Venus::Gen')
3067  
3068 =back
3069  
3070 =over 4
3071  
3072 =item perform example 2
3073  
3074 # given: synopsis
3075  
3076 package main;
3077  
3078 $task->prepare;
3079  
3080 $task->parse('--stdout', '--class');
3081  
3082 my $perform = $task->perform;
3083  
3084 # bless(.., 'Venus::Task::Venus::Gen')
3085  
3086 # ...
3087  
3088 =back
3089  
3090 =over 4
3091  
3092 =item perform example 3
3093  
3094 # given: synopsis
3095  
3096 package main;
3097  
3098 $task->prepare;
3099  
3100 $task->parse('--stdout', '--class', '--name', 'MyApp');
3101  
3102 my $perform = $task->perform;
3103  
3104 # bless(.., 'Venus::Task::Venus::Gen')
3105  
3106 # ...
3107  
3108 =back
3109  
3110 =over 4
3111  
3112 =item perform example 4
3113  
3114 # given: synopsis
3115  
3116 package main;
3117  
3118 $task->prepare;
3119  
3120 $task->parse('-pc', '--name', 'MyApp', '--method', 'execute');
3121  
3122 my $perform = $task->perform;
3123  
3124 # bless(.., 'Venus::Task::Venus::Gen')
3125  
3126 # ...
3127  
3128 =back
3129  
3130 =over 4
3131  
3132 =item perform example 5
3133  
3134 # given: synopsis
3135  
3136 package main;
3137  
3138 $task->prepare;
3139  
3140 $task->parse('-pc', '--name', 'MyApp', '--attr', 'domain', '--method', 'execute');
3141  
3142 my $perform = $task->perform;
3143  
3144 # bless(.., 'Venus::Task::Venus::Gen')
3145  
3146 # ...
3147  
3148 =back
3149  
3150 =cut
3151  
3152 =head1 AUTHORS
3153  
3154 Awncorp, C<awncorp@cpan.org>
3155  
3156 =cut
3157  
3158 =head1 LICENSE
3159  
3160 Copyright (C) 2022, Awncorp, C<awncorp@cpan.org>.
3161  
3162 This program is free software, you can redistribute it and/or modify it under
3163 the terms of the Apache license version 2.0.
3164  
3165 =cut
« blib/lib/Venus/Test.pm ↑ Summary blib/lib/Venus/Role/Mappable.pm »