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