| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
{ |
|
2
|
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
use strict; |
|
4
|
107
|
|
|
107
|
|
951
|
use warnings; |
|
|
107
|
|
|
|
|
333
|
|
|
|
107
|
|
|
|
|
3682
|
|
|
5
|
107
|
|
|
107
|
|
714
|
no warnings qw( once void ); |
|
|
107
|
|
|
|
|
366
|
|
|
|
107
|
|
|
|
|
3727
|
|
|
6
|
107
|
|
|
107
|
|
603
|
|
|
|
107
|
|
|
|
|
327
|
|
|
|
107
|
|
|
|
|
14619
|
|
|
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::Source" ); |
|
14
|
107
|
|
|
107
|
|
595
|
( |
|
15
|
|
|
|
|
|
|
*after, *around, *before, *extends, *field, |
|
16
|
|
|
|
|
|
|
*has, *param, *signature_for, *with |
|
17
|
|
|
|
|
|
|
) |
|
18
|
|
|
|
|
|
|
= do { |
|
19
|
107
|
|
|
|
|
370
|
|
|
20
|
|
|
|
|
|
|
no warnings 'redefine'; |
|
21
|
|
|
|
|
|
|
( |
|
22
|
107
|
|
|
107
|
|
834
|
sub { $SHIM->HANDLE_after( $CALLER, "class", @_ ) }, |
|
|
107
|
|
|
|
|
10765
|
|
|
|
107
|
|
|
|
|
25789
|
|
|
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
|
535
|
|
|
535
|
|
125290
|
sub { $SHIM->HANDLE_signature_for( $CALLER, "class", @_ ) }, |
|
30
|
0
|
|
|
0
|
|
0
|
sub { $SHIM->HANDLE_with( $CALLER, @_ ) }, |
|
31
|
0
|
|
|
0
|
|
0
|
); |
|
32
|
0
|
|
|
0
|
|
0
|
} |
|
33
|
107
|
|
|
|
|
20375
|
|
|
34
|
|
|
|
|
|
|
# Mite imports |
|
35
|
|
|
|
|
|
|
BEGIN { |
|
36
|
|
|
|
|
|
|
require Scalar::Util; |
|
37
|
|
|
|
|
|
|
*STRICT = \&Mite::Shim::STRICT; |
|
38
|
|
|
|
|
|
|
*bare = \&Mite::Shim::bare; |
|
39
|
107
|
|
|
107
|
|
908
|
*blessed = \&Scalar::Util::blessed; |
|
40
|
107
|
|
|
|
|
432
|
*carp = \&Mite::Shim::carp; |
|
41
|
107
|
|
|
|
|
367
|
*confess = \&Mite::Shim::confess; |
|
42
|
107
|
|
|
|
|
445
|
*croak = \&Mite::Shim::croak; |
|
43
|
107
|
|
|
|
|
13877
|
*false = \&Mite::Shim::false; |
|
44
|
107
|
|
|
|
|
307
|
*guard = \&Mite::Shim::guard; |
|
45
|
107
|
|
|
|
|
319
|
*lazy = \&Mite::Shim::lazy; |
|
46
|
107
|
|
|
|
|
271
|
*lock = \&Mite::Shim::lock; |
|
47
|
107
|
|
|
|
|
311
|
*ro = \&Mite::Shim::ro; |
|
48
|
107
|
|
|
|
|
259
|
*rw = \&Mite::Shim::rw; |
|
49
|
107
|
|
|
|
|
319
|
*rwp = \&Mite::Shim::rwp; |
|
50
|
107
|
|
|
|
|
281
|
*true = \&Mite::Shim::true; |
|
51
|
107
|
|
|
|
|
332
|
*unlock = \&Mite::Shim::unlock; |
|
52
|
107
|
|
|
|
|
290
|
} |
|
53
|
107
|
|
|
|
|
256
|
|
|
54
|
107
|
|
|
|
|
3968
|
# 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
|
|
746
|
return { |
|
|
107
|
|
|
|
|
308
|
|
|
|
107
|
|
|
|
|
35783
|
|
|
60
|
89
|
|
|
89
|
|
281
|
BUILD => [ |
|
61
|
89
|
|
33
|
|
|
720
|
map { ( *{$_}{CODE} ) ? ( *{$_}{CODE} ) : () } |
|
62
|
89
|
|
|
|
|
591
|
map { "$_\::BUILD" } reverse @$linear_isa |
|
63
|
|
|
|
|
|
|
], |
|
64
|
|
|
|
|
|
|
DEMOLISH => [ |
|
65
|
89
|
50
|
|
|
|
244
|
map { ( *{$_}{CODE} ) ? ( *{$_}{CODE} ) : () } |
|
|
89
|
|
|
|
|
1102
|
|
|
|
0
|
|
|
|
|
0
|
|
|
66
|
89
|
|
|
|
|
505
|
map { "$_\::DEMOLISH" } @$linear_isa |
|
67
|
|
|
|
|
|
|
], |
|
68
|
|
|
|
|
|
|
HAS_BUILDARGS => $class->can('BUILDARGS'), |
|
69
|
89
|
50
|
|
|
|
205
|
HAS_FOREIGNBUILDARGS => $class->can('FOREIGNBUILDARGS'), |
|
|
89
|
|
|
|
|
2692
|
|
|
|
0
|
|
|
|
|
0
|
|
|
70
|
89
|
|
|
|
|
436
|
}; |
|
|
89
|
|
|
|
|
471
|
|
|
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
|
120
|
50
|
|
120
|
0
|
2559
|
? $class->BUILDARGS(@_) |
|
80
|
120
|
|
66
|
|
|
1212
|
: { ( @_ == 1 ) ? %{ $_[0] } : @_ }; |
|
81
|
120
|
|
|
|
|
464
|
my $no_build = delete $args->{__no_BUILD__}; |
|
82
|
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
# Attribute file (type: Path) |
|
84
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Source.pm, line 11 |
|
85
|
120
|
50
|
|
|
|
1008
|
croak "Missing key in constructor: file" unless exists $args->{"file"}; |
|
|
0
|
50
|
|
|
|
0
|
|
|
86
|
120
|
|
|
|
|
398
|
do { |
|
87
|
|
|
|
|
|
|
my $coerced_value = do { |
|
88
|
|
|
|
|
|
|
my $to_coerce = $args->{"file"}; |
|
89
|
|
|
|
|
|
|
( |
|
90
|
120
|
50
|
|
|
|
565
|
( |
|
91
|
120
|
|
|
|
|
437
|
do { |
|
92
|
120
|
|
|
|
|
272
|
use Scalar::Util (); |
|
93
|
120
|
|
|
|
|
502
|
Scalar::Util::blessed($to_coerce) |
|
94
|
|
|
|
|
|
|
and $to_coerce->isa(q[Path::Tiny]); |
|
95
|
|
|
|
|
|
|
} |
|
96
|
|
|
|
|
|
|
) |
|
97
|
107
|
|
|
107
|
|
880
|
) ? $to_coerce : ( |
|
|
107
|
|
|
|
|
277
|
|
|
|
107
|
|
|
|
|
37204
|
|
|
98
|
120
|
50
|
|
|
|
2602
|
do { |
|
99
|
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
defined($to_coerce) and do { |
|
101
|
|
|
|
|
|
|
ref( \$to_coerce ) eq 'SCALAR' |
|
102
|
|
|
|
|
|
|
or ref( \( my $val = $to_coerce ) ) eq 'SCALAR'; |
|
103
|
|
|
|
|
|
|
} |
|
104
|
|
|
|
|
|
|
) |
|
105
|
|
|
|
|
|
|
? scalar( |
|
106
|
0
|
0
|
|
|
|
0
|
do { local $_ = $to_coerce; Path::Tiny::path($_) } |
|
107
|
0
|
0
|
|
|
|
0
|
) |
|
108
|
|
|
|
|
|
|
: ( |
|
109
|
|
|
|
|
|
|
do { |
|
110
|
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
defined($to_coerce) && !ref($to_coerce) |
|
112
|
|
|
|
|
|
|
or Scalar::Util::blessed($to_coerce) && ( |
|
113
|
0
|
|
|
|
|
0
|
sub { |
|
|
0
|
|
|
|
|
0
|
|
|
114
|
|
|
|
|
|
|
require overload; |
|
115
|
|
|
|
|
|
|
overload::Overloaded( ref $_[0] or $_[0] ) |
|
116
|
|
|
|
|
|
|
and overload::Method( ( ref $_[0] or $_[0] ), |
|
117
|
|
|
|
|
|
|
$_[1] ); |
|
118
|
|
|
|
|
|
|
} |
|
119
|
|
|
|
|
|
|
)->( $to_coerce, q[""] ); |
|
120
|
|
|
|
|
|
|
) |
|
121
|
|
|
|
|
|
|
? scalar( |
|
122
|
0
|
|
|
0
|
|
0
|
do { local $_ = $to_coerce; Path::Tiny::path($_) } |
|
123
|
0
|
0
|
0
|
|
|
0
|
) |
|
|
|
|
0
|
|
|
|
|
|
124
|
|
|
|
|
|
|
: ( ( ref($to_coerce) eq 'ARRAY' ) ) ? scalar( |
|
125
|
|
|
|
|
|
|
do { local $_ = $to_coerce; Path::Tiny::path(@$_) } |
|
126
|
|
|
|
|
|
|
) |
|
127
|
0
|
0
|
0
|
|
|
0
|
: $to_coerce; |
|
|
|
|
0
|
|
|
|
|
|
128
|
|
|
|
|
|
|
}; |
|
129
|
|
|
|
|
|
|
blessed($coerced_value) && $coerced_value->isa("Path::Tiny") |
|
130
|
|
|
|
|
|
|
or croak "Type check failed in constructor: %s should be %s", |
|
131
|
0
|
|
|
|
|
0
|
"file", "Path"; |
|
|
0
|
|
|
|
|
0
|
|
|
132
|
|
|
|
|
|
|
$self->{"file"} = $coerced_value; |
|
133
|
|
|
|
|
|
|
}; |
|
134
|
120
|
0
|
|
|
|
271
|
|
|
|
0
|
0
|
|
|
|
0
|
|
|
|
0
|
0
|
|
|
|
0
|
|
|
|
|
50
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
# Attribute classes (type: HashRef[Mite::Class]) |
|
136
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Source.pm, line 20 |
|
137
|
|
|
|
|
|
|
do { |
|
138
|
120
|
50
|
33
|
|
|
1447
|
my $value = |
|
139
|
|
|
|
|
|
|
exists( $args->{"classes"} ) |
|
140
|
|
|
|
|
|
|
? $args->{"classes"} |
|
141
|
120
|
|
|
|
|
774
|
: $Mite::Source::__classes_DEFAULT__->($self); |
|
142
|
|
|
|
|
|
|
do { |
|
143
|
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
( ref($value) eq 'HASH' ) and do { |
|
145
|
|
|
|
|
|
|
my $ok = 1; |
|
146
|
120
|
|
|
|
|
384
|
for my $i ( values %{$value} ) { |
|
147
|
|
|
|
|
|
|
( $ok = 0, last ) |
|
148
|
|
|
|
|
|
|
unless ( |
|
149
|
120
|
50
|
|
|
|
1346
|
do { |
|
150
|
|
|
|
|
|
|
use Scalar::Util (); |
|
151
|
120
|
50
|
|
|
|
302
|
Scalar::Util::blessed($i) |
|
152
|
|
|
|
|
|
|
and $i->isa(q[Mite::Class]); |
|
153
|
|
|
|
|
|
|
} |
|
154
|
120
|
50
|
|
|
|
787
|
); |
|
155
|
120
|
|
|
|
|
372
|
}; |
|
156
|
120
|
|
|
|
|
646
|
$ok; |
|
|
120
|
|
|
|
|
540
|
|
|
157
|
|
|
|
|
|
|
} |
|
158
|
|
|
|
|
|
|
or croak "Type check failed in constructor: %s should be %s", |
|
159
|
0
|
0
|
|
|
|
0
|
"classes", "HashRef[Mite::Class]"; |
|
160
|
107
|
|
|
107
|
|
993
|
$self->{"classes"} = $value; |
|
|
107
|
|
|
|
|
333
|
|
|
|
107
|
|
|
|
|
76700
|
|
|
161
|
0
|
0
|
|
|
|
0
|
}; |
|
162
|
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
# Attribute class_order (type: ArrayRef[NonEmptyStr]) |
|
164
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Source.pm, line 25 |
|
165
|
|
|
|
|
|
|
do { |
|
166
|
120
|
|
|
|
|
678
|
my $value = |
|
167
|
|
|
|
|
|
|
exists( $args->{"class_order"} ) |
|
168
|
|
|
|
|
|
|
? $args->{"class_order"} |
|
169
|
|
|
|
|
|
|
: $Mite::Source::__class_order_DEFAULT__->($self); |
|
170
|
|
|
|
|
|
|
do { |
|
171
|
120
|
|
|
|
|
470
|
|
|
172
|
|
|
|
|
|
|
( ref($value) eq 'ARRAY' ) and do { |
|
173
|
|
|
|
|
|
|
my $ok = 1; |
|
174
|
|
|
|
|
|
|
for my $i ( @{$value} ) { |
|
175
|
|
|
|
|
|
|
( $ok = 0, last ) |
|
176
|
120
|
|
|
|
|
282
|
unless ( |
|
177
|
|
|
|
|
|
|
( |
|
178
|
|
|
|
|
|
|
do { |
|
179
|
120
|
50
|
|
|
|
862
|
|
|
180
|
|
|
|
|
|
|
defined($i) and do { |
|
181
|
120
|
50
|
|
|
|
262
|
ref( \$i ) eq 'SCALAR' |
|
182
|
|
|
|
|
|
|
or ref( \( my $val = $i ) ) eq |
|
183
|
|
|
|
|
|
|
'SCALAR'; |
|
184
|
120
|
50
|
|
|
|
703
|
} |
|
185
|
120
|
|
|
|
|
323
|
} |
|
186
|
120
|
|
|
|
|
295
|
) |
|
|
120
|
|
|
|
|
515
|
|
|
187
|
|
|
|
|
|
|
&& ( length($i) > 0 ) |
|
188
|
|
|
|
|
|
|
); |
|
189
|
|
|
|
|
|
|
}; |
|
190
|
0
|
0
|
0
|
|
|
0
|
$ok; |
|
191
|
|
|
|
|
|
|
} |
|
192
|
|
|
|
|
|
|
or croak "Type check failed in constructor: %s should be %s", |
|
193
|
0
|
0
|
|
|
|
0
|
"class_order", "ArrayRef[NonEmptyStr]"; |
|
194
|
0
|
0
|
|
|
|
0
|
$self->{"class_order"} = $value; |
|
195
|
|
|
|
|
|
|
}; |
|
196
|
|
|
|
|
|
|
|
|
197
|
|
|
|
|
|
|
# Attribute compiled (type: Mite::Compiled) |
|
198
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Source.pm, line 34 |
|
199
|
|
|
|
|
|
|
if ( exists $args->{"compiled"} ) { |
|
200
|
|
|
|
|
|
|
blessed( $args->{"compiled"} ) |
|
201
|
|
|
|
|
|
|
&& $args->{"compiled"}->isa("Mite::Compiled") |
|
202
|
|
|
|
|
|
|
or croak "Type check failed in constructor: %s should be %s", |
|
203
|
120
|
|
|
|
|
562
|
"compiled", "Mite::Compiled"; |
|
204
|
|
|
|
|
|
|
$self->{"compiled"} = $args->{"compiled"}; |
|
205
|
|
|
|
|
|
|
} |
|
206
|
|
|
|
|
|
|
|
|
207
|
|
|
|
|
|
|
# Attribute project (type: Mite::Project) |
|
208
|
120
|
|
|
|
|
469
|
# has declaration, file lib/Mite/Source.pm, line 36 |
|
209
|
|
|
|
|
|
|
if ( exists $args->{"project"} ) { |
|
210
|
|
|
|
|
|
|
blessed( $args->{"project"} ) |
|
211
|
|
|
|
|
|
|
&& $args->{"project"}->isa("Mite::Project") |
|
212
|
|
|
|
|
|
|
or croak "Type check failed in constructor: %s should be %s", |
|
213
|
120
|
50
|
|
|
|
527
|
"project", "Mite::Project"; |
|
214
|
|
|
|
|
|
|
$self->{"project"} = $args->{"project"}; |
|
215
|
0
|
0
|
0
|
|
|
0
|
} |
|
216
|
|
|
|
|
|
|
require Scalar::Util && Scalar::Util::weaken( $self->{"project"} ) |
|
217
|
|
|
|
|
|
|
if ref $self->{"project"}; |
|
218
|
0
|
|
|
|
|
0
|
|
|
219
|
|
|
|
|
|
|
# Call BUILD methods |
|
220
|
|
|
|
|
|
|
$self->BUILDALL($args) if ( !$no_build and @{ $meta->{BUILD} || [] } ); |
|
221
|
|
|
|
|
|
|
|
|
222
|
|
|
|
|
|
|
# Unrecognized parameters |
|
223
|
120
|
50
|
|
|
|
592
|
my @unknown = |
|
224
|
|
|
|
|
|
|
grep not(/\A(?:c(?:lass(?:_order|es)|ompiled)|file|project)\z/), |
|
225
|
120
|
50
|
33
|
|
|
1842
|
keys %{$args}; |
|
226
|
|
|
|
|
|
|
@unknown |
|
227
|
|
|
|
|
|
|
and croak( |
|
228
|
120
|
|
|
|
|
482
|
"Unexpected keys in constructor: " . join( q[, ], sort @unknown ) ); |
|
229
|
|
|
|
|
|
|
|
|
230
|
|
|
|
|
|
|
return $self; |
|
231
|
120
|
50
|
33
|
|
|
1879
|
} |
|
232
|
|
|
|
|
|
|
|
|
233
|
|
|
|
|
|
|
# Used by constructor to call BUILD methods |
|
234
|
120
|
50
|
33
|
|
|
809
|
my $class = ref( $_[0] ); |
|
|
120
|
50
|
|
|
|
837
|
|
|
235
|
|
|
|
|
|
|
my $meta = ( $Mite::META{$class} ||= $class->__META__ ); |
|
236
|
|
|
|
|
|
|
$_->(@_) for @{ $meta->{BUILD} || [] }; |
|
237
|
|
|
|
|
|
|
} |
|
238
|
|
|
|
|
|
|
|
|
239
|
120
|
|
|
|
|
333
|
# Destructor should call DEMOLISH methods |
|
|
120
|
|
|
|
|
1488
|
|
|
240
|
|
|
|
|
|
|
my $self = shift; |
|
241
|
120
|
50
|
|
|
|
557
|
my $class = ref($self) || $self; |
|
242
|
|
|
|
|
|
|
my $meta = ( $Mite::META{$class} ||= $class->__META__ ); |
|
243
|
|
|
|
|
|
|
my $in_global_destruction = |
|
244
|
120
|
|
|
|
|
1158
|
defined ${^GLOBAL_PHASE} |
|
245
|
|
|
|
|
|
|
? ${^GLOBAL_PHASE} eq 'DESTRUCT' |
|
246
|
|
|
|
|
|
|
: Devel::GlobalDestruction::in_global_destruction(); |
|
247
|
|
|
|
|
|
|
for my $demolisher ( @{ $meta->{DEMOLISH} || [] } ) { |
|
248
|
|
|
|
|
|
|
my $e = do { |
|
249
|
0
|
|
|
0
|
0
|
0
|
local ( $?, $@ ); |
|
250
|
0
|
|
0
|
|
|
0
|
eval { $demolisher->( $self, $in_global_destruction ) }; |
|
251
|
0
|
0
|
|
|
|
0
|
$@; |
|
|
0
|
|
|
|
|
0
|
|
|
252
|
|
|
|
|
|
|
}; |
|
253
|
|
|
|
|
|
|
no warnings 'misc'; # avoid (in cleanup) warnings |
|
254
|
|
|
|
|
|
|
die $e if $e; # rethrow |
|
255
|
|
|
|
|
|
|
} |
|
256
|
0
|
|
|
0
|
|
0
|
return; |
|
257
|
0
|
|
0
|
|
|
0
|
} |
|
258
|
0
|
|
0
|
|
|
0
|
|
|
259
|
0
|
0
|
|
|
|
0
|
my $__XS = !$ENV{PERL_ONLY} |
|
260
|
|
|
|
|
|
|
&& eval { require Class::XSAccessor; Class::XSAccessor->VERSION("1.19") }; |
|
261
|
|
|
|
|
|
|
|
|
262
|
|
|
|
|
|
|
# Accessors for class_order |
|
263
|
0
|
0
|
|
|
|
0
|
# has declaration, file lib/Mite/Source.pm, line 25 |
|
|
0
|
|
|
|
|
0
|
|
|
264
|
0
|
|
|
|
|
0
|
if ($__XS) { |
|
265
|
0
|
|
|
|
|
0
|
Class::XSAccessor->import( |
|
266
|
0
|
|
|
|
|
0
|
chained => 1, |
|
|
0
|
|
|
|
|
0
|
|
|
267
|
0
|
|
|
|
|
0
|
"getters" => { "class_order" => "class_order" }, |
|
268
|
|
|
|
|
|
|
); |
|
269
|
107
|
|
|
107
|
|
927
|
} |
|
|
107
|
|
|
|
|
285
|
|
|
|
107
|
|
|
|
|
78246
|
|
|
270
|
0
|
0
|
|
|
|
0
|
else { |
|
271
|
|
|
|
|
|
|
*class_order = sub { |
|
272
|
0
|
|
|
|
|
0
|
@_ == 1 |
|
273
|
|
|
|
|
|
|
or croak('Reader "class_order" usage: $self->class_order()'); |
|
274
|
|
|
|
|
|
|
$_[0]{"class_order"}; |
|
275
|
|
|
|
|
|
|
}; |
|
276
|
|
|
|
|
|
|
} |
|
277
|
|
|
|
|
|
|
|
|
278
|
|
|
|
|
|
|
# Accessors for classes |
|
279
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Source.pm, line 20 |
|
280
|
|
|
|
|
|
|
if ($__XS) { |
|
281
|
|
|
|
|
|
|
Class::XSAccessor->import( |
|
282
|
|
|
|
|
|
|
chained => 1, |
|
283
|
|
|
|
|
|
|
"getters" => { "classes" => "classes" }, |
|
284
|
|
|
|
|
|
|
); |
|
285
|
|
|
|
|
|
|
} |
|
286
|
|
|
|
|
|
|
else { |
|
287
|
|
|
|
|
|
|
*classes = sub { |
|
288
|
|
|
|
|
|
|
@_ == 1 or croak('Reader "classes" usage: $self->classes()'); |
|
289
|
|
|
|
|
|
|
$_[0]{"classes"}; |
|
290
|
|
|
|
|
|
|
}; |
|
291
|
|
|
|
|
|
|
} |
|
292
|
|
|
|
|
|
|
|
|
293
|
|
|
|
|
|
|
# Accessors for compiled |
|
294
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Source.pm, line 34 |
|
295
|
|
|
|
|
|
|
@_ == 1 or croak('Reader "compiled" usage: $self->compiled()'); |
|
296
|
|
|
|
|
|
|
( |
|
297
|
|
|
|
|
|
|
exists( $_[0]{"compiled"} ) ? $_[0]{"compiled"} : ( |
|
298
|
|
|
|
|
|
|
$_[0]{"compiled"} = do { |
|
299
|
|
|
|
|
|
|
my $default_value = |
|
300
|
|
|
|
|
|
|
$Mite::Source::__compiled_DEFAULT__->( $_[0] ); |
|
301
|
|
|
|
|
|
|
blessed($default_value) |
|
302
|
|
|
|
|
|
|
&& $default_value->isa("Mite::Compiled") |
|
303
|
|
|
|
|
|
|
or croak( "Type check failed in default: %s should be %s", |
|
304
|
|
|
|
|
|
|
"compiled", "Mite::Compiled" ); |
|
305
|
|
|
|
|
|
|
$default_value; |
|
306
|
|
|
|
|
|
|
} |
|
307
|
|
|
|
|
|
|
) |
|
308
|
|
|
|
|
|
|
); |
|
309
|
|
|
|
|
|
|
} |
|
310
|
|
|
|
|
|
|
|
|
311
|
|
|
|
|
|
|
# Accessors for file |
|
312
|
92
|
50
|
|
92
|
0
|
1726
|
# has declaration, file lib/Mite/Source.pm, line 11 |
|
313
|
|
|
|
|
|
|
if ($__XS) { |
|
314
|
|
|
|
|
|
|
Class::XSAccessor->import( |
|
315
|
92
|
100
|
|
|
|
404
|
chained => 1, |
|
316
|
91
|
|
|
|
|
595
|
"getters" => { "file" => "file" }, |
|
317
|
|
|
|
|
|
|
); |
|
318
|
91
|
50
|
33
|
|
|
1419
|
} |
|
319
|
|
|
|
|
|
|
else { |
|
320
|
|
|
|
|
|
|
*file = sub { |
|
321
|
|
|
|
|
|
|
@_ == 1 or croak('Reader "file" usage: $self->file()'); |
|
322
|
91
|
|
|
|
|
836
|
$_[0]{"file"}; |
|
323
|
|
|
|
|
|
|
}; |
|
324
|
|
|
|
|
|
|
} |
|
325
|
|
|
|
|
|
|
|
|
326
|
|
|
|
|
|
|
# Accessors for project |
|
327
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Source.pm, line 36 |
|
328
|
|
|
|
|
|
|
@_ > 1 |
|
329
|
|
|
|
|
|
|
? do { |
|
330
|
|
|
|
|
|
|
blessed( $_[1] ) && $_[1]->isa("Mite::Project") |
|
331
|
|
|
|
|
|
|
or croak( "Type check failed in %s: value should be %s", |
|
332
|
|
|
|
|
|
|
"accessor", "Mite::Project" ); |
|
333
|
|
|
|
|
|
|
$_[0]{"project"} = $_[1]; |
|
334
|
|
|
|
|
|
|
require Scalar::Util && Scalar::Util::weaken( $_[0]{"project"} ) |
|
335
|
|
|
|
|
|
|
if ref $_[0]{"project"}; |
|
336
|
|
|
|
|
|
|
$_[0]; |
|
337
|
|
|
|
|
|
|
} |
|
338
|
|
|
|
|
|
|
: ( $_[0]{"project"} ); |
|
339
|
|
|
|
|
|
|
} |
|
340
|
|
|
|
|
|
|
|
|
341
|
|
|
|
|
|
|
# See UNIVERSAL |
|
342
|
|
|
|
|
|
|
my ( $self, $role ) = @_; |
|
343
|
|
|
|
|
|
|
our %DOES; |
|
344
|
|
|
|
|
|
|
return $DOES{$role} if exists $DOES{$role}; |
|
345
|
|
|
|
|
|
|
return 1 if $role eq __PACKAGE__; |
|
346
|
|
|
|
|
|
|
if ( $INC{'Moose/Util.pm'} |
|
347
|
|
|
|
|
|
|
and my $meta = Moose::Util::find_meta( ref $self or $self ) ) |
|
348
|
0
|
0
|
0
|
|
|
|
{ |
|
349
|
|
|
|
|
|
|
$meta->can('does_role') and $meta->does_role($role) and return 1; |
|
350
|
|
|
|
|
|
|
} |
|
351
|
0
|
|
|
|
|
|
return $self->SUPER::DOES($role); |
|
352
|
|
|
|
|
|
|
} |
|
353
|
0
|
0
|
0
|
|
|
|
|
|
354
|
0
|
|
|
|
|
|
# Alias for Moose/Moo-compatibility |
|
355
|
|
|
|
|
|
|
shift->DOES(@_); |
|
356
|
1320
|
50
|
|
1320
|
0
|
8053
|
} |
|
357
|
|
|
|
|
|
|
|
|
358
|
|
|
|
|
|
|
1; |