line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
{ |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
use strict; |
4
|
107
|
|
|
107
|
|
931
|
use warnings; |
|
107
|
|
|
|
|
294
|
|
|
107
|
|
|
|
|
3579
|
|
5
|
107
|
|
|
107
|
|
13368
|
no warnings qw( once void ); |
|
107
|
|
|
|
|
12021
|
|
|
107
|
|
|
|
|
5083
|
|
6
|
107
|
|
|
107
|
|
1355
|
|
|
107
|
|
|
|
|
253
|
|
|
107
|
|
|
|
|
13181
|
|
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::Compiled" ); |
14
|
107
|
|
|
107
|
|
627
|
( |
15
|
|
|
|
|
|
|
*after, *around, *before, *extends, *field, |
16
|
|
|
|
|
|
|
*has, *param, *signature_for, *with |
17
|
|
|
|
|
|
|
) |
18
|
|
|
|
|
|
|
= do { |
19
|
107
|
|
|
|
|
736
|
|
20
|
|
|
|
|
|
|
no warnings 'redefine'; |
21
|
|
|
|
|
|
|
( |
22
|
107
|
|
|
107
|
|
731
|
sub { $SHIM->HANDLE_after( $CALLER, "class", @_ ) }, |
|
107
|
|
|
|
|
297
|
|
|
107
|
|
|
|
|
24829
|
|
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
|
214
|
|
|
214
|
|
3059
|
sub { $SHIM->HANDLE_signature_for( $CALLER, "class", @_ ) }, |
30
|
0
|
|
|
0
|
|
0
|
sub { $SHIM->HANDLE_with( $CALLER, @_ ) }, |
31
|
107
|
|
|
107
|
|
1287
|
); |
32
|
0
|
|
|
0
|
|
0
|
} |
33
|
107
|
|
|
|
|
20372
|
|
34
|
|
|
|
|
|
|
# Mite imports |
35
|
|
|
|
|
|
|
BEGIN { |
36
|
|
|
|
|
|
|
require Scalar::Util; |
37
|
|
|
|
|
|
|
*STRICT = \&Mite::Shim::STRICT; |
38
|
|
|
|
|
|
|
*bare = \&Mite::Shim::bare; |
39
|
107
|
|
|
107
|
|
831
|
*blessed = \&Scalar::Util::blessed; |
40
|
107
|
|
|
|
|
444
|
*carp = \&Mite::Shim::carp; |
41
|
107
|
|
|
|
|
329
|
*confess = \&Mite::Shim::confess; |
42
|
107
|
|
|
|
|
314
|
*croak = \&Mite::Shim::croak; |
43
|
107
|
|
|
|
|
422
|
*false = \&Mite::Shim::false; |
44
|
107
|
|
|
|
|
295
|
*guard = \&Mite::Shim::guard; |
45
|
107
|
|
|
|
|
270
|
*lazy = \&Mite::Shim::lazy; |
46
|
107
|
|
|
|
|
240
|
*lock = \&Mite::Shim::lock; |
47
|
107
|
|
|
|
|
307
|
*ro = \&Mite::Shim::ro; |
48
|
107
|
|
|
|
|
12816
|
*rw = \&Mite::Shim::rw; |
49
|
107
|
|
|
|
|
332
|
*rwp = \&Mite::Shim::rwp; |
50
|
107
|
|
|
|
|
235
|
*true = \&Mite::Shim::true; |
51
|
107
|
|
|
|
|
331
|
*unlock = \&Mite::Shim::unlock; |
52
|
107
|
|
|
|
|
230
|
} |
53
|
107
|
|
|
|
|
276
|
|
54
|
107
|
|
|
|
|
4375
|
# 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
|
|
760
|
return { |
|
107
|
|
|
|
|
352
|
|
|
107
|
|
|
|
|
34436
|
|
60
|
83
|
|
|
83
|
|
300
|
BUILD => [ |
61
|
83
|
|
33
|
|
|
639
|
map { ( *{$_}{CODE} ) ? ( *{$_}{CODE} ) : () } |
62
|
83
|
|
|
|
|
588
|
map { "$_\::BUILD" } reverse @$linear_isa |
63
|
|
|
|
|
|
|
], |
64
|
|
|
|
|
|
|
DEMOLISH => [ |
65
|
83
|
50
|
|
|
|
225
|
map { ( *{$_}{CODE} ) ? ( *{$_}{CODE} ) : () } |
|
83
|
|
|
|
|
995
|
|
|
0
|
|
|
|
|
0
|
|
66
|
83
|
|
|
|
|
470
|
map { "$_\::DEMOLISH" } @$linear_isa |
67
|
|
|
|
|
|
|
], |
68
|
|
|
|
|
|
|
HAS_BUILDARGS => $class->can('BUILDARGS'), |
69
|
83
|
50
|
|
|
|
222
|
HAS_FOREIGNBUILDARGS => $class->can('FOREIGNBUILDARGS'), |
|
83
|
|
|
|
|
2051
|
|
|
0
|
|
|
|
|
0
|
|
70
|
83
|
|
|
|
|
364
|
}; |
|
83
|
|
|
|
|
410
|
|
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
|
91
|
50
|
|
91
|
0
|
500
|
? $class->BUILDARGS(@_) |
80
|
91
|
|
66
|
|
|
1238
|
: { ( @_ == 1 ) ? %{ $_[0] } : @_ }; |
81
|
91
|
|
|
|
|
383
|
my $no_build = delete $args->{__no_BUILD__}; |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
# Attribute file (type: Path) |
84
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Compiled.pm, line 23 |
85
|
91
|
50
|
|
|
|
805
|
if ( exists $args->{"file"} ) { |
|
0
|
50
|
|
|
|
0
|
|
86
|
91
|
|
|
|
|
307
|
do { |
87
|
|
|
|
|
|
|
my $coerced_value = do { |
88
|
|
|
|
|
|
|
my $to_coerce = $args->{"file"}; |
89
|
|
|
|
|
|
|
( |
90
|
91
|
50
|
|
|
|
413
|
( |
91
|
0
|
|
|
|
|
0
|
do { |
92
|
0
|
|
|
|
|
0
|
use Scalar::Util (); |
93
|
0
|
|
|
|
|
0
|
Scalar::Util::blessed($to_coerce) |
94
|
|
|
|
|
|
|
and $to_coerce->isa(q[Path::Tiny]); |
95
|
|
|
|
|
|
|
} |
96
|
|
|
|
|
|
|
) |
97
|
107
|
|
|
107
|
|
991
|
) ? $to_coerce : ( |
|
107
|
|
|
|
|
262
|
|
|
107
|
|
|
|
|
74724
|
|
98
|
0
|
0
|
|
|
|
0
|
do { |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
defined($to_coerce) and do { |
101
|
|
|
|
|
|
|
ref( \$to_coerce ) eq 'SCALAR' |
102
|
|
|
|
|
|
|
or ref( \( my $val = $to_coerce ) ) eq |
103
|
|
|
|
|
|
|
'SCALAR'; |
104
|
|
|
|
|
|
|
} |
105
|
|
|
|
|
|
|
) |
106
|
0
|
0
|
|
|
|
0
|
? scalar( |
107
|
0
|
0
|
|
|
|
0
|
do { local $_ = $to_coerce; Path::Tiny::path($_) } |
108
|
|
|
|
|
|
|
) |
109
|
|
|
|
|
|
|
: ( |
110
|
|
|
|
|
|
|
do { |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
defined($to_coerce) && !ref($to_coerce) |
113
|
|
|
|
|
|
|
or Scalar::Util::blessed($to_coerce) && ( |
114
|
0
|
|
|
|
|
0
|
sub { |
|
0
|
|
|
|
|
0
|
|
115
|
|
|
|
|
|
|
require overload; |
116
|
|
|
|
|
|
|
overload::Overloaded( ref $_[0] or $_[0] ) |
117
|
|
|
|
|
|
|
and |
118
|
|
|
|
|
|
|
overload::Method( ( ref $_[0] or $_[0] ), |
119
|
|
|
|
|
|
|
$_[1] ); |
120
|
|
|
|
|
|
|
} |
121
|
|
|
|
|
|
|
)->( $to_coerce, q[""] ); |
122
|
|
|
|
|
|
|
) |
123
|
0
|
|
|
0
|
|
0
|
? scalar( |
124
|
0
|
0
|
0
|
|
|
0
|
do { local $_ = $to_coerce; Path::Tiny::path($_) } |
|
|
|
0
|
|
|
|
|
125
|
|
|
|
|
|
|
) |
126
|
|
|
|
|
|
|
: ( ( ref($to_coerce) eq 'ARRAY' ) ) ? scalar( |
127
|
|
|
|
|
|
|
do { local $_ = $to_coerce; Path::Tiny::path(@$_) } |
128
|
|
|
|
|
|
|
) |
129
|
0
|
0
|
0
|
|
|
0
|
: $to_coerce; |
|
|
|
0
|
|
|
|
|
130
|
|
|
|
|
|
|
}; |
131
|
|
|
|
|
|
|
blessed($coerced_value) && $coerced_value->isa("Path::Tiny") |
132
|
|
|
|
|
|
|
or croak "Type check failed in constructor: %s should be %s", |
133
|
0
|
|
|
|
|
0
|
"file", "Path"; |
|
0
|
|
|
|
|
0
|
|
134
|
|
|
|
|
|
|
$self->{"file"} = $coerced_value; |
135
|
|
|
|
|
|
|
}; |
136
|
0
|
0
|
|
|
|
0
|
} |
|
0
|
0
|
|
|
|
0
|
|
|
0
|
0
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
|
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
# Attribute source (type: Mite::Source) |
139
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Compiled.pm, line 25 |
140
|
0
|
0
|
0
|
|
|
0
|
croak "Missing key in constructor: source" |
141
|
|
|
|
|
|
|
unless exists $args->{"source"}; |
142
|
|
|
|
|
|
|
blessed( $args->{"source"} ) && $args->{"source"}->isa("Mite::Source") |
143
|
0
|
|
|
|
|
0
|
or croak "Type check failed in constructor: %s should be %s", |
144
|
|
|
|
|
|
|
"source", "Mite::Source"; |
145
|
|
|
|
|
|
|
$self->{"source"} = $args->{"source"}; |
146
|
|
|
|
|
|
|
require Scalar::Util && Scalar::Util::weaken( $self->{"source"} ) |
147
|
|
|
|
|
|
|
if ref $self->{"source"}; |
148
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
# Call BUILD methods |
150
|
91
|
50
|
|
|
|
477
|
$self->BUILDALL($args) if ( !$no_build and @{ $meta->{BUILD} || [] } ); |
151
|
91
|
50
|
33
|
|
|
1437
|
|
152
|
|
|
|
|
|
|
# Unrecognized parameters |
153
|
|
|
|
|
|
|
my @unknown = grep not(/\A(?:file|source)\z/), keys %{$args}; |
154
|
91
|
|
|
|
|
665
|
@unknown |
155
|
|
|
|
|
|
|
and croak( |
156
|
91
|
50
|
33
|
|
|
1490
|
"Unexpected keys in constructor: " . join( q[, ], sort @unknown ) ); |
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
return $self; |
159
|
91
|
50
|
33
|
|
|
506
|
} |
|
91
|
50
|
|
|
|
760
|
|
160
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
# Used by constructor to call BUILD methods |
162
|
91
|
|
|
|
|
285
|
my $class = ref( $_[0] ); |
|
91
|
|
|
|
|
1076
|
|
163
|
|
|
|
|
|
|
my $meta = ( $Mite::META{$class} ||= $class->__META__ ); |
164
|
91
|
50
|
|
|
|
490
|
$_->(@_) for @{ $meta->{BUILD} || [] }; |
165
|
|
|
|
|
|
|
} |
166
|
|
|
|
|
|
|
|
167
|
91
|
|
|
|
|
513
|
# Destructor should call DEMOLISH methods |
168
|
|
|
|
|
|
|
my $self = shift; |
169
|
|
|
|
|
|
|
my $class = ref($self) || $self; |
170
|
|
|
|
|
|
|
my $meta = ( $Mite::META{$class} ||= $class->__META__ ); |
171
|
|
|
|
|
|
|
my $in_global_destruction = |
172
|
0
|
|
|
0
|
0
|
0
|
defined ${^GLOBAL_PHASE} |
173
|
0
|
|
0
|
|
|
0
|
? ${^GLOBAL_PHASE} eq 'DESTRUCT' |
174
|
0
|
0
|
|
|
|
0
|
: Devel::GlobalDestruction::in_global_destruction(); |
|
0
|
|
|
|
|
0
|
|
175
|
|
|
|
|
|
|
for my $demolisher ( @{ $meta->{DEMOLISH} || [] } ) { |
176
|
|
|
|
|
|
|
my $e = do { |
177
|
|
|
|
|
|
|
local ( $?, $@ ); |
178
|
|
|
|
|
|
|
eval { $demolisher->( $self, $in_global_destruction ) }; |
179
|
0
|
|
|
0
|
|
0
|
$@; |
180
|
0
|
|
0
|
|
|
0
|
}; |
181
|
0
|
|
0
|
|
|
0
|
no warnings 'misc'; # avoid (in cleanup) warnings |
182
|
0
|
0
|
|
|
|
0
|
die $e if $e; # rethrow |
183
|
|
|
|
|
|
|
} |
184
|
|
|
|
|
|
|
return; |
185
|
|
|
|
|
|
|
} |
186
|
0
|
0
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
187
|
0
|
|
|
|
|
0
|
my $__XS = !$ENV{PERL_ONLY} |
188
|
0
|
|
|
|
|
0
|
&& eval { require Class::XSAccessor; Class::XSAccessor->VERSION("1.19") }; |
189
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
190
|
0
|
|
|
|
|
0
|
# Accessors for file |
191
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Compiled.pm, line 23 |
192
|
107
|
|
|
107
|
|
919
|
@_ > 1 |
|
107
|
|
|
|
|
310
|
|
|
107
|
|
|
|
|
15009
|
|
193
|
0
|
0
|
|
|
|
0
|
? do { |
194
|
|
|
|
|
|
|
my $value = do { |
195
|
0
|
|
|
|
|
0
|
my $to_coerce = $_[1]; |
196
|
|
|
|
|
|
|
( |
197
|
|
|
|
|
|
|
( |
198
|
|
|
|
|
|
|
do { |
199
|
|
|
|
|
|
|
use Scalar::Util (); |
200
|
|
|
|
|
|
|
Scalar::Util::blessed($to_coerce) |
201
|
|
|
|
|
|
|
and $to_coerce->isa(q[Path::Tiny]); |
202
|
|
|
|
|
|
|
} |
203
|
|
|
|
|
|
|
) |
204
|
|
|
|
|
|
|
) ? $to_coerce : ( |
205
|
|
|
|
|
|
|
do { |
206
|
0
|
|
|
|
|
0
|
|
207
|
0
|
|
|
|
|
0
|
defined($to_coerce) and do { |
208
|
|
|
|
|
|
|
ref( \$to_coerce ) eq 'SCALAR' |
209
|
|
|
|
|
|
|
or ref( \( my $val = $to_coerce ) ) eq 'SCALAR'; |
210
|
|
|
|
|
|
|
} |
211
|
107
|
|
|
107
|
|
885
|
) |
|
107
|
|
|
|
|
415
|
|
|
107
|
|
|
|
|
36449
|
|
212
|
0
|
0
|
|
|
|
0
|
? scalar( |
213
|
|
|
|
|
|
|
do { local $_ = $to_coerce; Path::Tiny::path($_) } |
214
|
|
|
|
|
|
|
) |
215
|
|
|
|
|
|
|
: ( |
216
|
|
|
|
|
|
|
do { |
217
|
|
|
|
|
|
|
|
218
|
|
|
|
|
|
|
defined($to_coerce) && !ref($to_coerce) |
219
|
|
|
|
|
|
|
or Scalar::Util::blessed($to_coerce) && ( |
220
|
0
|
0
|
|
|
|
0
|
sub { |
221
|
0
|
0
|
|
|
|
0
|
require overload; |
222
|
|
|
|
|
|
|
overload::Overloaded( ref $_[0] or $_[0] ) |
223
|
|
|
|
|
|
|
and overload::Method( ( ref $_[0] or $_[0] ), |
224
|
|
|
|
|
|
|
$_[1] ); |
225
|
|
|
|
|
|
|
} |
226
|
|
|
|
|
|
|
)->( $to_coerce, q[""] ); |
227
|
0
|
|
|
|
|
0
|
) |
|
0
|
|
|
|
|
0
|
|
228
|
|
|
|
|
|
|
? scalar( |
229
|
|
|
|
|
|
|
do { local $_ = $to_coerce; Path::Tiny::path($_) } |
230
|
|
|
|
|
|
|
) |
231
|
|
|
|
|
|
|
: ( ( ref($to_coerce) eq 'ARRAY' ) ) ? scalar( |
232
|
|
|
|
|
|
|
do { local $_ = $to_coerce; Path::Tiny::path(@$_) } |
233
|
|
|
|
|
|
|
) |
234
|
|
|
|
|
|
|
: $to_coerce; |
235
|
|
|
|
|
|
|
}; |
236
|
0
|
|
|
0
|
|
0
|
blessed($value) && $value->isa("Path::Tiny") |
237
|
0
|
0
|
0
|
|
|
0
|
or croak( "Type check failed in %s: value should be %s", |
|
|
|
0
|
|
|
|
|
238
|
|
|
|
|
|
|
"accessor", "Path" ); |
239
|
|
|
|
|
|
|
$_[0]{"file"} = $value; |
240
|
|
|
|
|
|
|
$_[0]; |
241
|
0
|
0
|
0
|
|
|
0
|
} |
|
|
|
0
|
|
|
|
|
242
|
|
|
|
|
|
|
: do { |
243
|
|
|
|
|
|
|
( |
244
|
|
|
|
|
|
|
exists( $_[0]{"file"} ) ? $_[0]{"file"} : ( |
245
|
0
|
|
|
|
|
0
|
$_[0]{"file"} = do { |
|
0
|
|
|
|
|
0
|
|
246
|
|
|
|
|
|
|
my $default_value = do { |
247
|
|
|
|
|
|
|
my $to_coerce = |
248
|
0
|
0
|
|
|
|
0
|
$Mite::Compiled::__file_DEFAULT__->( |
|
0
|
0
|
|
|
|
0
|
|
|
0
|
0
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
|
249
|
|
|
|
|
|
|
$_[0] ); |
250
|
|
|
|
|
|
|
( |
251
|
|
|
|
|
|
|
( |
252
|
0
|
0
|
0
|
|
|
0
|
do { |
253
|
|
|
|
|
|
|
use Scalar::Util (); |
254
|
|
|
|
|
|
|
Scalar::Util::blessed($to_coerce) |
255
|
0
|
|
|
|
|
0
|
and $to_coerce->isa(q[Path::Tiny]); |
256
|
0
|
|
|
|
|
0
|
} |
257
|
|
|
|
|
|
|
) |
258
|
92
|
50
|
|
92
|
0
|
5634
|
) ? $to_coerce : ( |
259
|
|
|
|
|
|
|
do { |
260
|
|
|
|
|
|
|
|
261
|
92
|
100
|
|
|
|
407
|
defined($to_coerce) and do { |
262
|
89
|
|
|
|
|
203
|
ref( \$to_coerce ) eq 'SCALAR' |
263
|
89
|
|
|
|
|
469
|
or ref( \( my $val = $to_coerce ) ) |
264
|
|
|
|
|
|
|
eq 'SCALAR'; |
265
|
|
|
|
|
|
|
} |
266
|
|
|
|
|
|
|
) |
267
|
|
|
|
|
|
|
? scalar( |
268
|
|
|
|
|
|
|
do { |
269
|
107
|
|
|
107
|
|
1111
|
local $_ = $to_coerce; |
|
107
|
|
|
|
|
325
|
|
|
107
|
|
|
|
|
81744
|
|
270
|
89
|
50
|
|
|
|
699
|
Path::Tiny::path($_); |
271
|
|
|
|
|
|
|
} |
272
|
|
|
|
|
|
|
) |
273
|
|
|
|
|
|
|
: ( |
274
|
|
|
|
|
|
|
do { |
275
|
|
|
|
|
|
|
|
276
|
|
|
|
|
|
|
defined($to_coerce) && !ref($to_coerce) |
277
|
|
|
|
|
|
|
or Scalar::Util::blessed($to_coerce) && ( |
278
|
89
|
50
|
|
|
|
548
|
sub { |
279
|
89
|
50
|
|
|
|
804
|
require overload; |
280
|
|
|
|
|
|
|
overload::Overloaded( |
281
|
|
|
|
|
|
|
ref $_[0] |
282
|
|
|
|
|
|
|
or $_[0] |
283
|
|
|
|
|
|
|
) |
284
|
|
|
|
|
|
|
and overload::Method( |
285
|
|
|
|
|
|
|
( ref $_[0] or $_[0] ), $_[1] ); |
286
|
|
|
|
|
|
|
} |
287
|
89
|
|
|
|
|
255
|
)->( $to_coerce, q[""] ); |
288
|
89
|
|
|
|
|
367
|
) |
289
|
|
|
|
|
|
|
? scalar( |
290
|
|
|
|
|
|
|
do { |
291
|
|
|
|
|
|
|
local $_ = $to_coerce; |
292
|
|
|
|
|
|
|
Path::Tiny::path($_); |
293
|
|
|
|
|
|
|
} |
294
|
|
|
|
|
|
|
) |
295
|
|
|
|
|
|
|
: ( ( ref($to_coerce) eq 'ARRAY' ) ) ? scalar( |
296
|
|
|
|
|
|
|
do { |
297
|
|
|
|
|
|
|
local $_ = $to_coerce; |
298
|
0
|
|
|
0
|
|
0
|
Path::Tiny::path(@$_); |
299
|
0
|
0
|
0
|
|
|
0
|
} |
|
|
|
0
|
|
|
|
|
300
|
|
|
|
|
|
|
) |
301
|
|
|
|
|
|
|
: $to_coerce; |
302
|
|
|
|
|
|
|
}; |
303
|
|
|
|
|
|
|
blessed($default_value) |
304
|
|
|
|
|
|
|
&& $default_value->isa("Path::Tiny") |
305
|
|
|
|
|
|
|
or croak( |
306
|
0
|
0
|
0
|
|
|
0
|
"Type check failed in default: %s should be %s", |
|
|
|
0
|
|
|
|
|
307
|
|
|
|
|
|
|
"file", "Path" ); |
308
|
|
|
|
|
|
|
$default_value; |
309
|
|
|
|
|
|
|
} |
310
|
|
|
|
|
|
|
) |
311
|
0
|
|
|
|
|
0
|
) |
312
|
0
|
|
|
|
|
0
|
} |
313
|
|
|
|
|
|
|
} |
314
|
|
|
|
|
|
|
|
315
|
|
|
|
|
|
|
# Accessors for source |
316
|
89
|
0
|
|
|
|
858
|
# has declaration, file lib/Mite/Compiled.pm, line 25 |
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
317
|
0
|
|
|
|
|
0
|
if ($__XS) { |
318
|
0
|
|
|
|
|
0
|
Class::XSAccessor->import( |
319
|
|
|
|
|
|
|
chained => 1, |
320
|
|
|
|
|
|
|
"getters" => { "source" => "source" }, |
321
|
|
|
|
|
|
|
); |
322
|
|
|
|
|
|
|
} |
323
|
89
|
50
|
33
|
|
|
4614
|
else { |
324
|
|
|
|
|
|
|
*source = sub { |
325
|
|
|
|
|
|
|
@_ == 1 or croak('Reader "source" usage: $self->source()'); |
326
|
|
|
|
|
|
|
$_[0]{"source"}; |
327
|
|
|
|
|
|
|
}; |
328
|
89
|
|
|
|
|
1112
|
} |
329
|
|
|
|
|
|
|
|
330
|
|
|
|
|
|
|
my $object = do { $_[0]{"source"} }; |
331
|
|
|
|
|
|
|
blessed($object) or croak("source is not a blessed object"); |
332
|
|
|
|
|
|
|
$object; |
333
|
|
|
|
|
|
|
} |
334
|
|
|
|
|
|
|
|
335
|
|
|
|
|
|
|
# Delegated methods for source |
336
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Compiled.pm, line 25 |
337
|
|
|
|
|
|
|
|
338
|
|
|
|
|
|
|
# See UNIVERSAL |
339
|
|
|
|
|
|
|
my ( $self, $role ) = @_; |
340
|
|
|
|
|
|
|
our %DOES; |
341
|
|
|
|
|
|
|
return $DOES{$role} if exists $DOES{$role}; |
342
|
|
|
|
|
|
|
return 1 if $role eq __PACKAGE__; |
343
|
|
|
|
|
|
|
if ( $INC{'Moose/Util.pm'} |
344
|
|
|
|
|
|
|
and my $meta = Moose::Util::find_meta( ref $self or $self ) ) |
345
|
|
|
|
|
|
|
{ |
346
|
|
|
|
|
|
|
$meta->can('does_role') and $meta->does_role($role) and return 1; |
347
|
|
|
|
|
|
|
} |
348
|
|
|
|
|
|
|
return $self->SUPER::DOES($role); |
349
|
|
|
|
|
|
|
} |
350
|
|
|
|
|
|
|
|
351
|
211
|
|
|
211
|
|
386
|
# Alias for Moose/Moo-compatibility |
|
211
|
|
|
|
|
507
|
|
352
|
211
|
50
|
|
|
|
968
|
shift->DOES(@_); |
353
|
211
|
|
|
|
|
1528
|
} |
354
|
|
|
|
|
|
|
|
355
|
|
|
|
|
|
|
# Method signatures |
356
|
|
|
|
|
|
|
our %SIGNATURE_FOR; |
357
|
|
|
|
|
|
|
|
358
|
88
|
|
|
88
|
0
|
476
|
$SIGNATURE_FOR{"_source_file2compiled_file"} = sub { |
359
|
123
|
|
|
123
|
0
|
483
|
my $__NEXT__ = shift; |
360
|
|
|
|
|
|
|
|
361
|
|
|
|
|
|
|
my ( %tmp, $tmp, @head ); |
362
|
|
|
|
|
|
|
|
363
|
0
|
|
|
0
|
0
|
|
@_ == 2 |
364
|
0
|
|
|
|
|
|
or croak( |
365
|
0
|
0
|
|
|
|
|
"Wrong number of parameters in signature for %s: got %d, %s", |
366
|
0
|
0
|
|
|
|
|
"_source_file2compiled_file", |
367
|
0
|
0
|
0
|
|
|
|
scalar(@_), |
|
|
|
0
|
|
|
|
|
368
|
|
|
|
|
|
|
"expected exactly 2 parameters" |
369
|
|
|
|
|
|
|
); |
370
|
0
|
0
|
0
|
|
|
|
|
371
|
|
|
|
|
|
|
@head = splice( @_, 0, 1 ); |
372
|
0
|
|
|
|
|
|
|
373
|
|
|
|
|
|
|
# Parameter invocant (type: Defined) |
374
|
|
|
|
|
|
|
( defined( $head[0] ) ) |
375
|
|
|
|
|
|
|
or croak( |
376
|
|
|
|
|
|
|
"Type check failed in signature for _source_file2compiled_file: %s should be %s", |
377
|
0
|
|
|
0
|
0
|
|
"\$_[0]", "Defined" |
378
|
|
|
|
|
|
|
); |
379
|
|
|
|
|
|
|
|
380
|
|
|
|
|
|
|
# Parameter $_[0] (type: Defined) |
381
|
|
|
|
|
|
|
( defined( $_[0] ) ) |
382
|
|
|
|
|
|
|
or croak( |
383
|
|
|
|
|
|
|
"Type check failed in signature for _source_file2compiled_file: %s should be %s", |
384
|
|
|
|
|
|
|
"\$_[1]", "Defined" |
385
|
|
|
|
|
|
|
); |
386
|
|
|
|
|
|
|
|
387
|
|
|
|
|
|
|
do { @_ = ( @head, @_ ); goto $__NEXT__ }; |
388
|
|
|
|
|
|
|
}; |
389
|
|
|
|
|
|
|
|
390
|
|
|
|
|
|
|
1; |