line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
{ |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
package Mite::Source; |
4
|
107
|
|
|
107
|
|
891
|
use strict; |
|
107
|
|
|
|
|
400
|
|
|
107
|
|
|
|
|
17411
|
|
5
|
107
|
|
|
107
|
|
808
|
use warnings; |
|
107
|
|
|
|
|
336
|
|
|
107
|
|
|
|
|
3715
|
|
6
|
107
|
|
|
107
|
|
658
|
no warnings qw( once void ); |
|
107
|
|
|
|
|
315
|
|
|
107
|
|
|
|
|
14121
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $USES_MITE = "Mite::Class"; |
9
|
|
|
|
|
|
|
our $MITE_SHIM = "Mite::Shim"; |
10
|
|
|
|
|
|
|
our $MITE_VERSION = "0.011000"; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
# Mite keywords |
13
|
|
|
|
|
|
|
BEGIN { |
14
|
107
|
|
|
107
|
|
835
|
my ( $SHIM, $CALLER ) = ( "Mite::Shim", "Mite::Source" ); |
15
|
|
|
|
|
|
|
( |
16
|
|
|
|
|
|
|
*after, *around, *before, *extends, *field, |
17
|
|
|
|
|
|
|
*has, *param, *signature_for, *with |
18
|
|
|
|
|
|
|
) |
19
|
107
|
|
|
|
|
331
|
= do { |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
package Mite::Shim; |
22
|
107
|
|
|
107
|
|
863
|
no warnings 'redefine'; |
|
107
|
|
|
|
|
14821
|
|
|
107
|
|
|
|
|
26281
|
|
23
|
|
|
|
|
|
|
( |
24
|
0
|
|
|
0
|
|
0
|
sub { $SHIM->HANDLE_after( $CALLER, "class", @_ ) }, |
25
|
0
|
|
|
0
|
|
0
|
sub { $SHIM->HANDLE_around( $CALLER, "class", @_ ) }, |
26
|
0
|
|
|
0
|
|
0
|
sub { $SHIM->HANDLE_before( $CALLER, "class", @_ ) }, |
27
|
|
|
|
0
|
|
|
sub { }, |
28
|
0
|
|
|
0
|
|
0
|
sub { $SHIM->HANDLE_has( $CALLER, field => @_ ) }, |
29
|
535
|
|
|
535
|
|
127766
|
sub { $SHIM->HANDLE_has( $CALLER, has => @_ ) }, |
30
|
0
|
|
|
0
|
|
0
|
sub { $SHIM->HANDLE_has( $CALLER, param => @_ ) }, |
31
|
0
|
|
|
0
|
|
0
|
sub { $SHIM->HANDLE_signature_for( $CALLER, "class", @_ ) }, |
32
|
0
|
|
|
0
|
|
0
|
sub { $SHIM->HANDLE_with( $CALLER, @_ ) }, |
33
|
107
|
|
|
|
|
21555
|
); |
34
|
|
|
|
|
|
|
}; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
# Mite imports |
38
|
|
|
|
|
|
|
BEGIN { |
39
|
107
|
|
|
107
|
|
898
|
require Scalar::Util; |
40
|
107
|
|
|
|
|
468
|
*STRICT = \&Mite::Shim::STRICT; |
41
|
107
|
|
|
|
|
429
|
*bare = \&Mite::Shim::bare; |
42
|
107
|
|
|
|
|
340
|
*blessed = \&Scalar::Util::blessed; |
43
|
107
|
|
|
|
|
354
|
*carp = \&Mite::Shim::carp; |
44
|
107
|
|
|
|
|
345
|
*confess = \&Mite::Shim::confess; |
45
|
107
|
|
|
|
|
331
|
*croak = \&Mite::Shim::croak; |
46
|
107
|
|
|
|
|
312
|
*false = \&Mite::Shim::false; |
47
|
107
|
|
|
|
|
302
|
*guard = \&Mite::Shim::guard; |
48
|
107
|
|
|
|
|
266
|
*lazy = \&Mite::Shim::lazy; |
49
|
107
|
|
|
|
|
281
|
*lock = \&Mite::Shim::lock; |
50
|
107
|
|
|
|
|
254
|
*ro = \&Mite::Shim::ro; |
51
|
107
|
|
|
|
|
303
|
*rw = \&Mite::Shim::rw; |
52
|
107
|
|
|
|
|
300
|
*rwp = \&Mite::Shim::rwp; |
53
|
107
|
|
|
|
|
277
|
*true = \&Mite::Shim::true; |
54
|
107
|
|
|
|
|
4204
|
*unlock = \&Mite::Shim::unlock; |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
# Gather metadata for constructor and destructor |
58
|
|
|
|
|
|
|
sub __META__ { |
59
|
107
|
|
|
107
|
|
818
|
no strict 'refs'; |
|
107
|
|
|
|
|
368
|
|
|
107
|
|
|
|
|
36068
|
|
60
|
89
|
|
|
89
|
|
354
|
my $class = shift; |
61
|
89
|
|
33
|
|
|
836
|
$class = ref($class) || $class; |
62
|
89
|
|
|
|
|
636
|
my $linear_isa = mro::get_linear_isa($class); |
63
|
|
|
|
|
|
|
return { |
64
|
|
|
|
|
|
|
BUILD => [ |
65
|
89
|
50
|
|
|
|
304
|
map { ( *{$_}{CODE} ) ? ( *{$_}{CODE} ) : () } |
|
89
|
|
|
|
|
1217
|
|
|
0
|
|
|
|
|
0
|
|
66
|
89
|
|
|
|
|
539
|
map { "$_\::BUILD" } reverse @$linear_isa |
67
|
|
|
|
|
|
|
], |
68
|
|
|
|
|
|
|
DEMOLISH => [ |
69
|
89
|
50
|
|
|
|
490
|
map { ( *{$_}{CODE} ) ? ( *{$_}{CODE} ) : () } |
|
89
|
|
|
|
|
2501
|
|
|
0
|
|
|
|
|
0
|
|
70
|
89
|
|
|
|
|
445
|
map { "$_\::DEMOLISH" } @$linear_isa |
|
89
|
|
|
|
|
464
|
|
71
|
|
|
|
|
|
|
], |
72
|
|
|
|
|
|
|
HAS_BUILDARGS => $class->can('BUILDARGS'), |
73
|
|
|
|
|
|
|
HAS_FOREIGNBUILDARGS => $class->can('FOREIGNBUILDARGS'), |
74
|
|
|
|
|
|
|
}; |
75
|
|
|
|
|
|
|
} |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
# Standard Moose/Moo-style constructor |
78
|
|
|
|
|
|
|
sub new { |
79
|
119
|
50
|
|
119
|
0
|
2742
|
my $class = ref( $_[0] ) ? ref(shift) : shift; |
80
|
119
|
|
66
|
|
|
1374
|
my $meta = ( $Mite::META{$class} ||= $class->__META__ ); |
81
|
119
|
|
|
|
|
471
|
my $self = bless {}, $class; |
82
|
|
|
|
|
|
|
my $args = |
83
|
|
|
|
|
|
|
$meta->{HAS_BUILDARGS} |
84
|
|
|
|
|
|
|
? $class->BUILDARGS(@_) |
85
|
119
|
50
|
|
|
|
1175
|
: { ( @_ == 1 ) ? %{ $_[0] } : @_ }; |
|
0
|
50
|
|
|
|
0
|
|
86
|
119
|
|
|
|
|
469
|
my $no_build = delete $args->{__no_BUILD__}; |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
# Attribute file (type: Path) |
89
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Source.pm, line 11 |
90
|
119
|
50
|
|
|
|
857
|
croak "Missing key in constructor: file" unless exists $args->{"file"}; |
91
|
119
|
|
|
|
|
329
|
do { |
92
|
119
|
|
|
|
|
575
|
my $coerced_value = do { |
93
|
119
|
|
|
|
|
367
|
my $to_coerce = $args->{"file"}; |
94
|
|
|
|
|
|
|
( |
95
|
|
|
|
|
|
|
( |
96
|
|
|
|
|
|
|
do { |
97
|
107
|
|
|
107
|
|
930
|
use Scalar::Util (); |
|
107
|
|
|
|
|
286
|
|
|
107
|
|
|
|
|
38471
|
|
98
|
119
|
50
|
|
|
|
2782
|
Scalar::Util::blessed($to_coerce) |
99
|
|
|
|
|
|
|
and $to_coerce->isa(q[Path::Tiny]); |
100
|
|
|
|
|
|
|
} |
101
|
|
|
|
|
|
|
) |
102
|
|
|
|
|
|
|
) ? $to_coerce : ( |
103
|
|
|
|
|
|
|
do { |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
package Mite::Shim; |
106
|
0
|
0
|
|
|
|
0
|
defined($to_coerce) and do { |
107
|
0
|
0
|
|
|
|
0
|
ref( \$to_coerce ) eq 'SCALAR' |
108
|
|
|
|
|
|
|
or ref( \( my $val = $to_coerce ) ) eq 'SCALAR'; |
109
|
|
|
|
|
|
|
} |
110
|
|
|
|
|
|
|
} |
111
|
|
|
|
|
|
|
) |
112
|
|
|
|
|
|
|
? scalar( |
113
|
0
|
|
|
|
|
0
|
do { local $_ = $to_coerce; Path::Tiny::path($_) } |
|
0
|
|
|
|
|
0
|
|
114
|
|
|
|
|
|
|
) |
115
|
|
|
|
|
|
|
: ( |
116
|
|
|
|
|
|
|
do { |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
package Mite::Shim; |
119
|
|
|
|
|
|
|
defined($to_coerce) && !ref($to_coerce) |
120
|
|
|
|
|
|
|
or Scalar::Util::blessed($to_coerce) && ( |
121
|
|
|
|
|
|
|
sub { |
122
|
0
|
|
|
0
|
|
0
|
require overload; |
123
|
0
|
0
|
0
|
|
|
0
|
overload::Overloaded( ref $_[0] or $_[0] ) |
|
|
|
0
|
|
|
|
|
124
|
|
|
|
|
|
|
and overload::Method( ( ref $_[0] or $_[0] ), |
125
|
|
|
|
|
|
|
$_[1] ); |
126
|
|
|
|
|
|
|
} |
127
|
0
|
0
|
0
|
|
|
0
|
)->( $to_coerce, q[""] ); |
|
|
|
0
|
|
|
|
|
128
|
|
|
|
|
|
|
} |
129
|
|
|
|
|
|
|
) |
130
|
|
|
|
|
|
|
? scalar( |
131
|
0
|
|
|
|
|
0
|
do { local $_ = $to_coerce; Path::Tiny::path($_) } |
|
0
|
|
|
|
|
0
|
|
132
|
|
|
|
|
|
|
) |
133
|
|
|
|
|
|
|
: ( ( ref($to_coerce) eq 'ARRAY' ) ) ? scalar( |
134
|
119
|
0
|
|
|
|
321
|
do { local $_ = $to_coerce; Path::Tiny::path(@$_) } |
|
0
|
0
|
|
|
|
0
|
|
|
0
|
0
|
|
|
|
0
|
|
|
|
50
|
|
|
|
|
|
135
|
|
|
|
|
|
|
) |
136
|
|
|
|
|
|
|
: $to_coerce; |
137
|
|
|
|
|
|
|
}; |
138
|
119
|
50
|
33
|
|
|
1501
|
blessed($coerced_value) && $coerced_value->isa("Path::Tiny") |
139
|
|
|
|
|
|
|
or croak "Type check failed in constructor: %s should be %s", |
140
|
|
|
|
|
|
|
"file", "Path"; |
141
|
119
|
|
|
|
|
881
|
$self->{"file"} = $coerced_value; |
142
|
|
|
|
|
|
|
}; |
143
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
# Attribute classes (type: HashRef[Mite::Class]) |
145
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Source.pm, line 20 |
146
|
119
|
|
|
|
|
301
|
do { |
147
|
|
|
|
|
|
|
my $value = |
148
|
|
|
|
|
|
|
exists( $args->{"classes"} ) |
149
|
119
|
50
|
|
|
|
1225
|
? $args->{"classes"} |
150
|
|
|
|
|
|
|
: $Mite::Source::__classes_DEFAULT__->($self); |
151
|
119
|
50
|
|
|
|
267
|
do { |
152
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
package Mite::Shim; |
154
|
119
|
50
|
|
|
|
846
|
( ref($value) eq 'HASH' ) and do { |
155
|
119
|
|
|
|
|
593
|
my $ok = 1; |
156
|
119
|
|
|
|
|
470
|
for my $i ( values %{$value} ) { |
|
119
|
|
|
|
|
580
|
|
157
|
|
|
|
|
|
|
( $ok = 0, last ) |
158
|
|
|
|
|
|
|
unless ( |
159
|
0
|
0
|
|
|
|
0
|
do { |
160
|
107
|
|
|
107
|
|
978
|
use Scalar::Util (); |
|
107
|
|
|
|
|
342
|
|
|
107
|
|
|
|
|
80975
|
|
161
|
0
|
0
|
|
|
|
0
|
Scalar::Util::blessed($i) |
162
|
|
|
|
|
|
|
and $i->isa(q[Mite::Class]); |
163
|
|
|
|
|
|
|
} |
164
|
|
|
|
|
|
|
); |
165
|
|
|
|
|
|
|
}; |
166
|
119
|
|
|
|
|
771
|
$ok; |
167
|
|
|
|
|
|
|
} |
168
|
|
|
|
|
|
|
} |
169
|
|
|
|
|
|
|
or croak "Type check failed in constructor: %s should be %s", |
170
|
|
|
|
|
|
|
"classes", "HashRef[Mite::Class]"; |
171
|
119
|
|
|
|
|
548
|
$self->{"classes"} = $value; |
172
|
|
|
|
|
|
|
}; |
173
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
# Attribute class_order (type: ArrayRef[NonEmptyStr]) |
175
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Source.pm, line 25 |
176
|
119
|
|
|
|
|
342
|
do { |
177
|
|
|
|
|
|
|
my $value = |
178
|
|
|
|
|
|
|
exists( $args->{"class_order"} ) |
179
|
119
|
50
|
|
|
|
1274
|
? $args->{"class_order"} |
180
|
|
|
|
|
|
|
: $Mite::Source::__class_order_DEFAULT__->($self); |
181
|
119
|
50
|
|
|
|
378
|
do { |
182
|
|
|
|
|
|
|
|
183
|
|
|
|
|
|
|
package Mite::Shim; |
184
|
119
|
50
|
|
|
|
917
|
( ref($value) eq 'ARRAY' ) and do { |
185
|
119
|
|
|
|
|
372
|
my $ok = 1; |
186
|
119
|
|
|
|
|
471
|
for my $i ( @{$value} ) { |
|
119
|
|
|
|
|
417
|
|
187
|
|
|
|
|
|
|
( $ok = 0, last ) |
188
|
|
|
|
|
|
|
unless ( |
189
|
|
|
|
|
|
|
( |
190
|
0
|
0
|
0
|
|
|
0
|
do { |
191
|
|
|
|
|
|
|
|
192
|
|
|
|
|
|
|
package Mite::Shim; |
193
|
0
|
0
|
|
|
|
0
|
defined($i) and do { |
194
|
0
|
0
|
|
|
|
0
|
ref( \$i ) eq 'SCALAR' |
195
|
|
|
|
|
|
|
or ref( \( my $val = $i ) ) eq |
196
|
|
|
|
|
|
|
'SCALAR'; |
197
|
|
|
|
|
|
|
} |
198
|
|
|
|
|
|
|
} |
199
|
|
|
|
|
|
|
) |
200
|
|
|
|
|
|
|
&& ( length($i) > 0 ) |
201
|
|
|
|
|
|
|
); |
202
|
|
|
|
|
|
|
}; |
203
|
119
|
|
|
|
|
678
|
$ok; |
204
|
|
|
|
|
|
|
} |
205
|
|
|
|
|
|
|
} |
206
|
|
|
|
|
|
|
or croak "Type check failed in constructor: %s should be %s", |
207
|
|
|
|
|
|
|
"class_order", "ArrayRef[NonEmptyStr]"; |
208
|
119
|
|
|
|
|
448
|
$self->{"class_order"} = $value; |
209
|
|
|
|
|
|
|
}; |
210
|
|
|
|
|
|
|
|
211
|
|
|
|
|
|
|
# Attribute compiled (type: Mite::Compiled) |
212
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Source.pm, line 34 |
213
|
119
|
50
|
|
|
|
568
|
if ( exists $args->{"compiled"} ) { |
214
|
|
|
|
|
|
|
blessed( $args->{"compiled"} ) |
215
|
0
|
0
|
0
|
|
|
0
|
&& $args->{"compiled"}->isa("Mite::Compiled") |
216
|
|
|
|
|
|
|
or croak "Type check failed in constructor: %s should be %s", |
217
|
|
|
|
|
|
|
"compiled", "Mite::Compiled"; |
218
|
0
|
|
|
|
|
0
|
$self->{"compiled"} = $args->{"compiled"}; |
219
|
|
|
|
|
|
|
} |
220
|
|
|
|
|
|
|
|
221
|
|
|
|
|
|
|
# Attribute project (type: Mite::Project) |
222
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Source.pm, line 36 |
223
|
119
|
50
|
|
|
|
575
|
if ( exists $args->{"project"} ) { |
224
|
|
|
|
|
|
|
blessed( $args->{"project"} ) |
225
|
119
|
50
|
33
|
|
|
2051
|
&& $args->{"project"}->isa("Mite::Project") |
226
|
|
|
|
|
|
|
or croak "Type check failed in constructor: %s should be %s", |
227
|
|
|
|
|
|
|
"project", "Mite::Project"; |
228
|
119
|
|
|
|
|
566
|
$self->{"project"} = $args->{"project"}; |
229
|
|
|
|
|
|
|
} |
230
|
|
|
|
|
|
|
require Scalar::Util && Scalar::Util::weaken( $self->{"project"} ) |
231
|
119
|
50
|
33
|
|
|
1920
|
if ref $self->{"project"}; |
232
|
|
|
|
|
|
|
|
233
|
|
|
|
|
|
|
# Call BUILD methods |
234
|
119
|
50
|
33
|
|
|
781
|
$self->BUILDALL($args) if ( !$no_build and @{ $meta->{BUILD} || [] } ); |
|
119
|
50
|
|
|
|
865
|
|
235
|
|
|
|
|
|
|
|
236
|
|
|
|
|
|
|
# Unrecognized parameters |
237
|
|
|
|
|
|
|
my @unknown = |
238
|
|
|
|
|
|
|
grep not(/\A(?:c(?:lass(?:_order|es)|ompiled)|file|project)\z/), |
239
|
119
|
|
|
|
|
392
|
keys %{$args}; |
|
119
|
|
|
|
|
1679
|
|
240
|
|
|
|
|
|
|
@unknown |
241
|
119
|
50
|
|
|
|
571
|
and croak( |
242
|
|
|
|
|
|
|
"Unexpected keys in constructor: " . join( q[, ], sort @unknown ) ); |
243
|
|
|
|
|
|
|
|
244
|
119
|
|
|
|
|
1243
|
return $self; |
245
|
|
|
|
|
|
|
} |
246
|
|
|
|
|
|
|
|
247
|
|
|
|
|
|
|
# Used by constructor to call BUILD methods |
248
|
|
|
|
|
|
|
sub BUILDALL { |
249
|
0
|
|
|
0
|
0
|
0
|
my $class = ref( $_[0] ); |
250
|
0
|
|
0
|
|
|
0
|
my $meta = ( $Mite::META{$class} ||= $class->__META__ ); |
251
|
0
|
0
|
|
|
|
0
|
$_->(@_) for @{ $meta->{BUILD} || [] }; |
|
0
|
|
|
|
|
0
|
|
252
|
|
|
|
|
|
|
} |
253
|
|
|
|
|
|
|
|
254
|
|
|
|
|
|
|
# Destructor should call DEMOLISH methods |
255
|
|
|
|
|
|
|
sub DESTROY { |
256
|
0
|
|
|
0
|
|
0
|
my $self = shift; |
257
|
0
|
|
0
|
|
|
0
|
my $class = ref($self) || $self; |
258
|
0
|
|
0
|
|
|
0
|
my $meta = ( $Mite::META{$class} ||= $class->__META__ ); |
259
|
0
|
0
|
|
|
|
0
|
my $in_global_destruction = |
260
|
|
|
|
|
|
|
defined ${^GLOBAL_PHASE} |
261
|
|
|
|
|
|
|
? ${^GLOBAL_PHASE} eq 'DESTRUCT' |
262
|
|
|
|
|
|
|
: Devel::GlobalDestruction::in_global_destruction(); |
263
|
0
|
0
|
|
|
|
0
|
for my $demolisher ( @{ $meta->{DEMOLISH} || [] } ) { |
|
0
|
|
|
|
|
0
|
|
264
|
0
|
|
|
|
|
0
|
my $e = do { |
265
|
0
|
|
|
|
|
0
|
local ( $?, $@ ); |
266
|
0
|
|
|
|
|
0
|
eval { $demolisher->( $self, $in_global_destruction ) }; |
|
0
|
|
|
|
|
0
|
|
267
|
0
|
|
|
|
|
0
|
$@; |
268
|
|
|
|
|
|
|
}; |
269
|
107
|
|
|
107
|
|
984
|
no warnings 'misc'; # avoid (in cleanup) warnings |
|
107
|
|
|
|
|
380
|
|
|
107
|
|
|
|
|
83364
|
|
270
|
0
|
0
|
|
|
|
0
|
die $e if $e; # rethrow |
271
|
|
|
|
|
|
|
} |
272
|
0
|
|
|
|
|
0
|
return; |
273
|
|
|
|
|
|
|
} |
274
|
|
|
|
|
|
|
|
275
|
|
|
|
|
|
|
my $__XS = !$ENV{PERL_ONLY} |
276
|
|
|
|
|
|
|
&& eval { require Class::XSAccessor; Class::XSAccessor->VERSION("1.19") }; |
277
|
|
|
|
|
|
|
|
278
|
|
|
|
|
|
|
# Accessors for class_order |
279
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Source.pm, line 25 |
280
|
|
|
|
|
|
|
if ($__XS) { |
281
|
|
|
|
|
|
|
Class::XSAccessor->import( |
282
|
|
|
|
|
|
|
chained => 1, |
283
|
|
|
|
|
|
|
"getters" => { "class_order" => "class_order" }, |
284
|
|
|
|
|
|
|
); |
285
|
|
|
|
|
|
|
} |
286
|
|
|
|
|
|
|
else { |
287
|
|
|
|
|
|
|
*class_order = sub { |
288
|
|
|
|
|
|
|
@_ == 1 |
289
|
|
|
|
|
|
|
or croak('Reader "class_order" usage: $self->class_order()'); |
290
|
|
|
|
|
|
|
$_[0]{"class_order"}; |
291
|
|
|
|
|
|
|
}; |
292
|
|
|
|
|
|
|
} |
293
|
|
|
|
|
|
|
|
294
|
|
|
|
|
|
|
# Accessors for classes |
295
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Source.pm, line 20 |
296
|
|
|
|
|
|
|
if ($__XS) { |
297
|
|
|
|
|
|
|
Class::XSAccessor->import( |
298
|
|
|
|
|
|
|
chained => 1, |
299
|
|
|
|
|
|
|
"getters" => { "classes" => "classes" }, |
300
|
|
|
|
|
|
|
); |
301
|
|
|
|
|
|
|
} |
302
|
|
|
|
|
|
|
else { |
303
|
|
|
|
|
|
|
*classes = sub { |
304
|
|
|
|
|
|
|
@_ == 1 or croak('Reader "classes" usage: $self->classes()'); |
305
|
|
|
|
|
|
|
$_[0]{"classes"}; |
306
|
|
|
|
|
|
|
}; |
307
|
|
|
|
|
|
|
} |
308
|
|
|
|
|
|
|
|
309
|
|
|
|
|
|
|
# Accessors for compiled |
310
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Source.pm, line 34 |
311
|
|
|
|
|
|
|
sub compiled { |
312
|
92
|
50
|
|
92
|
0
|
1840
|
@_ == 1 or croak('Reader "compiled" usage: $self->compiled()'); |
313
|
|
|
|
|
|
|
( |
314
|
|
|
|
|
|
|
exists( $_[0]{"compiled"} ) ? $_[0]{"compiled"} : ( |
315
|
92
|
100
|
|
|
|
419
|
$_[0]{"compiled"} = do { |
316
|
91
|
|
|
|
|
613
|
my $default_value = |
317
|
|
|
|
|
|
|
$Mite::Source::__compiled_DEFAULT__->( $_[0] ); |
318
|
91
|
50
|
33
|
|
|
1625
|
blessed($default_value) |
319
|
|
|
|
|
|
|
&& $default_value->isa("Mite::Compiled") |
320
|
|
|
|
|
|
|
or croak( "Type check failed in default: %s should be %s", |
321
|
|
|
|
|
|
|
"compiled", "Mite::Compiled" ); |
322
|
91
|
|
|
|
|
866
|
$default_value; |
323
|
|
|
|
|
|
|
} |
324
|
|
|
|
|
|
|
) |
325
|
|
|
|
|
|
|
); |
326
|
|
|
|
|
|
|
} |
327
|
|
|
|
|
|
|
|
328
|
|
|
|
|
|
|
# Accessors for file |
329
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Source.pm, line 11 |
330
|
|
|
|
|
|
|
if ($__XS) { |
331
|
|
|
|
|
|
|
Class::XSAccessor->import( |
332
|
|
|
|
|
|
|
chained => 1, |
333
|
|
|
|
|
|
|
"getters" => { "file" => "file" }, |
334
|
|
|
|
|
|
|
); |
335
|
|
|
|
|
|
|
} |
336
|
|
|
|
|
|
|
else { |
337
|
|
|
|
|
|
|
*file = sub { |
338
|
|
|
|
|
|
|
@_ == 1 or croak('Reader "file" usage: $self->file()'); |
339
|
|
|
|
|
|
|
$_[0]{"file"}; |
340
|
|
|
|
|
|
|
}; |
341
|
|
|
|
|
|
|
} |
342
|
|
|
|
|
|
|
|
343
|
|
|
|
|
|
|
# Accessors for project |
344
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Source.pm, line 36 |
345
|
|
|
|
|
|
|
sub project { |
346
|
|
|
|
|
|
|
@_ > 1 |
347
|
|
|
|
|
|
|
? do { |
348
|
0
|
0
|
0
|
|
|
|
blessed( $_[1] ) && $_[1]->isa("Mite::Project") |
349
|
|
|
|
|
|
|
or croak( "Type check failed in %s: value should be %s", |
350
|
|
|
|
|
|
|
"accessor", "Mite::Project" ); |
351
|
0
|
|
|
|
|
|
$_[0]{"project"} = $_[1]; |
352
|
|
|
|
|
|
|
require Scalar::Util && Scalar::Util::weaken( $_[0]{"project"} ) |
353
|
0
|
0
|
0
|
|
|
|
if ref $_[0]{"project"}; |
354
|
0
|
|
|
|
|
|
$_[0]; |
355
|
|
|
|
|
|
|
} |
356
|
1319
|
50
|
|
1319
|
0
|
8365
|
: ( $_[0]{"project"} ); |
357
|
|
|
|
|
|
|
} |
358
|
|
|
|
|
|
|
|
359
|
|
|
|
|
|
|
# See UNIVERSAL |
360
|
|
|
|
|
|
|
sub DOES { |
361
|
0
|
|
|
0
|
0
|
|
my ( $self, $role ) = @_; |
362
|
0
|
|
|
|
|
|
our %DOES; |
363
|
0
|
0
|
|
|
|
|
return $DOES{$role} if exists $DOES{$role}; |
364
|
0
|
0
|
|
|
|
|
return 1 if $role eq __PACKAGE__; |
365
|
0
|
0
|
0
|
|
|
|
if ( $INC{'Moose/Util.pm'} |
|
|
|
0
|
|
|
|
|
366
|
|
|
|
|
|
|
and my $meta = Moose::Util::find_meta( ref $self or $self ) ) |
367
|
|
|
|
|
|
|
{ |
368
|
0
|
0
|
0
|
|
|
|
$meta->can('does_role') and $meta->does_role($role) and return 1; |
369
|
|
|
|
|
|
|
} |
370
|
0
|
|
|
|
|
|
return $self->SUPER::DOES($role); |
371
|
|
|
|
|
|
|
} |
372
|
|
|
|
|
|
|
|
373
|
|
|
|
|
|
|
# Alias for Moose/Moo-compatibility |
374
|
|
|
|
|
|
|
sub does { |
375
|
0
|
|
|
0
|
0
|
|
shift->DOES(@_); |
376
|
|
|
|
|
|
|
} |
377
|
|
|
|
|
|
|
|
378
|
|
|
|
|
|
|
1; |
379
|
|
|
|
|
|
|
} |