| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
2
|
|
|
2
|
|
835
|
use 5.006; #our |
|
|
2
|
|
|
|
|
5
|
|
|
2
|
2
|
|
|
2
|
|
7
|
use strict; |
|
|
2
|
|
|
|
|
3
|
|
|
|
2
|
|
|
|
|
36
|
|
|
3
|
2
|
|
|
2
|
|
14
|
use warnings; |
|
|
2
|
|
|
|
|
2
|
|
|
|
2
|
|
|
|
|
125
|
|
|
4
|
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Pod::Weaver::PluginBundle::Author::KENTNL::Collectors; |
|
6
|
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.001003'; |
|
8
|
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
# ABSTRACT: Sub/Attribute/Whatever but shorter and with defaults |
|
10
|
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:KENTNL'; # AUTHORITY |
|
12
|
|
|
|
|
|
|
|
|
13
|
2
|
|
|
2
|
|
8
|
use Carp qw( carp croak ); |
|
|
2
|
|
|
|
|
0
|
|
|
|
2
|
|
|
|
|
128
|
|
|
14
|
2
|
|
|
2
|
|
435
|
use Moo qw( has with ); |
|
|
2
|
|
|
|
|
9068
|
|
|
|
2
|
|
|
|
|
7
|
|
|
15
|
2
|
|
|
2
|
|
3463
|
use MooX::Lsub qw( lsub ); |
|
|
2
|
|
|
|
|
3338
|
|
|
|
2
|
|
|
|
|
8
|
|
|
16
|
|
|
|
|
|
|
with 'Pod::Weaver::PluginBundle::Author::KENTNL::Role::Easy'; |
|
17
|
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
|
|
22
|
0
|
|
|
0
|
0
|
0
|
sub mvp_aliases { return { command => qw[commands] } } |
|
23
|
0
|
|
|
0
|
0
|
0
|
sub mvp_multivalue_args { return qw( commands ) } |
|
24
|
9
|
|
|
9
|
0
|
23
|
sub bundle_prefix { return '@A:KNL:Collectors' } |
|
25
|
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
my $command_aliases = { |
|
27
|
|
|
|
|
|
|
'required' => 'REQUIRED METHODS', |
|
28
|
|
|
|
|
|
|
'function' => 'FUNCTIONS', |
|
29
|
|
|
|
|
|
|
'method' => 'METHODS', |
|
30
|
|
|
|
|
|
|
'attr' => 'ATTRIBUTES', |
|
31
|
|
|
|
|
|
|
'cattr' => 'ATTRIBUTES / CONSTRUCTOR ARGUMENTS', |
|
32
|
|
|
|
|
|
|
'pfunction' => 'PRIVATE FUNCTIONS', |
|
33
|
|
|
|
|
|
|
'pmethod' => 'PRIVATE METHODS', |
|
34
|
|
|
|
|
|
|
'pattr' => 'PRIVATE ATTRIBUTES', |
|
35
|
|
|
|
|
|
|
}; |
|
36
|
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
lsub commands => sub { |
|
76
|
1
|
|
|
1
|
|
6
|
return [qw( required function attr method pfunction pattr pmethod )]; |
|
77
|
|
|
|
|
|
|
}; |
|
78
|
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
sub instance_config { |
|
84
|
1
|
|
|
1
|
0
|
2
|
my ($self) = @_; |
|
85
|
1
|
|
|
|
|
4
|
$self->add_named_entry( 'Region.pre_commands', 'Region', { region_name => 'pre_commands' } ); |
|
86
|
1
|
|
|
|
|
1
|
for my $command ( @{ $self->commands } ) { |
|
|
1
|
|
|
|
|
14
|
|
|
87
|
7
|
50
|
|
|
|
13
|
if ( exists $command_aliases->{$command} ) { |
|
88
|
|
|
|
|
|
|
$self->add_named_entry( |
|
89
|
|
|
|
|
|
|
'Collect.' . $command => 'Collect', |
|
90
|
7
|
|
|
|
|
22
|
{ command => $command, header => $command_aliases->{$command}, }, |
|
91
|
|
|
|
|
|
|
); |
|
92
|
7
|
|
|
|
|
8
|
next; |
|
93
|
|
|
|
|
|
|
} |
|
94
|
0
|
0
|
|
|
|
0
|
if ( my ( $short, $long ) = $command =~ /\A\s*(\S+)\s*=\s*(.+?)\s*\z/msx ) { |
|
95
|
0
|
|
|
|
|
0
|
$self->add_named_entry( 'Collect.' . $command => 'Collect', { command => $short, header => $long, } ); |
|
96
|
0
|
|
|
|
|
0
|
next; |
|
97
|
|
|
|
|
|
|
} |
|
98
|
0
|
|
|
|
|
0
|
carp "Don't know what to do with command $command"; |
|
99
|
|
|
|
|
|
|
} |
|
100
|
1
|
|
|
|
|
3
|
$self->add_named_entry( 'Region.post_commands', 'Region', { region_name => 'post_commands' } ); |
|
101
|
1
|
|
|
|
|
27
|
return; |
|
102
|
|
|
|
|
|
|
} |
|
103
|
|
|
|
|
|
|
|
|
104
|
2
|
|
|
2
|
|
1132
|
no Moo; |
|
|
2
|
|
|
|
|
3
|
|
|
|
2
|
|
|
|
|
8
|
|
|
105
|
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
1; |
|
107
|
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
__END__ |
|
109
|
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
=pod |
|
111
|
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
=encoding UTF-8 |
|
113
|
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
=head1 NAME |
|
115
|
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
Pod::Weaver::PluginBundle::Author::KENTNL::Collectors - Sub/Attribute/Whatever but shorter and with defaults |
|
117
|
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
=head1 VERSION |
|
119
|
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
version 0.001003 |
|
121
|
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
=head1 QUICK REFERENCE |
|
123
|
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
[@Author::KENTNL::Collectors] |
|
125
|
|
|
|
|
|
|
; command[].default = [ required function attr method pfunction pattr pmethod ] |
|
126
|
|
|
|
|
|
|
; command[].entry_type[0] = KNOWNCOMMANDNAME |
|
127
|
|
|
|
|
|
|
; command[].entry_type[1] = COMMANDNAME = DESCRIPTION |
|
128
|
|
|
|
|
|
|
; KNOWNCOMMANDNAME.enums = |
|
129
|
|
|
|
|
|
|
; = required ; REQUIRED METHODS |
|
130
|
|
|
|
|
|
|
; = function ; FUNCTIONS |
|
131
|
|
|
|
|
|
|
; = method ; METHODS |
|
132
|
|
|
|
|
|
|
; = attr ; ATTRIBUTES |
|
133
|
|
|
|
|
|
|
; = cattr ; ATTRIBUTES / CONSTRUCTOR ARGUMENTS |
|
134
|
|
|
|
|
|
|
; = pfuncton ; PRIVATE FUNCTIONS |
|
135
|
|
|
|
|
|
|
; = pmethod ; PRIVATE METHODS |
|
136
|
|
|
|
|
|
|
; = pattr ; PRIVATE ATTRIBUTES |
|
137
|
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
139
|
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
[@Author::KENTNL::Collectors] |
|
141
|
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
This is basically the same as |
|
143
|
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
[Region / pre_commands] |
|
145
|
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
; This stuff repeated a bunch of times |
|
147
|
|
|
|
|
|
|
[Collect / ... ] |
|
148
|
|
|
|
|
|
|
... |
|
149
|
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
[Region / post_commands] |
|
151
|
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
But "This stuff repeated here" is a bit complicated and dynamic. |
|
153
|
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
=head1 ATTRIBUTES |
|
155
|
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
=head2 C<commands> |
|
157
|
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
A C<mvp_multivalue_args> parameter. |
|
159
|
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
command = method |
|
161
|
|
|
|
|
|
|
command = attr |
|
162
|
|
|
|
|
|
|
command = unknowncommand = HEADING IS THIS |
|
163
|
|
|
|
|
|
|
|
|
164
|
|
|
|
|
|
|
Default value: |
|
165
|
|
|
|
|
|
|
|
|
166
|
|
|
|
|
|
|
[qw( required attr method pattr pmethod )] |
|
167
|
|
|
|
|
|
|
|
|
168
|
|
|
|
|
|
|
=head3 Interpretation |
|
169
|
|
|
|
|
|
|
|
|
170
|
|
|
|
|
|
|
=over 4 |
|
171
|
|
|
|
|
|
|
|
|
172
|
|
|
|
|
|
|
=item * C<required> : REQUIRED METHODS command = C<required> |
|
173
|
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
=item * C<function> : FUNCTIONS command = C<function> |
|
175
|
|
|
|
|
|
|
|
|
176
|
|
|
|
|
|
|
=item * C<attr> : ATTRIBUTES command = C<attr> |
|
177
|
|
|
|
|
|
|
|
|
178
|
|
|
|
|
|
|
=item * C<method> : METHODS command = C<method> |
|
179
|
|
|
|
|
|
|
|
|
180
|
|
|
|
|
|
|
=item * C<cattr> : ATTRIBUTES / CONSTRUCTOR ARGUMENTS command = C<cattr> |
|
181
|
|
|
|
|
|
|
|
|
182
|
|
|
|
|
|
|
=item * C<pfunction> : PRIVATE FUNCTIONS command = C<pfunction> |
|
183
|
|
|
|
|
|
|
|
|
184
|
|
|
|
|
|
|
=item * C<pmethod> : PRIVATE METHODS command = C<pmethod> |
|
185
|
|
|
|
|
|
|
|
|
186
|
|
|
|
|
|
|
=item * C<pattr> : PRIVATE ATTRIBUTES command = C<pattr> |
|
187
|
|
|
|
|
|
|
|
|
188
|
|
|
|
|
|
|
=item * C<([^\s]+) = (.+)> : C<$2> command = C<$1> |
|
189
|
|
|
|
|
|
|
|
|
190
|
|
|
|
|
|
|
=back |
|
191
|
|
|
|
|
|
|
|
|
192
|
|
|
|
|
|
|
=for Pod::Coverage mvp_aliases mvp_multivalue_args bundle_prefix |
|
193
|
|
|
|
|
|
|
|
|
194
|
|
|
|
|
|
|
=for Pod::Coverage instance_config |
|
195
|
|
|
|
|
|
|
|
|
196
|
|
|
|
|
|
|
=head1 AUTHOR |
|
197
|
|
|
|
|
|
|
|
|
198
|
|
|
|
|
|
|
Kent Fredric <kentnl@cpan.org> |
|
199
|
|
|
|
|
|
|
|
|
200
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
|
201
|
|
|
|
|
|
|
|
|
202
|
|
|
|
|
|
|
This software is copyright (c) 2017 by Kent Fredric <kentfredric@gmail.com>. |
|
203
|
|
|
|
|
|
|
|
|
204
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
|
205
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
|
206
|
|
|
|
|
|
|
|
|
207
|
|
|
|
|
|
|
=cut |