line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
{ |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
use strict; |
4
|
106
|
|
|
106
|
|
752
|
use warnings; |
|
106
|
|
|
|
|
292
|
|
|
106
|
|
|
|
|
3135
|
|
5
|
106
|
|
|
106
|
|
655
|
no warnings qw( once void ); |
|
106
|
|
|
|
|
242
|
|
|
106
|
|
|
|
|
3314
|
|
6
|
106
|
|
|
106
|
|
555
|
|
|
106
|
|
|
|
|
225
|
|
|
106
|
|
|
|
|
27367
|
|
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::Source" ); |
14
|
106
|
|
|
106
|
|
576
|
( |
15
|
|
|
|
|
|
|
*after, *around, *before, *extends, *field, |
16
|
|
|
|
|
|
|
*has, *param, *signature_for, *with |
17
|
|
|
|
|
|
|
) |
18
|
|
|
|
|
|
|
= do { |
19
|
106
|
|
|
|
|
308
|
|
20
|
|
|
|
|
|
|
no warnings 'redefine'; |
21
|
|
|
|
|
|
|
( |
22
|
106
|
|
|
106
|
|
700
|
sub { $SHIM->HANDLE_after( $CALLER, "class", @_ ) }, |
|
106
|
|
|
|
|
344
|
|
|
106
|
|
|
|
|
22083
|
|
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
|
530
|
|
|
530
|
|
94440
|
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
|
106
|
|
|
|
|
16927
|
|
34
|
|
|
|
|
|
|
# Mite imports |
35
|
|
|
|
|
|
|
BEGIN { |
36
|
|
|
|
|
|
|
require Scalar::Util; |
37
|
|
|
|
|
|
|
*STRICT = \&Mite::Shim::STRICT; |
38
|
|
|
|
|
|
|
*bare = \&Mite::Shim::bare; |
39
|
106
|
|
|
106
|
|
766
|
*blessed = \&Scalar::Util::blessed; |
40
|
106
|
|
|
|
|
456
|
*carp = \&Mite::Shim::carp; |
41
|
106
|
|
|
|
|
258
|
*confess = \&Mite::Shim::confess; |
42
|
106
|
|
|
|
|
238
|
*croak = \&Mite::Shim::croak; |
43
|
106
|
|
|
|
|
259
|
*false = \&Mite::Shim::false; |
44
|
106
|
|
|
|
|
312
|
*guard = \&Mite::Shim::guard; |
45
|
106
|
|
|
|
|
301
|
*lazy = \&Mite::Shim::lazy; |
46
|
106
|
|
|
|
|
237
|
*ro = \&Mite::Shim::ro; |
47
|
106
|
|
|
|
|
292
|
*rw = \&Mite::Shim::rw; |
48
|
106
|
|
|
|
|
262
|
*rwp = \&Mite::Shim::rwp; |
49
|
106
|
|
|
|
|
241
|
*true = \&Mite::Shim::true; |
50
|
106
|
|
|
|
|
203
|
} |
51
|
106
|
|
|
|
|
260
|
|
52
|
106
|
|
|
|
|
3648
|
# 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
|
|
626
|
return { |
|
106
|
|
|
|
|
282
|
|
|
106
|
|
|
|
|
30253
|
|
58
|
88
|
|
|
88
|
|
270
|
BUILD => [ |
59
|
88
|
|
33
|
|
|
664
|
map { ( *{$_}{CODE} ) ? ( *{$_}{CODE} ) : () } |
60
|
88
|
|
|
|
|
519
|
map { "$_\::BUILD" } reverse @$linear_isa |
61
|
|
|
|
|
|
|
], |
62
|
|
|
|
|
|
|
DEMOLISH => [ |
63
|
88
|
50
|
|
|
|
192
|
map { ( *{$_}{CODE} ) ? ( *{$_}{CODE} ) : () } |
|
88
|
|
|
|
|
1034
|
|
|
0
|
|
|
|
|
0
|
|
64
|
88
|
|
|
|
|
396
|
map { "$_\::DEMOLISH" } @$linear_isa |
65
|
|
|
|
|
|
|
], |
66
|
|
|
|
|
|
|
HAS_BUILDARGS => $class->can('BUILDARGS'), |
67
|
88
|
50
|
|
|
|
184
|
HAS_FOREIGNBUILDARGS => $class->can('FOREIGNBUILDARGS'), |
|
88
|
|
|
|
|
2008
|
|
|
0
|
|
|
|
|
0
|
|
68
|
88
|
|
|
|
|
373
|
}; |
|
88
|
|
|
|
|
353
|
|
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
|
128
|
50
|
|
128
|
0
|
2292
|
? $class->BUILDARGS(@_) |
78
|
128
|
|
66
|
|
|
1169
|
: { ( @_ == 1 ) ? %{ $_[0] } : @_ }; |
79
|
128
|
|
|
|
|
427
|
my $no_build = delete $args->{__no_BUILD__}; |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
# Attribute file (type: Path) |
82
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Source.pm, line 11 |
83
|
128
|
50
|
|
|
|
1159
|
croak "Missing key in constructor: file" unless exists $args->{"file"}; |
|
0
|
50
|
|
|
|
0
|
|
84
|
128
|
|
|
|
|
364
|
do { |
85
|
|
|
|
|
|
|
my $coerced_value = do { |
86
|
|
|
|
|
|
|
my $to_coerce = $args->{"file"}; |
87
|
|
|
|
|
|
|
( |
88
|
128
|
50
|
|
|
|
496
|
( |
89
|
128
|
|
|
|
|
426
|
do { |
90
|
128
|
|
|
|
|
231
|
use Scalar::Util (); |
91
|
128
|
|
|
|
|
293
|
Scalar::Util::blessed($to_coerce) |
92
|
|
|
|
|
|
|
and $to_coerce->isa(q[Path::Tiny]); |
93
|
|
|
|
|
|
|
} |
94
|
|
|
|
|
|
|
) |
95
|
106
|
|
|
106
|
|
786
|
) ? $to_coerce : ( |
|
106
|
|
|
|
|
227
|
|
|
106
|
|
|
|
|
32280
|
|
96
|
128
|
50
|
|
|
|
2519
|
do { |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
defined($to_coerce) and do { |
99
|
|
|
|
|
|
|
ref( \$to_coerce ) eq 'SCALAR' |
100
|
|
|
|
|
|
|
or ref( \( my $val = $to_coerce ) ) eq 'SCALAR'; |
101
|
|
|
|
|
|
|
} |
102
|
|
|
|
|
|
|
) |
103
|
|
|
|
|
|
|
? scalar( |
104
|
0
|
0
|
|
|
|
0
|
do { local $_ = $to_coerce; Path::Tiny::path($_) } |
105
|
0
|
0
|
|
|
|
0
|
) |
106
|
|
|
|
|
|
|
: ( |
107
|
|
|
|
|
|
|
do { |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
defined($to_coerce) && !ref($to_coerce) |
110
|
|
|
|
|
|
|
or Scalar::Util::blessed($to_coerce) && ( |
111
|
0
|
|
|
|
|
0
|
sub { |
|
0
|
|
|
|
|
0
|
|
112
|
|
|
|
|
|
|
require overload; |
113
|
|
|
|
|
|
|
overload::Overloaded( ref $_[0] or $_[0] ) |
114
|
|
|
|
|
|
|
and overload::Method( ( ref $_[0] or $_[0] ), |
115
|
|
|
|
|
|
|
$_[1] ); |
116
|
|
|
|
|
|
|
} |
117
|
|
|
|
|
|
|
)->( $to_coerce, q[""] ); |
118
|
|
|
|
|
|
|
) |
119
|
|
|
|
|
|
|
? scalar( |
120
|
0
|
|
|
0
|
|
0
|
do { local $_ = $to_coerce; Path::Tiny::path($_) } |
121
|
0
|
0
|
0
|
|
|
0
|
) |
|
|
|
0
|
|
|
|
|
122
|
|
|
|
|
|
|
: ( ( ref($to_coerce) eq 'ARRAY' ) ) ? scalar( |
123
|
|
|
|
|
|
|
do { local $_ = $to_coerce; Path::Tiny::path(@$_) } |
124
|
|
|
|
|
|
|
) |
125
|
0
|
0
|
0
|
|
|
0
|
: $to_coerce; |
|
|
|
0
|
|
|
|
|
126
|
|
|
|
|
|
|
}; |
127
|
|
|
|
|
|
|
blessed($coerced_value) && $coerced_value->isa("Path::Tiny") |
128
|
|
|
|
|
|
|
or croak "Type check failed in constructor: %s should be %s", |
129
|
0
|
|
|
|
|
0
|
"file", "Path"; |
|
0
|
|
|
|
|
0
|
|
130
|
|
|
|
|
|
|
$self->{"file"} = $coerced_value; |
131
|
|
|
|
|
|
|
}; |
132
|
128
|
0
|
|
|
|
372
|
|
|
0
|
0
|
|
|
|
0
|
|
|
0
|
0
|
|
|
|
0
|
|
|
|
50
|
|
|
|
|
|
133
|
|
|
|
|
|
|
# Attribute classes (type: HashRef[Mite::Class]) |
134
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Source.pm, line 20 |
135
|
|
|
|
|
|
|
do { |
136
|
128
|
50
|
33
|
|
|
1304
|
my $value = |
137
|
|
|
|
|
|
|
exists( $args->{"classes"} ) |
138
|
|
|
|
|
|
|
? $args->{"classes"} |
139
|
128
|
|
|
|
|
658
|
: $Mite::Source::__classes_DEFAULT__->($self); |
140
|
|
|
|
|
|
|
do { |
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
( ref($value) eq 'HASH' ) and do { |
143
|
|
|
|
|
|
|
my $ok = 1; |
144
|
128
|
|
|
|
|
280
|
for my $i ( values %{$value} ) { |
145
|
|
|
|
|
|
|
( $ok = 0, last ) |
146
|
|
|
|
|
|
|
unless ( |
147
|
128
|
50
|
|
|
|
858
|
do { |
148
|
|
|
|
|
|
|
use Scalar::Util (); |
149
|
128
|
50
|
|
|
|
511
|
Scalar::Util::blessed($i) |
150
|
|
|
|
|
|
|
and $i->isa(q[Mite::Class]); |
151
|
|
|
|
|
|
|
} |
152
|
128
|
50
|
|
|
|
797
|
); |
153
|
128
|
|
|
|
|
281
|
}; |
154
|
128
|
|
|
|
|
241
|
$ok; |
|
128
|
|
|
|
|
591
|
|
155
|
|
|
|
|
|
|
} |
156
|
|
|
|
|
|
|
or croak "Type check failed in constructor: %s should be %s", |
157
|
0
|
0
|
|
|
|
0
|
"classes", "HashRef[Mite::Class]"; |
158
|
106
|
|
|
106
|
|
718
|
$self->{"classes"} = $value; |
|
106
|
|
|
|
|
226
|
|
|
106
|
|
|
|
|
77670
|
|
159
|
0
|
0
|
|
|
|
0
|
}; |
160
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
# Attribute class_order (type: ArrayRef[NonEmptyStr]) |
162
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Source.pm, line 25 |
163
|
|
|
|
|
|
|
do { |
164
|
128
|
|
|
|
|
702
|
my $value = |
165
|
|
|
|
|
|
|
exists( $args->{"class_order"} ) |
166
|
|
|
|
|
|
|
? $args->{"class_order"} |
167
|
|
|
|
|
|
|
: $Mite::Source::__class_order_DEFAULT__->($self); |
168
|
|
|
|
|
|
|
do { |
169
|
128
|
|
|
|
|
544
|
|
170
|
|
|
|
|
|
|
( ref($value) eq 'ARRAY' ) and do { |
171
|
|
|
|
|
|
|
my $ok = 1; |
172
|
|
|
|
|
|
|
for my $i ( @{$value} ) { |
173
|
|
|
|
|
|
|
( $ok = 0, last ) |
174
|
128
|
|
|
|
|
253
|
unless ( |
175
|
|
|
|
|
|
|
( |
176
|
|
|
|
|
|
|
do { |
177
|
128
|
50
|
|
|
|
686
|
|
178
|
|
|
|
|
|
|
defined($i) and do { |
179
|
128
|
50
|
|
|
|
234
|
ref( \$i ) eq 'SCALAR' |
180
|
|
|
|
|
|
|
or ref( \( my $val = $i ) ) eq |
181
|
|
|
|
|
|
|
'SCALAR'; |
182
|
128
|
50
|
|
|
|
820
|
} |
183
|
128
|
|
|
|
|
246
|
} |
184
|
128
|
|
|
|
|
232
|
) |
|
128
|
|
|
|
|
362
|
|
185
|
|
|
|
|
|
|
&& ( length($i) > 0 ) |
186
|
|
|
|
|
|
|
); |
187
|
|
|
|
|
|
|
}; |
188
|
0
|
0
|
0
|
|
|
0
|
$ok; |
189
|
|
|
|
|
|
|
} |
190
|
|
|
|
|
|
|
or croak "Type check failed in constructor: %s should be %s", |
191
|
0
|
0
|
|
|
|
0
|
"class_order", "ArrayRef[NonEmptyStr]"; |
192
|
0
|
0
|
|
|
|
0
|
$self->{"class_order"} = $value; |
193
|
|
|
|
|
|
|
}; |
194
|
|
|
|
|
|
|
|
195
|
|
|
|
|
|
|
# Attribute compiled (type: Mite::Compiled) |
196
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Source.pm, line 34 |
197
|
|
|
|
|
|
|
if ( exists $args->{"compiled"} ) { |
198
|
|
|
|
|
|
|
blessed( $args->{"compiled"} ) |
199
|
|
|
|
|
|
|
&& $args->{"compiled"}->isa("Mite::Compiled") |
200
|
|
|
|
|
|
|
or croak "Type check failed in constructor: %s should be %s", |
201
|
128
|
|
|
|
|
548
|
"compiled", "Mite::Compiled"; |
202
|
|
|
|
|
|
|
$self->{"compiled"} = $args->{"compiled"}; |
203
|
|
|
|
|
|
|
} |
204
|
|
|
|
|
|
|
|
205
|
|
|
|
|
|
|
# Attribute project (type: Mite::Project) |
206
|
128
|
|
|
|
|
387
|
# has declaration, file lib/Mite/Source.pm, line 36 |
207
|
|
|
|
|
|
|
if ( exists $args->{"project"} ) { |
208
|
|
|
|
|
|
|
blessed( $args->{"project"} ) |
209
|
|
|
|
|
|
|
&& $args->{"project"}->isa("Mite::Project") |
210
|
|
|
|
|
|
|
or croak "Type check failed in constructor: %s should be %s", |
211
|
128
|
50
|
|
|
|
586
|
"project", "Mite::Project"; |
212
|
|
|
|
|
|
|
$self->{"project"} = $args->{"project"}; |
213
|
0
|
0
|
0
|
|
|
0
|
} |
214
|
|
|
|
|
|
|
require Scalar::Util && Scalar::Util::weaken( $self->{"project"} ) |
215
|
|
|
|
|
|
|
if ref $self->{"project"}; |
216
|
0
|
|
|
|
|
0
|
|
217
|
|
|
|
|
|
|
# Call BUILD methods |
218
|
|
|
|
|
|
|
$self->BUILDALL($args) if ( !$no_build and @{ $meta->{BUILD} || [] } ); |
219
|
|
|
|
|
|
|
|
220
|
|
|
|
|
|
|
# Unrecognized parameters |
221
|
128
|
50
|
|
|
|
413
|
my @unknown = |
222
|
|
|
|
|
|
|
grep not(/\A(?:c(?:lass(?:_order|es)|ompiled)|file|project)\z/), |
223
|
128
|
50
|
33
|
|
|
1633
|
keys %{$args}; |
224
|
|
|
|
|
|
|
@unknown |
225
|
|
|
|
|
|
|
and croak( |
226
|
128
|
|
|
|
|
474
|
"Unexpected keys in constructor: " . join( q[, ], sort @unknown ) ); |
227
|
|
|
|
|
|
|
|
228
|
|
|
|
|
|
|
return $self; |
229
|
128
|
50
|
33
|
|
|
1618
|
} |
230
|
|
|
|
|
|
|
|
231
|
|
|
|
|
|
|
# Used by constructor to call BUILD methods |
232
|
128
|
50
|
33
|
|
|
719
|
my $class = ref( $_[0] ); |
|
128
|
50
|
|
|
|
711
|
|
233
|
|
|
|
|
|
|
my $meta = ( $Mite::META{$class} ||= $class->__META__ ); |
234
|
|
|
|
|
|
|
$_->(@_) for @{ $meta->{BUILD} || [] }; |
235
|
|
|
|
|
|
|
} |
236
|
|
|
|
|
|
|
|
237
|
128
|
|
|
|
|
304
|
# Destructor should call DEMOLISH methods |
|
128
|
|
|
|
|
1455
|
|
238
|
|
|
|
|
|
|
my $self = shift; |
239
|
128
|
50
|
|
|
|
508
|
my $class = ref($self) || $self; |
240
|
|
|
|
|
|
|
my $meta = ( $Mite::META{$class} ||= $class->__META__ ); |
241
|
|
|
|
|
|
|
my $in_global_destruction = |
242
|
128
|
|
|
|
|
1053
|
defined ${^GLOBAL_PHASE} |
243
|
|
|
|
|
|
|
? ${^GLOBAL_PHASE} eq 'DESTRUCT' |
244
|
|
|
|
|
|
|
: Devel::GlobalDestruction::in_global_destruction(); |
245
|
|
|
|
|
|
|
for my $demolisher ( @{ $meta->{DEMOLISH} || [] } ) { |
246
|
|
|
|
|
|
|
my $e = do { |
247
|
0
|
|
|
0
|
0
|
0
|
local ( $?, $@ ); |
248
|
0
|
|
0
|
|
|
0
|
eval { $demolisher->( $self, $in_global_destruction ) }; |
249
|
0
|
0
|
|
|
|
0
|
$@; |
|
0
|
|
|
|
|
0
|
|
250
|
|
|
|
|
|
|
}; |
251
|
|
|
|
|
|
|
no warnings 'misc'; # avoid (in cleanup) warnings |
252
|
|
|
|
|
|
|
die $e if $e; # rethrow |
253
|
|
|
|
|
|
|
} |
254
|
0
|
|
|
0
|
|
0
|
return; |
255
|
0
|
|
0
|
|
|
0
|
} |
256
|
0
|
|
0
|
|
|
0
|
|
257
|
0
|
0
|
|
|
|
0
|
my $__XS = !$ENV{PERL_ONLY} |
258
|
|
|
|
|
|
|
&& eval { require Class::XSAccessor; Class::XSAccessor->VERSION("1.19") }; |
259
|
|
|
|
|
|
|
|
260
|
|
|
|
|
|
|
# Accessors for class_order |
261
|
0
|
0
|
|
|
|
0
|
# has declaration, file lib/Mite/Source.pm, line 25 |
|
0
|
|
|
|
|
0
|
|
262
|
0
|
|
|
|
|
0
|
if ($__XS) { |
263
|
0
|
|
|
|
|
0
|
Class::XSAccessor->import( |
264
|
0
|
|
|
|
|
0
|
chained => 1, |
|
0
|
|
|
|
|
0
|
|
265
|
0
|
|
|
|
|
0
|
"getters" => { "class_order" => "class_order" }, |
266
|
|
|
|
|
|
|
); |
267
|
106
|
|
|
106
|
|
905
|
} |
|
106
|
|
|
|
|
229
|
|
|
106
|
|
|
|
|
64374
|
|
268
|
0
|
0
|
|
|
|
0
|
else { |
269
|
|
|
|
|
|
|
*class_order = sub { |
270
|
0
|
|
|
|
|
0
|
@_ == 1 |
271
|
|
|
|
|
|
|
or croak('Reader "class_order" usage: $self->class_order()'); |
272
|
|
|
|
|
|
|
$_[0]{"class_order"}; |
273
|
|
|
|
|
|
|
}; |
274
|
|
|
|
|
|
|
} |
275
|
|
|
|
|
|
|
|
276
|
|
|
|
|
|
|
# Accessors for classes |
277
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Source.pm, line 20 |
278
|
|
|
|
|
|
|
if ($__XS) { |
279
|
|
|
|
|
|
|
Class::XSAccessor->import( |
280
|
|
|
|
|
|
|
chained => 1, |
281
|
|
|
|
|
|
|
"getters" => { "classes" => "classes" }, |
282
|
|
|
|
|
|
|
); |
283
|
|
|
|
|
|
|
} |
284
|
|
|
|
|
|
|
else { |
285
|
|
|
|
|
|
|
*classes = sub { |
286
|
|
|
|
|
|
|
@_ == 1 or croak('Reader "classes" usage: $self->classes()'); |
287
|
|
|
|
|
|
|
$_[0]{"classes"}; |
288
|
|
|
|
|
|
|
}; |
289
|
|
|
|
|
|
|
} |
290
|
|
|
|
|
|
|
|
291
|
|
|
|
|
|
|
# Accessors for compiled |
292
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Source.pm, line 34 |
293
|
|
|
|
|
|
|
@_ == 1 or croak('Reader "compiled" usage: $self->compiled()'); |
294
|
|
|
|
|
|
|
( |
295
|
|
|
|
|
|
|
exists( $_[0]{"compiled"} ) ? $_[0]{"compiled"} : ( |
296
|
|
|
|
|
|
|
$_[0]{"compiled"} = do { |
297
|
|
|
|
|
|
|
my $default_value = |
298
|
|
|
|
|
|
|
$Mite::Source::__compiled_DEFAULT__->( $_[0] ); |
299
|
|
|
|
|
|
|
blessed($default_value) |
300
|
|
|
|
|
|
|
&& $default_value->isa("Mite::Compiled") |
301
|
|
|
|
|
|
|
or croak( "Type check failed in default: %s should be %s", |
302
|
|
|
|
|
|
|
"compiled", "Mite::Compiled" ); |
303
|
|
|
|
|
|
|
$default_value; |
304
|
|
|
|
|
|
|
} |
305
|
|
|
|
|
|
|
) |
306
|
|
|
|
|
|
|
); |
307
|
|
|
|
|
|
|
} |
308
|
|
|
|
|
|
|
|
309
|
|
|
|
|
|
|
# Accessors for file |
310
|
100
|
50
|
|
100
|
0
|
1429
|
# has declaration, file lib/Mite/Source.pm, line 11 |
311
|
|
|
|
|
|
|
if ($__XS) { |
312
|
|
|
|
|
|
|
Class::XSAccessor->import( |
313
|
100
|
100
|
|
|
|
362
|
chained => 1, |
314
|
99
|
|
|
|
|
468
|
"getters" => { "file" => "file" }, |
315
|
|
|
|
|
|
|
); |
316
|
99
|
50
|
33
|
|
|
1243
|
} |
317
|
|
|
|
|
|
|
else { |
318
|
|
|
|
|
|
|
*file = sub { |
319
|
|
|
|
|
|
|
@_ == 1 or croak('Reader "file" usage: $self->file()'); |
320
|
99
|
|
|
|
|
648
|
$_[0]{"file"}; |
321
|
|
|
|
|
|
|
}; |
322
|
|
|
|
|
|
|
} |
323
|
|
|
|
|
|
|
|
324
|
|
|
|
|
|
|
# Accessors for project |
325
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Source.pm, line 36 |
326
|
|
|
|
|
|
|
@_ > 1 |
327
|
|
|
|
|
|
|
? do { |
328
|
|
|
|
|
|
|
blessed( $_[1] ) && $_[1]->isa("Mite::Project") |
329
|
|
|
|
|
|
|
or croak( "Type check failed in %s: value should be %s", |
330
|
|
|
|
|
|
|
"accessor", "Mite::Project" ); |
331
|
|
|
|
|
|
|
$_[0]{"project"} = $_[1]; |
332
|
|
|
|
|
|
|
require Scalar::Util && Scalar::Util::weaken( $_[0]{"project"} ) |
333
|
|
|
|
|
|
|
if ref $_[0]{"project"}; |
334
|
|
|
|
|
|
|
$_[0]; |
335
|
|
|
|
|
|
|
} |
336
|
|
|
|
|
|
|
: ( $_[0]{"project"} ); |
337
|
|
|
|
|
|
|
} |
338
|
|
|
|
|
|
|
|
339
|
|
|
|
|
|
|
# See UNIVERSAL |
340
|
|
|
|
|
|
|
my ( $self, $role ) = @_; |
341
|
|
|
|
|
|
|
our %DOES; |
342
|
|
|
|
|
|
|
return $DOES{$role} if exists $DOES{$role}; |
343
|
|
|
|
|
|
|
return 1 if $role eq __PACKAGE__; |
344
|
|
|
|
|
|
|
return $self->SUPER::DOES($role); |
345
|
|
|
|
|
|
|
} |
346
|
0
|
0
|
0
|
|
|
|
|
347
|
|
|
|
|
|
|
# Alias for Moose/Moo-compatibility |
348
|
|
|
|
|
|
|
shift->DOES(@_); |
349
|
0
|
|
|
|
|
|
} |
350
|
|
|
|
|
|
|
|
351
|
0
|
0
|
0
|
|
|
|
1; |
352
|
0
|
|
|
|
|
|
|