line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
{ |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
use strict; |
4
|
107
|
|
|
107
|
|
972
|
use warnings; |
|
107
|
|
|
|
|
404
|
|
|
107
|
|
|
|
|
4049
|
|
5
|
107
|
|
|
107
|
|
807
|
no warnings qw( once void ); |
|
107
|
|
|
|
|
442
|
|
|
107
|
|
|
|
|
4335
|
|
6
|
107
|
|
|
107
|
|
698
|
|
|
107
|
|
|
|
|
359
|
|
|
107
|
|
|
|
|
20703
|
|
7
|
|
|
|
|
|
|
our $USES_MITE = "Mite::Class"; |
8
|
|
|
|
|
|
|
our $MITE_SHIM = "Mite::Shim"; |
9
|
|
|
|
|
|
|
our $MITE_VERSION = "0.011000"; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
# Mite keywords |
12
|
|
|
|
|
|
|
BEGIN { |
13
|
|
|
|
|
|
|
my ( $SHIM, $CALLER ) = ( "Mite::Shim", "Mite::Project" ); |
14
|
107
|
|
|
107
|
|
706
|
( |
15
|
|
|
|
|
|
|
*after, *around, *before, *extends, *field, |
16
|
|
|
|
|
|
|
*has, *param, *signature_for, *with |
17
|
|
|
|
|
|
|
) |
18
|
|
|
|
|
|
|
= do { |
19
|
107
|
|
|
|
|
396
|
|
20
|
|
|
|
|
|
|
no warnings 'redefine'; |
21
|
|
|
|
|
|
|
( |
22
|
107
|
|
|
107
|
|
949
|
sub { $SHIM->HANDLE_after( $CALLER, "class", @_ ) }, |
|
107
|
|
|
|
|
413
|
|
|
107
|
|
|
|
|
24129
|
|
23
|
|
|
|
|
|
|
sub { $SHIM->HANDLE_around( $CALLER, "class", @_ ) }, |
24
|
0
|
|
|
0
|
|
0
|
sub { $SHIM->HANDLE_before( $CALLER, "class", @_ ) }, |
25
|
0
|
|
|
0
|
|
0
|
sub { }, |
26
|
0
|
|
|
0
|
|
0
|
sub { $SHIM->HANDLE_has( $CALLER, field => @_ ) }, |
27
|
|
|
|
0
|
|
|
sub { $SHIM->HANDLE_has( $CALLER, has => @_ ) }, |
28
|
0
|
|
|
0
|
|
0
|
sub { $SHIM->HANDLE_has( $CALLER, param => @_ ) }, |
29
|
428
|
|
|
428
|
|
211603
|
sub { $SHIM->HANDLE_signature_for( $CALLER, "class", @_ ) }, |
30
|
0
|
|
|
0
|
|
0
|
sub { $SHIM->HANDLE_with( $CALLER, @_ ) }, |
31
|
321
|
|
|
321
|
|
108479
|
); |
32
|
0
|
|
|
0
|
|
0
|
} |
33
|
107
|
|
|
|
|
21641
|
|
34
|
|
|
|
|
|
|
# Mite imports |
35
|
|
|
|
|
|
|
BEGIN { |
36
|
|
|
|
|
|
|
require Scalar::Util; |
37
|
|
|
|
|
|
|
*STRICT = \&Mite::Shim::STRICT; |
38
|
|
|
|
|
|
|
*bare = \&Mite::Shim::bare; |
39
|
107
|
|
|
107
|
|
985
|
*blessed = \&Scalar::Util::blessed; |
40
|
107
|
|
|
|
|
521
|
*carp = \&Mite::Shim::carp; |
41
|
107
|
|
|
|
|
425
|
*confess = \&Mite::Shim::confess; |
42
|
107
|
|
|
|
|
512
|
*croak = \&Mite::Shim::croak; |
43
|
107
|
|
|
|
|
411
|
*false = \&Mite::Shim::false; |
44
|
107
|
|
|
|
|
356
|
*guard = \&Mite::Shim::guard; |
45
|
107
|
|
|
|
|
389
|
*lazy = \&Mite::Shim::lazy; |
46
|
107
|
|
|
|
|
337
|
*lock = \&Mite::Shim::lock; |
47
|
107
|
|
|
|
|
435
|
*ro = \&Mite::Shim::ro; |
48
|
107
|
|
|
|
|
319
|
*rw = \&Mite::Shim::rw; |
49
|
107
|
|
|
|
|
382
|
*rwp = \&Mite::Shim::rwp; |
50
|
107
|
|
|
|
|
323
|
*true = \&Mite::Shim::true; |
51
|
107
|
|
|
|
|
558
|
*unlock = \&Mite::Shim::unlock; |
52
|
107
|
|
|
|
|
309
|
} |
53
|
107
|
|
|
|
|
319
|
|
54
|
107
|
|
|
|
|
3274
|
# Gather metadata for constructor and destructor |
55
|
|
|
|
|
|
|
no strict 'refs'; |
56
|
|
|
|
|
|
|
my $class = shift; |
57
|
|
|
|
|
|
|
$class = ref($class) || $class; |
58
|
|
|
|
|
|
|
my $linear_isa = mro::get_linear_isa($class); |
59
|
107
|
|
|
107
|
|
695
|
return { |
|
107
|
|
|
|
|
306
|
|
|
107
|
|
|
|
|
38460
|
|
60
|
106
|
|
|
106
|
|
351
|
BUILD => [ |
61
|
106
|
|
33
|
|
|
822
|
map { ( *{$_}{CODE} ) ? ( *{$_}{CODE} ) : () } |
62
|
106
|
|
|
|
|
798
|
map { "$_\::BUILD" } reverse @$linear_isa |
63
|
|
|
|
|
|
|
], |
64
|
|
|
|
|
|
|
DEMOLISH => [ |
65
|
106
|
50
|
|
|
|
288
|
map { ( *{$_}{CODE} ) ? ( *{$_}{CODE} ) : () } |
|
106
|
|
|
|
|
2148
|
|
|
0
|
|
|
|
|
0
|
|
66
|
106
|
|
|
|
|
713
|
map { "$_\::DEMOLISH" } @$linear_isa |
67
|
|
|
|
|
|
|
], |
68
|
|
|
|
|
|
|
HAS_BUILDARGS => $class->can('BUILDARGS'), |
69
|
106
|
50
|
|
|
|
271
|
HAS_FOREIGNBUILDARGS => $class->can('FOREIGNBUILDARGS'), |
|
106
|
|
|
|
|
3039
|
|
|
0
|
|
|
|
|
0
|
|
70
|
106
|
|
|
|
|
513
|
}; |
|
106
|
|
|
|
|
624
|
|
71
|
|
|
|
|
|
|
} |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
# Standard Moose/Moo-style constructor |
74
|
|
|
|
|
|
|
my $class = ref( $_[0] ) ? ref(shift) : shift; |
75
|
|
|
|
|
|
|
my $meta = ( $Mite::META{$class} ||= $class->__META__ ); |
76
|
|
|
|
|
|
|
my $self = bless {}, $class; |
77
|
|
|
|
|
|
|
my $args = |
78
|
|
|
|
|
|
|
$meta->{HAS_BUILDARGS} |
79
|
109
|
50
|
|
109
|
0
|
10637
|
? $class->BUILDARGS(@_) |
80
|
109
|
|
66
|
|
|
1227
|
: { ( @_ == 1 ) ? %{ $_[0] } : @_ }; |
81
|
109
|
|
|
|
|
501
|
my $no_build = delete $args->{__no_BUILD__}; |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
# Attribute sources (type: HashRef[Mite::Source]) |
84
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Project.pm, line 14 |
85
|
109
|
50
|
|
|
|
959
|
do { |
|
0
|
50
|
|
|
|
0
|
|
86
|
109
|
|
|
|
|
361
|
my $value = |
87
|
|
|
|
|
|
|
exists( $args->{"sources"} ) |
88
|
|
|
|
|
|
|
? $args->{"sources"} |
89
|
|
|
|
|
|
|
: $Mite::Project::__sources_DEFAULT__->($self); |
90
|
109
|
|
|
|
|
255
|
do { |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
( ref($value) eq 'HASH' ) and do { |
93
|
109
|
50
|
|
|
|
875
|
my $ok = 1; |
94
|
|
|
|
|
|
|
for my $i ( values %{$value} ) { |
95
|
109
|
50
|
|
|
|
303
|
( $ok = 0, last ) |
96
|
|
|
|
|
|
|
unless ( |
97
|
|
|
|
|
|
|
do { |
98
|
109
|
50
|
|
|
|
943
|
use Scalar::Util (); |
99
|
109
|
|
|
|
|
406
|
Scalar::Util::blessed($i) |
100
|
109
|
|
|
|
|
295
|
and $i->isa(q[Mite::Source]); |
|
109
|
|
|
|
|
566
|
|
101
|
|
|
|
|
|
|
} |
102
|
|
|
|
|
|
|
); |
103
|
0
|
0
|
|
|
|
0
|
}; |
104
|
107
|
|
|
107
|
|
961
|
$ok; |
|
107
|
|
|
|
|
725
|
|
|
107
|
|
|
|
|
73058
|
|
105
|
0
|
0
|
|
|
|
0
|
} |
106
|
|
|
|
|
|
|
or croak "Type check failed in constructor: %s should be %s", |
107
|
|
|
|
|
|
|
"sources", "HashRef[Mite::Source]"; |
108
|
|
|
|
|
|
|
$self->{"sources"} = $value; |
109
|
|
|
|
|
|
|
}; |
110
|
109
|
|
|
|
|
814
|
|
111
|
|
|
|
|
|
|
# Attribute config (type: Mite::Config) |
112
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Project.pm, line 24 |
113
|
|
|
|
|
|
|
if ( exists $args->{"config"} ) { |
114
|
|
|
|
|
|
|
blessed( $args->{"config"} ) |
115
|
109
|
|
|
|
|
748
|
&& $args->{"config"}->isa("Mite::Config") |
116
|
|
|
|
|
|
|
or croak "Type check failed in constructor: %s should be %s", |
117
|
|
|
|
|
|
|
"config", "Mite::Config"; |
118
|
|
|
|
|
|
|
$self->{"config"} = $args->{"config"}; |
119
|
|
|
|
|
|
|
} |
120
|
109
|
50
|
|
|
|
609
|
|
121
|
|
|
|
|
|
|
# Attribute _module_fakeout_namespace (type: Str|Undef) |
122
|
0
|
0
|
0
|
|
|
0
|
# has declaration, file lib/Mite/Project.pm, line 26 |
123
|
|
|
|
|
|
|
if ( exists $args->{"_module_fakeout_namespace"} ) { |
124
|
|
|
|
|
|
|
do { |
125
|
0
|
|
|
|
|
0
|
|
126
|
|
|
|
|
|
|
( |
127
|
|
|
|
|
|
|
do { |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
defined( $args->{"_module_fakeout_namespace"} ) and do { |
130
|
109
|
50
|
|
|
|
606
|
ref( \$args->{"_module_fakeout_namespace"} ) eq |
131
|
0
|
0
|
|
|
|
0
|
'SCALAR' |
132
|
|
|
|
|
|
|
or ref( |
133
|
|
|
|
|
|
|
\( |
134
|
|
|
|
|
|
|
my $val = |
135
|
|
|
|
|
|
|
$args->{"_module_fakeout_namespace"} |
136
|
|
|
|
|
|
|
) |
137
|
|
|
|
|
|
|
) eq 'SCALAR'; |
138
|
0
|
0
|
|
|
|
0
|
} |
139
|
|
|
|
|
|
|
} |
140
|
|
|
|
|
|
|
or do { |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
!defined( $args->{"_module_fakeout_namespace"} ); |
143
|
|
|
|
|
|
|
} |
144
|
0
|
0
|
|
|
|
0
|
); |
145
|
|
|
|
|
|
|
or croak "Type check failed in constructor: %s should be %s", |
146
|
|
|
|
|
|
|
"_module_fakeout_namespace", "Str|Undef"; |
147
|
|
|
|
|
|
|
$self->{"_module_fakeout_namespace"} = |
148
|
|
|
|
|
|
|
$args->{"_module_fakeout_namespace"}; |
149
|
0
|
0
|
|
|
|
0
|
} |
150
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
# Attribute debug (type: Bool) |
152
|
0
|
|
|
|
|
0
|
# has declaration, file lib/Mite/Project.pm, line 30 |
153
|
|
|
|
|
|
|
do { |
154
|
|
|
|
|
|
|
my $value = exists( $args->{"debug"} ) ? $args->{"debug"} : false; |
155
|
|
|
|
|
|
|
( |
156
|
|
|
|
|
|
|
!ref $value |
157
|
|
|
|
|
|
|
and (!defined $value |
158
|
|
|
|
|
|
|
or $value eq q() |
159
|
0
|
|
|
|
|
0
|
or $value eq '0' |
160
|
|
|
|
|
|
|
or $value eq '1' ) |
161
|
|
|
|
|
|
|
) |
162
|
|
|
|
|
|
|
or croak "Type check failed in constructor: %s should be %s", |
163
|
|
|
|
|
|
|
"debug", "Bool"; |
164
|
109
|
|
|
|
|
265
|
$self->{"debug"} = $value; |
165
|
109
|
50
|
|
|
|
586
|
}; |
166
|
|
|
|
|
|
|
|
167
|
109
|
0
|
33
|
|
|
1714
|
# Call BUILD methods |
|
|
|
33
|
|
|
|
|
168
|
|
|
|
|
|
|
$self->BUILDALL($args) if ( !$no_build and @{ $meta->{BUILD} || [] } ); |
169
|
|
|
|
|
|
|
|
170
|
|
|
|
|
|
|
# Unrecognized parameters |
171
|
|
|
|
|
|
|
my @unknown = |
172
|
|
|
|
|
|
|
grep not(/\A(?:_module_fakeout_namespace|config|debug|sources)\z/), |
173
|
|
|
|
|
|
|
keys %{$args}; |
174
|
|
|
|
|
|
|
@unknown |
175
|
109
|
|
|
|
|
490
|
and croak( |
176
|
|
|
|
|
|
|
"Unexpected keys in constructor: " . join( q[, ], sort @unknown ) ); |
177
|
|
|
|
|
|
|
|
178
|
|
|
|
|
|
|
return $self; |
179
|
109
|
50
|
33
|
|
|
834
|
} |
|
109
|
50
|
|
|
|
1053
|
|
180
|
|
|
|
|
|
|
|
181
|
|
|
|
|
|
|
# Used by constructor to call BUILD methods |
182
|
|
|
|
|
|
|
my $class = ref( $_[0] ); |
183
|
|
|
|
|
|
|
my $meta = ( $Mite::META{$class} ||= $class->__META__ ); |
184
|
109
|
|
|
|
|
325
|
$_->(@_) for @{ $meta->{BUILD} || [] }; |
|
109
|
|
|
|
|
519
|
|
185
|
|
|
|
|
|
|
} |
186
|
109
|
50
|
|
|
|
472
|
|
187
|
|
|
|
|
|
|
# Destructor should call DEMOLISH methods |
188
|
|
|
|
|
|
|
my $self = shift; |
189
|
109
|
|
|
|
|
975
|
my $class = ref($self) || $self; |
190
|
|
|
|
|
|
|
my $meta = ( $Mite::META{$class} ||= $class->__META__ ); |
191
|
|
|
|
|
|
|
my $in_global_destruction = |
192
|
|
|
|
|
|
|
defined ${^GLOBAL_PHASE} |
193
|
|
|
|
|
|
|
? ${^GLOBAL_PHASE} eq 'DESTRUCT' |
194
|
0
|
|
|
0
|
0
|
0
|
: Devel::GlobalDestruction::in_global_destruction(); |
195
|
0
|
|
0
|
|
|
0
|
for my $demolisher ( @{ $meta->{DEMOLISH} || [] } ) { |
196
|
0
|
0
|
|
|
|
0
|
my $e = do { |
|
0
|
|
|
|
|
0
|
|
197
|
|
|
|
|
|
|
local ( $?, $@ ); |
198
|
|
|
|
|
|
|
eval { $demolisher->( $self, $in_global_destruction ) }; |
199
|
|
|
|
|
|
|
$@; |
200
|
|
|
|
|
|
|
}; |
201
|
5
|
|
|
5
|
|
2739
|
no warnings 'misc'; # avoid (in cleanup) warnings |
202
|
5
|
|
33
|
|
|
32
|
die $e if $e; # rethrow |
203
|
5
|
|
33
|
|
|
30
|
} |
204
|
5
|
50
|
|
|
|
30
|
return; |
205
|
|
|
|
|
|
|
} |
206
|
|
|
|
|
|
|
|
207
|
|
|
|
|
|
|
my $__XS = !$ENV{PERL_ONLY} |
208
|
5
|
50
|
|
|
|
13
|
&& eval { require Class::XSAccessor; Class::XSAccessor->VERSION("1.19") }; |
|
5
|
|
|
|
|
32
|
|
209
|
0
|
|
|
|
|
0
|
|
210
|
0
|
|
|
|
|
0
|
# Accessors for _module_fakeout_namespace |
211
|
0
|
|
|
|
|
0
|
# has declaration, file lib/Mite/Project.pm, line 26 |
|
0
|
|
|
|
|
0
|
|
212
|
0
|
|
|
|
|
0
|
@_ > 1 |
213
|
|
|
|
|
|
|
? do { |
214
|
107
|
|
|
107
|
|
1019
|
do { |
|
107
|
|
|
|
|
318
|
|
|
107
|
|
|
|
|
89134
|
|
215
|
0
|
0
|
|
|
|
0
|
|
216
|
|
|
|
|
|
|
( |
217
|
5
|
|
|
|
|
34
|
do { |
218
|
|
|
|
|
|
|
|
219
|
|
|
|
|
|
|
defined( $_[1] ) and do { |
220
|
|
|
|
|
|
|
ref( \$_[1] ) eq 'SCALAR' |
221
|
|
|
|
|
|
|
or ref( \( my $val = $_[1] ) ) eq 'SCALAR'; |
222
|
|
|
|
|
|
|
} |
223
|
|
|
|
|
|
|
} |
224
|
|
|
|
|
|
|
or ( !defined( $_[1] ) ) |
225
|
|
|
|
|
|
|
); |
226
|
|
|
|
|
|
|
or croak( "Type check failed in %s: value should be %s", |
227
|
|
|
|
|
|
|
"accessor", "Str|Undef" ); |
228
|
0
|
0
|
|
|
|
0
|
$_[0]{"_module_fakeout_namespace"} = $_[1]; |
229
|
|
|
|
|
|
|
$_[0]; |
230
|
|
|
|
|
|
|
} |
231
|
|
|
|
|
|
|
: ( $_[0]{"_module_fakeout_namespace"} ); |
232
|
0
|
0
|
|
|
|
0
|
} |
233
|
|
|
|
|
|
|
|
234
|
|
|
|
|
|
|
# Accessors for config |
235
|
0
|
0
|
|
|
|
0
|
# has declaration, file lib/Mite/Project.pm, line 24 |
236
|
0
|
0
|
|
|
|
0
|
@_ == 1 or croak('Reader "config" usage: $self->config()'); |
237
|
|
|
|
|
|
|
( |
238
|
|
|
|
|
|
|
exists( $_[0]{"config"} ) ? $_[0]{"config"} : ( |
239
|
|
|
|
|
|
|
$_[0]{"config"} = do { |
240
|
|
|
|
|
|
|
my $default_value = |
241
|
|
|
|
|
|
|
$Mite::Project::__config_DEFAULT__->( $_[0] ); |
242
|
|
|
|
|
|
|
blessed($default_value) |
243
|
|
|
|
|
|
|
&& $default_value->isa("Mite::Config") |
244
|
|
|
|
|
|
|
or croak( "Type check failed in default: %s should be %s", |
245
|
0
|
|
|
|
|
0
|
"config", "Mite::Config" ); |
246
|
0
|
|
|
|
|
0
|
$default_value; |
247
|
|
|
|
|
|
|
} |
248
|
515
|
50
|
|
515
|
|
3351
|
) |
249
|
|
|
|
|
|
|
); |
250
|
|
|
|
|
|
|
} |
251
|
|
|
|
|
|
|
|
252
|
|
|
|
|
|
|
# Accessors for debug |
253
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Project.pm, line 30 |
254
|
936
|
50
|
|
936
|
0
|
3353
|
@_ > 1 |
255
|
|
|
|
|
|
|
? do { |
256
|
|
|
|
|
|
|
( |
257
|
936
|
100
|
|
|
|
5256
|
!ref $_[1] |
258
|
104
|
|
|
|
|
656
|
and (!defined $_[1] |
259
|
|
|
|
|
|
|
or $_[1] eq q() |
260
|
104
|
50
|
33
|
|
|
1870
|
or $_[1] eq '0' |
261
|
|
|
|
|
|
|
or $_[1] eq '1' ) |
262
|
|
|
|
|
|
|
) |
263
|
|
|
|
|
|
|
or croak( "Type check failed in %s: value should be %s", |
264
|
104
|
|
|
|
|
1184
|
"accessor", "Bool" ); |
265
|
|
|
|
|
|
|
$_[0]{"debug"} = $_[1]; |
266
|
|
|
|
|
|
|
$_[0]; |
267
|
|
|
|
|
|
|
} |
268
|
|
|
|
|
|
|
: ( $_[0]{"debug"} ); |
269
|
|
|
|
|
|
|
} |
270
|
|
|
|
|
|
|
|
271
|
|
|
|
|
|
|
# Accessors for sources |
272
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Project.pm, line 14 |
273
|
|
|
|
|
|
|
if ($__XS) { |
274
|
|
|
|
|
|
|
Class::XSAccessor->import( |
275
|
|
|
|
|
|
|
chained => 1, |
276
|
14
|
0
|
0
|
|
|
176
|
"getters" => { "sources" => "sources" }, |
|
|
|
33
|
|
|
|
|
277
|
|
|
|
|
|
|
); |
278
|
|
|
|
|
|
|
} |
279
|
|
|
|
|
|
|
else { |
280
|
|
|
|
|
|
|
*sources = sub { |
281
|
|
|
|
|
|
|
@_ == 1 or croak('Reader "sources" usage: $self->sources()'); |
282
|
|
|
|
|
|
|
$_[0]{"sources"}; |
283
|
|
|
|
|
|
|
}; |
284
|
14
|
|
|
|
|
60
|
} |
285
|
14
|
|
|
|
|
45
|
|
286
|
|
|
|
|
|
|
# See UNIVERSAL |
287
|
323
|
100
|
|
323
|
0
|
3420
|
my ( $self, $role ) = @_; |
288
|
|
|
|
|
|
|
our %DOES; |
289
|
|
|
|
|
|
|
return $DOES{$role} if exists $DOES{$role}; |
290
|
|
|
|
|
|
|
return 1 if $role eq __PACKAGE__; |
291
|
|
|
|
|
|
|
if ( $INC{'Moose/Util.pm'} |
292
|
|
|
|
|
|
|
and my $meta = Moose::Util::find_meta( ref $self or $self ) ) |
293
|
|
|
|
|
|
|
{ |
294
|
|
|
|
|
|
|
$meta->can('does_role') and $meta->does_role($role) and return 1; |
295
|
|
|
|
|
|
|
} |
296
|
|
|
|
|
|
|
return $self->SUPER::DOES($role); |
297
|
|
|
|
|
|
|
} |
298
|
|
|
|
|
|
|
|
299
|
|
|
|
|
|
|
# Alias for Moose/Moo-compatibility |
300
|
|
|
|
|
|
|
shift->DOES(@_); |
301
|
|
|
|
|
|
|
} |
302
|
|
|
|
|
|
|
|
303
|
|
|
|
|
|
|
# Method signatures |
304
|
|
|
|
|
|
|
our %SIGNATURE_FOR; |
305
|
|
|
|
|
|
|
|
306
|
|
|
|
|
|
|
$SIGNATURE_FOR{"_recurse_directory"} = sub { |
307
|
0
|
|
|
0
|
0
|
|
my $__NEXT__ = shift; |
308
|
0
|
|
|
|
|
|
|
309
|
0
|
0
|
|
|
|
|
my ( @out, %tmp, $tmp, $dtmp, @head ); |
310
|
0
|
0
|
|
|
|
|
|
311
|
0
|
0
|
0
|
|
|
|
@_ == 3 |
|
|
|
0
|
|
|
|
|
312
|
|
|
|
|
|
|
or |
313
|
|
|
|
|
|
|
croak( "Wrong number of parameters in signature for %s: got %d, %s", |
314
|
0
|
0
|
0
|
|
|
|
"_recurse_directory", scalar(@_), "expected exactly 3 parameters" ); |
315
|
|
|
|
|
|
|
|
316
|
0
|
|
|
|
|
|
@head = splice( @_, 0, 1 ); |
317
|
|
|
|
|
|
|
|
318
|
|
|
|
|
|
|
# Parameter invocant (type: Defined) |
319
|
|
|
|
|
|
|
( defined( $head[0] ) ) |
320
|
|
|
|
|
|
|
or croak( |
321
|
0
|
|
|
0
|
0
|
|
"Type check failed in signature for _recurse_directory: %s should be %s", |
322
|
|
|
|
|
|
|
"\$_[0]", "Defined" |
323
|
|
|
|
|
|
|
); |
324
|
|
|
|
|
|
|
|
325
|
|
|
|
|
|
|
# Parameter $_[0] (type: Path) |
326
|
|
|
|
|
|
|
$tmp = ( |
327
|
|
|
|
|
|
|
( |
328
|
|
|
|
|
|
|
do { |
329
|
|
|
|
|
|
|
use Scalar::Util (); |
330
|
|
|
|
|
|
|
Scalar::Util::blessed( $_[0] ) |
331
|
|
|
|
|
|
|
and $_[0]->isa(q[Path::Tiny]); |
332
|
|
|
|
|
|
|
} |
333
|
|
|
|
|
|
|
) |
334
|
|
|
|
|
|
|
) ? $_[0] : ( |
335
|
|
|
|
|
|
|
do { |
336
|
|
|
|
|
|
|
|
337
|
|
|
|
|
|
|
defined( $_[0] ) and do { |
338
|
|
|
|
|
|
|
ref( \$_[0] ) eq 'SCALAR' |
339
|
|
|
|
|
|
|
or ref( \( my $val = $_[0] ) ) eq 'SCALAR'; |
340
|
|
|
|
|
|
|
} |
341
|
|
|
|
|
|
|
) |
342
|
|
|
|
|
|
|
? scalar( |
343
|
|
|
|
|
|
|
do { local $_ = $_[0]; Path::Tiny::path($_) } |
344
|
|
|
|
|
|
|
) |
345
|
|
|
|
|
|
|
: ( |
346
|
|
|
|
|
|
|
do { |
347
|
|
|
|
|
|
|
|
348
|
|
|
|
|
|
|
defined( $_[0] ) && !ref( $_[0] ) |
349
|
|
|
|
|
|
|
or Scalar::Util::blessed( $_[0] ) && ( |
350
|
107
|
|
|
107
|
|
1009
|
sub { |
|
107
|
|
|
|
|
468
|
|
|
107
|
|
|
|
|
30698
|
|
351
|
|
|
|
|
|
|
require overload; |
352
|
|
|
|
|
|
|
overload::Overloaded( ref $_[0] or $_[0] ) |
353
|
|
|
|
|
|
|
and overload::Method( ( ref $_[0] or $_[0] ), $_[1] ); |
354
|
|
|
|
|
|
|
} |
355
|
|
|
|
|
|
|
)->( $_[0], q[""] ); |
356
|
|
|
|
|
|
|
) |
357
|
|
|
|
|
|
|
? scalar( |
358
|
|
|
|
|
|
|
do { local $_ = $_[0]; Path::Tiny::path($_) } |
359
|
|
|
|
|
|
|
) |
360
|
|
|
|
|
|
|
: ( ( ref( $_[0] ) eq 'ARRAY' ) ) ? scalar( |
361
|
|
|
|
|
|
|
do { local $_ = $_[0]; Path::Tiny::path(@$_) } |
362
|
|
|
|
|
|
|
) |
363
|
|
|
|
|
|
|
: $_[0]; |
364
|
|
|
|
|
|
|
( |
365
|
|
|
|
|
|
|
do { |
366
|
|
|
|
|
|
|
use Scalar::Util (); |
367
|
|
|
|
|
|
|
Scalar::Util::blessed($tmp) and $tmp->isa(q[Path::Tiny]); |
368
|
|
|
|
|
|
|
} |
369
|
|
|
|
|
|
|
) |
370
|
|
|
|
|
|
|
or croak( |
371
|
|
|
|
|
|
|
"Type check failed in signature for _recurse_directory: %s should be %s", |
372
|
|
|
|
|
|
|
"\$_[1]", "Path" |
373
|
|
|
|
|
|
|
); |
374
|
|
|
|
|
|
|
push( @out, $tmp ); |
375
|
|
|
|
|
|
|
|
376
|
|
|
|
|
|
|
# Parameter $_[1] (type: CodeRef) |
377
|
|
|
|
|
|
|
( ref( $_[1] ) eq 'CODE' ) |
378
|
|
|
|
|
|
|
or croak( |
379
|
|
|
|
|
|
|
"Type check failed in signature for _recurse_directory: %s should be %s", |
380
|
|
|
|
|
|
|
"\$_[2]", "CodeRef" |
381
|
|
|
|
|
|
|
); |
382
|
|
|
|
|
|
|
push( @out, $_[1] ); |
383
|
|
|
|
|
|
|
|
384
|
|
|
|
|
|
|
do { @_ = ( @head, @out ); goto $__NEXT__ }; |
385
|
|
|
|
|
|
|
}; |
386
|
|
|
|
|
|
|
|
387
|
|
|
|
|
|
|
$SIGNATURE_FOR{"inject_mite_functions"} = sub { |
388
|
|
|
|
|
|
|
my $__NEXT__ = shift; |
389
|
|
|
|
|
|
|
|
390
|
|
|
|
|
|
|
my ( %out, %in, %tmp, $tmp, $dtmp, @head ); |
391
|
107
|
|
|
107
|
|
906
|
|
|
107
|
|
|
|
|
384
|
|
|
107
|
|
|
|
|
61975
|
|
392
|
|
|
|
|
|
|
@_ == 2 && ( ref( $_[1] ) eq 'HASH' ) |
393
|
|
|
|
|
|
|
or @_ % 2 == 1 && @_ >= 7 && @_ <= 15 |
394
|
|
|
|
|
|
|
or |
395
|
|
|
|
|
|
|
croak( "Wrong number of parameters in signature for %s: got %d, %s", |
396
|
|
|
|
|
|
|
"inject_mite_functions", scalar(@_), "that does not seem right" ); |
397
|
|
|
|
|
|
|
|
398
|
|
|
|
|
|
|
@head = splice( @_, 0, 1 ); |
399
|
|
|
|
|
|
|
|
400
|
|
|
|
|
|
|
# Parameter invocant (type: Defined) |
401
|
|
|
|
|
|
|
( defined( $head[0] ) ) |
402
|
|
|
|
|
|
|
or croak( |
403
|
|
|
|
|
|
|
"Type check failed in signature for inject_mite_functions: %s should be %s", |
404
|
|
|
|
|
|
|
"\$_[0]", "Defined" |
405
|
|
|
|
|
|
|
); |
406
|
|
|
|
|
|
|
|
407
|
|
|
|
|
|
|
%in = ( @_ == 1 and ( ref( $_[0] ) eq 'HASH' ) ) ? %{ $_[0] } : @_; |
408
|
|
|
|
|
|
|
|
409
|
|
|
|
|
|
|
# Parameter package (type: Any) |
410
|
|
|
|
|
|
|
exists( $in{"package"} ) |
411
|
|
|
|
|
|
|
or croak( "Failure in signature for inject_mite_functions: " |
412
|
|
|
|
|
|
|
. 'Missing required parameter: package' ); |
413
|
|
|
|
|
|
|
1; # ... nothing to do |
414
|
|
|
|
|
|
|
$out{"package"} = $in{"package"} if exists( $in{"package"} ); |
415
|
|
|
|
|
|
|
delete( $in{"package"} ); |
416
|
|
|
|
|
|
|
|
417
|
|
|
|
|
|
|
# Parameter file (type: Any) |
418
|
|
|
|
|
|
|
exists( $in{"file"} ) |
419
|
|
|
|
|
|
|
or croak( "Failure in signature for inject_mite_functions: " |
420
|
|
|
|
|
|
|
. 'Missing required parameter: file' ); |
421
|
|
|
|
|
|
|
1; # ... nothing to do |
422
|
|
|
|
|
|
|
$out{"file"} = $in{"file"} if exists( $in{"file"} ); |
423
|
|
|
|
|
|
|
delete( $in{"file"} ); |
424
|
|
|
|
|
|
|
|
425
|
|
|
|
|
|
|
# Parameter kind (type: Optional[Str]) |
426
|
|
|
|
|
|
|
if ( exists( $in{"kind"} ) ) { |
427
|
|
|
|
|
|
|
do { |
428
|
|
|
|
|
|
|
|
429
|
|
|
|
|
|
|
defined( $in{"kind"} ) and do { |
430
|
|
|
|
|
|
|
ref( \$in{"kind"} ) eq 'SCALAR' |
431
|
|
|
|
|
|
|
or ref( \( my $val = $in{"kind"} ) ) eq 'SCALAR'; |
432
|
|
|
|
|
|
|
} |
433
|
|
|
|
|
|
|
or croak( |
434
|
|
|
|
|
|
|
"Type check failed in signature for inject_mite_functions: %s should be %s", |
435
|
|
|
|
|
|
|
"\$_{\"kind\"}", "Optional[Str]" |
436
|
|
|
|
|
|
|
); |
437
|
|
|
|
|
|
|
$out{"kind"} = $in{"kind"}; |
438
|
|
|
|
|
|
|
delete( $in{"kind"} ); |
439
|
|
|
|
|
|
|
} |
440
|
|
|
|
|
|
|
|
441
|
|
|
|
|
|
|
# Parameter arg (type: HashRef) |
442
|
|
|
|
|
|
|
$dtmp = exists( $in{"arg"} ) ? $in{"arg"} : {}; |
443
|
|
|
|
|
|
|
( ref($dtmp) eq 'HASH' ) |
444
|
|
|
|
|
|
|
or croak( |
445
|
|
|
|
|
|
|
"Type check failed in signature for inject_mite_functions: %s should be %s", |
446
|
|
|
|
|
|
|
"\$_{\"arg\"}", "HashRef" |
447
|
|
|
|
|
|
|
); |
448
|
|
|
|
|
|
|
$out{"arg"} = $dtmp; |
449
|
|
|
|
|
|
|
delete( $in{"arg"} ); |
450
|
|
|
|
|
|
|
|
451
|
|
|
|
|
|
|
# Parameter shim (type: Str) |
452
|
|
|
|
|
|
|
exists( $in{"shim"} ) |
453
|
|
|
|
|
|
|
or croak( "Failure in signature for inject_mite_functions: " |
454
|
|
|
|
|
|
|
. 'Missing required parameter: shim' ); |
455
|
|
|
|
|
|
|
do { |
456
|
|
|
|
|
|
|
|
457
|
|
|
|
|
|
|
defined( $in{"shim"} ) and do { |
458
|
|
|
|
|
|
|
ref( \$in{"shim"} ) eq 'SCALAR' |
459
|
|
|
|
|
|
|
or ref( \( my $val = $in{"shim"} ) ) eq 'SCALAR'; |
460
|
|
|
|
|
|
|
} |
461
|
|
|
|
|
|
|
or croak( |
462
|
|
|
|
|
|
|
"Type check failed in signature for inject_mite_functions: %s should be %s", |
463
|
|
|
|
|
|
|
"\$_{\"shim\"}", "Str" |
464
|
|
|
|
|
|
|
); |
465
|
|
|
|
|
|
|
$out{"shim"} = $in{"shim"} if exists( $in{"shim"} ); |
466
|
|
|
|
|
|
|
delete( $in{"shim"} ); |
467
|
|
|
|
|
|
|
|
468
|
|
|
|
|
|
|
# Parameter x_source (type: Optional[Object]) |
469
|
|
|
|
|
|
|
if ( exists( $in{"x_source"} ) ) { |
470
|
|
|
|
|
|
|
( |
471
|
|
|
|
|
|
|
do { |
472
|
|
|
|
|
|
|
|
473
|
|
|
|
|
|
|
use Scalar::Util (); |
474
|
|
|
|
|
|
|
Scalar::Util::blessed( $in{"x_source"} ); |
475
|
|
|
|
|
|
|
) |
476
|
|
|
|
|
|
|
or croak( |
477
|
|
|
|
|
|
|
"Type check failed in signature for inject_mite_functions: %s should be %s", |
478
|
|
|
|
|
|
|
"\$_{\"x_source\"}", "Optional[Object]" |
479
|
|
|
|
|
|
|
); |
480
|
|
|
|
|
|
|
$out{"x_source"} = $in{"x_source"}; |
481
|
|
|
|
|
|
|
delete( $in{"x_source"} ); |
482
|
|
|
|
|
|
|
} |
483
|
|
|
|
|
|
|
|
484
|
|
|
|
|
|
|
# Parameter x_pkg (type: Optional[Object]) |
485
|
|
|
|
|
|
|
if ( exists( $in{"x_pkg"} ) ) { |
486
|
|
|
|
|
|
|
( |
487
|
|
|
|
|
|
|
do { |
488
|
|
|
|
|
|
|
|
489
|
|
|
|
|
|
|
use Scalar::Util (); |
490
|
|
|
|
|
|
|
Scalar::Util::blessed( $in{"x_pkg"} ); |
491
|
|
|
|
|
|
|
) |
492
|
|
|
|
|
|
|
or croak( |
493
|
|
|
|
|
|
|
"Type check failed in signature for inject_mite_functions: %s should be %s", |
494
|
|
|
|
|
|
|
"\$_{\"x_pkg\"}", "Optional[Object]" |
495
|
|
|
|
|
|
|
); |
496
|
|
|
|
|
|
|
$out{"x_pkg"} = $in{"x_pkg"}; |
497
|
|
|
|
|
|
|
delete( $in{"x_pkg"} ); |
498
|
|
|
|
|
|
|
} |
499
|
|
|
|
|
|
|
|
500
|
|
|
|
|
|
|
# Unrecognized parameters |
501
|
|
|
|
|
|
|
croak( |
502
|
|
|
|
|
|
|
"Failure in signature for inject_mite_functions: " |
503
|
107
|
|
|
107
|
|
999
|
. sprintf( |
|
107
|
|
|
|
|
405
|
|
|
107
|
|
|
|
|
8281
|
|
504
|
|
|
|
|
|
|
q{Unrecognized parameter%s: %s}, |
505
|
|
|
|
|
|
|
keys(%in) > 1 ? q{s} : q{}, |
506
|
|
|
|
|
|
|
join( q{, }, sort keys %in ) |
507
|
|
|
|
|
|
|
) |
508
|
|
|
|
|
|
|
) if keys %in; |
509
|
|
|
|
|
|
|
|
510
|
|
|
|
|
|
|
do { |
511
|
|
|
|
|
|
|
@_ = ( |
512
|
|
|
|
|
|
|
@head, $out{"package"}, $out{"file"}, $out{"kind"}, |
513
|
|
|
|
|
|
|
$out{"arg"}, $out{"shim"}, $out{"x_source"}, $out{"x_pkg"} |
514
|
|
|
|
|
|
|
); |
515
|
|
|
|
|
|
|
goto $__NEXT__; |
516
|
|
|
|
|
|
|
}; |
517
|
|
|
|
|
|
|
}; |
518
|
|
|
|
|
|
|
|
519
|
|
|
|
|
|
|
$SIGNATURE_FOR{"load_files"} = sub { |
520
|
|
|
|
|
|
|
my $__NEXT__ = shift; |
521
|
107
|
|
|
107
|
|
846
|
|
|
107
|
|
|
|
|
1389
|
|
|
107
|
|
|
|
|
49976
|
|
522
|
|
|
|
|
|
|
my ( %tmp, $tmp, @head ); |
523
|
|
|
|
|
|
|
|
524
|
|
|
|
|
|
|
@_ >= 2 && @_ <= 3 |
525
|
|
|
|
|
|
|
or |
526
|
|
|
|
|
|
|
croak( "Wrong number of parameters in signature for %s: got %d, %s", |
527
|
|
|
|
|
|
|
"load_files", scalar(@_), "expected exactly 2 parameters" ); |
528
|
|
|
|
|
|
|
|
529
|
|
|
|
|
|
|
@head = splice( @_, 0, 1 ); |
530
|
|
|
|
|
|
|
|
531
|
|
|
|
|
|
|
# Parameter invocant (type: Defined) |
532
|
|
|
|
|
|
|
( defined( $head[0] ) ) |
533
|
|
|
|
|
|
|
or croak( |
534
|
|
|
|
|
|
|
"Type check failed in signature for load_files: %s should be %s", |
535
|
|
|
|
|
|
|
"\$_[0]", "Defined" ); |
536
|
|
|
|
|
|
|
|
537
|
|
|
|
|
|
|
# Parameter $_[0] (type: ArrayRef) |
538
|
|
|
|
|
|
|
( ref( $_[0] ) eq 'ARRAY' ) |
539
|
|
|
|
|
|
|
or croak( |
540
|
|
|
|
|
|
|
"Type check failed in signature for load_files: %s should be %s", |
541
|
|
|
|
|
|
|
"\$_[1]", "ArrayRef" ); |
542
|
|
|
|
|
|
|
|
543
|
|
|
|
|
|
|
# Parameter $_[1] (type: Any) |
544
|
|
|
|
|
|
|
$#_ >= 1 |
545
|
|
|
|
|
|
|
or do { @_ = ( @head, @_ ); goto $__NEXT__ }; |
546
|
|
|
|
|
|
|
1; # ... nothing to do |
547
|
|
|
|
|
|
|
|
548
|
|
|
|
|
|
|
do { @_ = ( @head, @_ ); goto $__NEXT__ }; |
549
|
|
|
|
|
|
|
}; |
550
|
|
|
|
|
|
|
|
551
|
|
|
|
|
|
|
1; |