line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
{ |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
use strict; |
4
|
107
|
|
|
107
|
|
830
|
use warnings; |
|
107
|
|
|
|
|
295
|
|
|
107
|
|
|
|
|
3568
|
|
5
|
107
|
|
|
107
|
|
605
|
no warnings qw( once void ); |
|
107
|
|
|
|
|
304
|
|
|
107
|
|
|
|
|
3583
|
|
6
|
107
|
|
|
107
|
|
594
|
|
|
107
|
|
|
|
|
251
|
|
|
107
|
|
|
|
|
13738
|
|
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::Config" ); |
14
|
107
|
|
|
107
|
|
579
|
( |
15
|
|
|
|
|
|
|
*after, *around, *before, *extends, *field, |
16
|
|
|
|
|
|
|
*has, *param, *signature_for, *with |
17
|
|
|
|
|
|
|
) |
18
|
|
|
|
|
|
|
= do { |
19
|
107
|
|
|
|
|
576
|
|
20
|
|
|
|
|
|
|
no warnings 'redefine'; |
21
|
|
|
|
|
|
|
( |
22
|
107
|
|
|
107
|
|
715
|
sub { $SHIM->HANDLE_after( $CALLER, "class", @_ ) }, |
|
107
|
|
|
|
|
254
|
|
|
107
|
|
|
|
|
24318
|
|
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
|
|
5312
|
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
|
|
|
|
|
20416
|
|
34
|
|
|
|
|
|
|
# Mite imports |
35
|
|
|
|
|
|
|
BEGIN { |
36
|
|
|
|
|
|
|
require Scalar::Util; |
37
|
|
|
|
|
|
|
*STRICT = \&Mite::Shim::STRICT; |
38
|
|
|
|
|
|
|
*bare = \&Mite::Shim::bare; |
39
|
107
|
|
|
107
|
|
878
|
*blessed = \&Scalar::Util::blessed; |
40
|
107
|
|
|
|
|
455
|
*carp = \&Mite::Shim::carp; |
41
|
107
|
|
|
|
|
281
|
*confess = \&Mite::Shim::confess; |
42
|
107
|
|
|
|
|
273
|
*croak = \&Mite::Shim::croak; |
43
|
107
|
|
|
|
|
431
|
*false = \&Mite::Shim::false; |
44
|
107
|
|
|
|
|
300
|
*guard = \&Mite::Shim::guard; |
45
|
107
|
|
|
|
|
279
|
*lazy = \&Mite::Shim::lazy; |
46
|
107
|
|
|
|
|
277
|
*lock = \&Mite::Shim::lock; |
47
|
107
|
|
|
|
|
343
|
*ro = \&Mite::Shim::ro; |
48
|
107
|
|
|
|
|
278
|
*rw = \&Mite::Shim::rw; |
49
|
107
|
|
|
|
|
300
|
*rwp = \&Mite::Shim::rwp; |
50
|
107
|
|
|
|
|
245
|
*true = \&Mite::Shim::true; |
51
|
107
|
|
|
|
|
253
|
*unlock = \&Mite::Shim::unlock; |
52
|
107
|
|
|
|
|
246
|
} |
53
|
107
|
|
|
|
|
265
|
|
54
|
107
|
|
|
|
|
3789
|
# 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
|
|
701
|
return { |
|
107
|
|
|
|
|
289
|
|
|
107
|
|
|
|
|
42082
|
|
60
|
107
|
|
|
107
|
|
278
|
BUILD => [ |
61
|
107
|
|
33
|
|
|
756
|
map { ( *{$_}{CODE} ) ? ( *{$_}{CODE} ) : () } |
62
|
107
|
|
|
|
|
755
|
map { "$_\::BUILD" } reverse @$linear_isa |
63
|
|
|
|
|
|
|
], |
64
|
|
|
|
|
|
|
DEMOLISH => [ |
65
|
107
|
50
|
|
|
|
269
|
map { ( *{$_}{CODE} ) ? ( *{$_}{CODE} ) : () } |
|
107
|
|
|
|
|
860
|
|
|
0
|
|
|
|
|
0
|
|
66
|
107
|
|
|
|
|
453
|
map { "$_\::DEMOLISH" } @$linear_isa |
67
|
|
|
|
|
|
|
], |
68
|
|
|
|
|
|
|
HAS_BUILDARGS => $class->can('BUILDARGS'), |
69
|
107
|
50
|
|
|
|
240
|
HAS_FOREIGNBUILDARGS => $class->can('FOREIGNBUILDARGS'), |
|
107
|
|
|
|
|
3119
|
|
|
0
|
|
|
|
|
0
|
|
70
|
107
|
|
|
|
|
358
|
}; |
|
107
|
|
|
|
|
379
|
|
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
|
111
|
50
|
|
111
|
0
|
26815
|
? $class->BUILDARGS(@_) |
80
|
111
|
|
66
|
|
|
1547
|
: { ( @_ == 1 ) ? %{ $_[0] } : @_ }; |
81
|
111
|
|
|
|
|
417
|
my $no_build = delete $args->{__no_BUILD__}; |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
# Attribute mite_dir_name (type: Str) |
84
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Config.pm, line 11 |
85
|
111
|
50
|
|
|
|
812
|
do { |
|
0
|
50
|
|
|
|
0
|
|
86
|
111
|
|
|
|
|
288
|
my $value = |
87
|
|
|
|
|
|
|
exists( $args->{"mite_dir_name"} ) |
88
|
|
|
|
|
|
|
? $args->{"mite_dir_name"} |
89
|
|
|
|
|
|
|
: ".mite"; |
90
|
111
|
|
|
|
|
238
|
do { |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
defined($value) and do { |
93
|
111
|
50
|
|
|
|
455
|
ref( \$value ) eq 'SCALAR' |
94
|
|
|
|
|
|
|
or ref( \( my $val = $value ) ) eq 'SCALAR'; |
95
|
111
|
50
|
|
|
|
238
|
} |
96
|
|
|
|
|
|
|
or croak "Type check failed in constructor: %s should be %s", |
97
|
|
|
|
|
|
|
"mite_dir_name", "Str"; |
98
|
111
|
50
|
|
|
|
588
|
$self->{"mite_dir_name"} = $value; |
99
|
111
|
50
|
|
|
|
907
|
}; |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
# Attribute mite_dir (type: Path) |
102
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Config.pm, line 25 |
103
|
|
|
|
|
|
|
if ( exists $args->{"mite_dir"} ) { |
104
|
|
|
|
|
|
|
do { |
105
|
111
|
|
|
|
|
644
|
my $coerced_value = do { |
106
|
|
|
|
|
|
|
my $to_coerce = $args->{"mite_dir"}; |
107
|
|
|
|
|
|
|
( |
108
|
|
|
|
|
|
|
( |
109
|
|
|
|
|
|
|
do { |
110
|
111
|
50
|
|
|
|
502
|
use Scalar::Util (); |
111
|
0
|
|
|
|
|
0
|
Scalar::Util::blessed($to_coerce) |
112
|
0
|
|
|
|
|
0
|
and $to_coerce->isa(q[Path::Tiny]); |
113
|
0
|
|
|
|
|
0
|
} |
114
|
|
|
|
|
|
|
) |
115
|
|
|
|
|
|
|
) ? $to_coerce : ( |
116
|
|
|
|
|
|
|
do { |
117
|
107
|
|
|
107
|
|
888
|
|
|
107
|
|
|
|
|
274
|
|
|
107
|
|
|
|
|
31339
|
|
118
|
0
|
0
|
|
|
|
0
|
defined($to_coerce) and do { |
119
|
|
|
|
|
|
|
ref( \$to_coerce ) eq 'SCALAR' |
120
|
|
|
|
|
|
|
or ref( \( my $val = $to_coerce ) ) eq |
121
|
|
|
|
|
|
|
'SCALAR'; |
122
|
|
|
|
|
|
|
} |
123
|
|
|
|
|
|
|
) |
124
|
|
|
|
|
|
|
? scalar( |
125
|
|
|
|
|
|
|
do { local $_ = $to_coerce; Path::Tiny::path($_) } |
126
|
0
|
0
|
|
|
|
0
|
) |
127
|
0
|
0
|
|
|
|
0
|
: ( |
128
|
|
|
|
|
|
|
do { |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
defined($to_coerce) && !ref($to_coerce) |
131
|
|
|
|
|
|
|
or Scalar::Util::blessed($to_coerce) && ( |
132
|
|
|
|
|
|
|
sub { |
133
|
|
|
|
|
|
|
require overload; |
134
|
0
|
|
|
|
|
0
|
overload::Overloaded( ref $_[0] or $_[0] ) |
|
0
|
|
|
|
|
0
|
|
135
|
|
|
|
|
|
|
and |
136
|
|
|
|
|
|
|
overload::Method( ( ref $_[0] or $_[0] ), |
137
|
|
|
|
|
|
|
$_[1] ); |
138
|
|
|
|
|
|
|
} |
139
|
|
|
|
|
|
|
)->( $to_coerce, q[""] ); |
140
|
|
|
|
|
|
|
) |
141
|
|
|
|
|
|
|
? scalar( |
142
|
|
|
|
|
|
|
do { local $_ = $to_coerce; Path::Tiny::path($_) } |
143
|
0
|
|
|
0
|
|
0
|
) |
144
|
0
|
0
|
0
|
|
|
0
|
: ( ( ref($to_coerce) eq 'ARRAY' ) ) ? scalar( |
|
|
|
0
|
|
|
|
|
145
|
|
|
|
|
|
|
do { local $_ = $to_coerce; Path::Tiny::path(@$_) } |
146
|
|
|
|
|
|
|
) |
147
|
|
|
|
|
|
|
: $to_coerce; |
148
|
|
|
|
|
|
|
}; |
149
|
0
|
0
|
0
|
|
|
0
|
blessed($coerced_value) && $coerced_value->isa("Path::Tiny") |
|
|
|
0
|
|
|
|
|
150
|
|
|
|
|
|
|
or croak "Type check failed in constructor: %s should be %s", |
151
|
|
|
|
|
|
|
"mite_dir", "Path"; |
152
|
|
|
|
|
|
|
$self->{"mite_dir"} = $coerced_value; |
153
|
0
|
|
|
|
|
0
|
}; |
|
0
|
|
|
|
|
0
|
|
154
|
|
|
|
|
|
|
} |
155
|
|
|
|
|
|
|
|
156
|
0
|
0
|
|
|
|
0
|
# Attribute config_file (type: Path) |
|
0
|
0
|
|
|
|
0
|
|
|
0
|
0
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
|
157
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Config.pm, line 35 |
158
|
|
|
|
|
|
|
if ( exists $args->{"config_file"} ) { |
159
|
|
|
|
|
|
|
do { |
160
|
0
|
0
|
0
|
|
|
0
|
my $coerced_value = do { |
161
|
|
|
|
|
|
|
my $to_coerce = $args->{"config_file"}; |
162
|
|
|
|
|
|
|
( |
163
|
0
|
|
|
|
|
0
|
( |
164
|
|
|
|
|
|
|
do { |
165
|
|
|
|
|
|
|
use Scalar::Util (); |
166
|
|
|
|
|
|
|
Scalar::Util::blessed($to_coerce) |
167
|
|
|
|
|
|
|
and $to_coerce->isa(q[Path::Tiny]); |
168
|
|
|
|
|
|
|
} |
169
|
111
|
50
|
|
|
|
464
|
) |
170
|
0
|
|
|
|
|
0
|
) ? $to_coerce : ( |
171
|
0
|
|
|
|
|
0
|
do { |
172
|
0
|
|
|
|
|
0
|
|
173
|
|
|
|
|
|
|
defined($to_coerce) and do { |
174
|
|
|
|
|
|
|
ref( \$to_coerce ) eq 'SCALAR' |
175
|
|
|
|
|
|
|
or ref( \( my $val = $to_coerce ) ) eq |
176
|
107
|
|
|
107
|
|
887
|
'SCALAR'; |
|
107
|
|
|
|
|
303
|
|
|
107
|
|
|
|
|
84823
|
|
177
|
0
|
0
|
|
|
|
0
|
} |
178
|
|
|
|
|
|
|
) |
179
|
|
|
|
|
|
|
? scalar( |
180
|
|
|
|
|
|
|
do { local $_ = $to_coerce; Path::Tiny::path($_) } |
181
|
|
|
|
|
|
|
) |
182
|
|
|
|
|
|
|
: ( |
183
|
|
|
|
|
|
|
do { |
184
|
|
|
|
|
|
|
|
185
|
0
|
0
|
|
|
|
0
|
defined($to_coerce) && !ref($to_coerce) |
186
|
0
|
0
|
|
|
|
0
|
or Scalar::Util::blessed($to_coerce) && ( |
187
|
|
|
|
|
|
|
sub { |
188
|
|
|
|
|
|
|
require overload; |
189
|
|
|
|
|
|
|
overload::Overloaded( ref $_[0] or $_[0] ) |
190
|
|
|
|
|
|
|
and |
191
|
|
|
|
|
|
|
overload::Method( ( ref $_[0] or $_[0] ), |
192
|
|
|
|
|
|
|
$_[1] ); |
193
|
0
|
|
|
|
|
0
|
} |
|
0
|
|
|
|
|
0
|
|
194
|
|
|
|
|
|
|
)->( $to_coerce, q[""] ); |
195
|
|
|
|
|
|
|
) |
196
|
|
|
|
|
|
|
? scalar( |
197
|
|
|
|
|
|
|
do { local $_ = $to_coerce; Path::Tiny::path($_) } |
198
|
|
|
|
|
|
|
) |
199
|
|
|
|
|
|
|
: ( ( ref($to_coerce) eq 'ARRAY' ) ) ? scalar( |
200
|
|
|
|
|
|
|
do { local $_ = $to_coerce; Path::Tiny::path(@$_) } |
201
|
|
|
|
|
|
|
) |
202
|
0
|
|
|
0
|
|
0
|
: $to_coerce; |
203
|
0
|
0
|
0
|
|
|
0
|
}; |
|
|
|
0
|
|
|
|
|
204
|
|
|
|
|
|
|
blessed($coerced_value) && $coerced_value->isa("Path::Tiny") |
205
|
|
|
|
|
|
|
or croak "Type check failed in constructor: %s should be %s", |
206
|
|
|
|
|
|
|
"config_file", "Path"; |
207
|
|
|
|
|
|
|
$self->{"config_file"} = $coerced_value; |
208
|
0
|
0
|
0
|
|
|
0
|
}; |
|
|
|
0
|
|
|
|
|
209
|
|
|
|
|
|
|
} |
210
|
|
|
|
|
|
|
|
211
|
|
|
|
|
|
|
# Attribute data (type: HashRef) |
212
|
0
|
|
|
|
|
0
|
# has declaration, file lib/Mite/Config.pm, line 44 |
|
0
|
|
|
|
|
0
|
|
213
|
|
|
|
|
|
|
if ( exists $args->{"data"} ) { |
214
|
|
|
|
|
|
|
or croak "Type check failed in constructor: %s should be %s", |
215
|
0
|
0
|
|
|
|
0
|
"data", "HashRef"; |
|
0
|
0
|
|
|
|
0
|
|
|
0
|
0
|
|
|
|
0
|
|
|
|
0
|
|
|
|
|
|
216
|
|
|
|
|
|
|
$self->{"data"} = $args->{"data"}; |
217
|
|
|
|
|
|
|
} |
218
|
|
|
|
|
|
|
|
219
|
0
|
0
|
0
|
|
|
0
|
# Attribute search_for_mite_dir (type: Bool) |
220
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Config.pm, line 46 |
221
|
|
|
|
|
|
|
do { |
222
|
0
|
|
|
|
|
0
|
my $value = |
223
|
|
|
|
|
|
|
exists( $args->{"search_for_mite_dir"} ) |
224
|
|
|
|
|
|
|
? $args->{"search_for_mite_dir"} |
225
|
|
|
|
|
|
|
: true; |
226
|
|
|
|
|
|
|
( |
227
|
|
|
|
|
|
|
!ref $value |
228
|
111
|
100
|
|
|
|
499
|
and (!defined $value |
229
|
1
|
50
|
|
|
|
2
|
or $value eq q() |
|
1
|
|
|
|
|
6
|
|
230
|
|
|
|
|
|
|
or $value eq '0' |
231
|
|
|
|
|
|
|
or $value eq '1' ) |
232
|
1
|
|
|
|
|
4
|
) |
233
|
|
|
|
|
|
|
or croak "Type check failed in constructor: %s should be %s", |
234
|
|
|
|
|
|
|
"search_for_mite_dir", "Bool"; |
235
|
|
|
|
|
|
|
$self->{"search_for_mite_dir"} = $value; |
236
|
|
|
|
|
|
|
}; |
237
|
111
|
|
|
|
|
250
|
|
238
|
|
|
|
|
|
|
# Call BUILD methods |
239
|
|
|
|
|
|
|
$self->BUILDALL($args) if ( !$no_build and @{ $meta->{BUILD} || [] } ); |
240
|
111
|
100
|
|
|
|
431
|
|
241
|
|
|
|
|
|
|
# Unrecognized parameters |
242
|
|
|
|
|
|
|
my @unknown = grep not( |
243
|
111
|
50
|
66
|
|
|
1974
|
/\A(?:config_file|data|mite_dir(?:_name)?|search_for_mite_dir)\z/), |
|
|
|
33
|
|
|
|
|
244
|
|
|
|
|
|
|
keys %{$args}; |
245
|
|
|
|
|
|
|
@unknown |
246
|
|
|
|
|
|
|
and croak( |
247
|
|
|
|
|
|
|
"Unexpected keys in constructor: " . join( q[, ], sort @unknown ) ); |
248
|
|
|
|
|
|
|
|
249
|
|
|
|
|
|
|
return $self; |
250
|
|
|
|
|
|
|
} |
251
|
111
|
|
|
|
|
441
|
|
252
|
|
|
|
|
|
|
# Used by constructor to call BUILD methods |
253
|
|
|
|
|
|
|
my $class = ref( $_[0] ); |
254
|
|
|
|
|
|
|
my $meta = ( $Mite::META{$class} ||= $class->__META__ ); |
255
|
111
|
50
|
33
|
|
|
823
|
$_->(@_) for @{ $meta->{BUILD} || [] }; |
|
111
|
50
|
|
|
|
780
|
|
256
|
|
|
|
|
|
|
} |
257
|
|
|
|
|
|
|
|
258
|
|
|
|
|
|
|
# Destructor should call DEMOLISH methods |
259
|
|
|
|
|
|
|
my $self = shift; |
260
|
111
|
|
|
|
|
329
|
my $class = ref($self) || $self; |
|
111
|
|
|
|
|
481
|
|
261
|
|
|
|
|
|
|
my $meta = ( $Mite::META{$class} ||= $class->__META__ ); |
262
|
111
|
50
|
|
|
|
519
|
my $in_global_destruction = |
263
|
|
|
|
|
|
|
defined ${^GLOBAL_PHASE} |
264
|
|
|
|
|
|
|
? ${^GLOBAL_PHASE} eq 'DESTRUCT' |
265
|
111
|
|
|
|
|
660
|
: Devel::GlobalDestruction::in_global_destruction(); |
266
|
|
|
|
|
|
|
for my $demolisher ( @{ $meta->{DEMOLISH} || [] } ) { |
267
|
|
|
|
|
|
|
my $e = do { |
268
|
|
|
|
|
|
|
local ( $?, $@ ); |
269
|
|
|
|
|
|
|
eval { $demolisher->( $self, $in_global_destruction ) }; |
270
|
0
|
|
|
0
|
0
|
0
|
$@; |
271
|
0
|
|
0
|
|
|
0
|
}; |
272
|
0
|
0
|
|
|
|
0
|
no warnings 'misc'; # avoid (in cleanup) warnings |
|
0
|
|
|
|
|
0
|
|
273
|
|
|
|
|
|
|
die $e if $e; # rethrow |
274
|
|
|
|
|
|
|
} |
275
|
|
|
|
|
|
|
return; |
276
|
|
|
|
|
|
|
} |
277
|
7
|
|
|
7
|
|
6024
|
|
278
|
7
|
|
33
|
|
|
30
|
my $__XS = !$ENV{PERL_ONLY} |
279
|
7
|
|
33
|
|
|
32
|
&& eval { require Class::XSAccessor; Class::XSAccessor->VERSION("1.19") }; |
280
|
7
|
50
|
|
|
|
31
|
|
281
|
|
|
|
|
|
|
# Accessors for config_file |
282
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Config.pm, line 35 |
283
|
|
|
|
|
|
|
@_ == 1 or croak('Reader "config_file" usage: $self->config_file()'); |
284
|
7
|
50
|
|
|
|
16
|
( |
|
7
|
|
|
|
|
31
|
|
285
|
0
|
|
|
|
|
0
|
exists( $_[0]{"config_file"} ) ? $_[0]{"config_file"} : ( |
286
|
0
|
|
|
|
|
0
|
$_[0]{"config_file"} = do { |
287
|
0
|
|
|
|
|
0
|
my $default_value = do { |
|
0
|
|
|
|
|
0
|
|
288
|
0
|
|
|
|
|
0
|
my $to_coerce = |
289
|
|
|
|
|
|
|
$Mite::Config::__config_file_DEFAULT__->( |
290
|
107
|
|
|
107
|
|
960
|
$_[0] ); |
|
107
|
|
|
|
|
336
|
|
|
107
|
|
|
|
|
20601
|
|
291
|
0
|
0
|
|
|
|
0
|
( |
292
|
|
|
|
|
|
|
( |
293
|
7
|
|
|
|
|
68
|
do { |
294
|
|
|
|
|
|
|
use Scalar::Util (); |
295
|
|
|
|
|
|
|
Scalar::Util::blessed($to_coerce) |
296
|
|
|
|
|
|
|
and $to_coerce->isa(q[Path::Tiny]); |
297
|
|
|
|
|
|
|
} |
298
|
|
|
|
|
|
|
) |
299
|
|
|
|
|
|
|
) ? $to_coerce : ( |
300
|
|
|
|
|
|
|
do { |
301
|
|
|
|
|
|
|
|
302
|
844
|
50
|
|
844
|
0
|
2288
|
defined($to_coerce) and do { |
303
|
|
|
|
|
|
|
ref( \$to_coerce ) eq 'SCALAR' |
304
|
|
|
|
|
|
|
or ref( \( my $val = $to_coerce ) ) eq |
305
|
844
|
100
|
|
|
|
2166
|
'SCALAR'; |
306
|
833
|
|
|
|
|
1401
|
} |
307
|
833
|
|
|
|
|
2284
|
) |
308
|
|
|
|
|
|
|
? scalar( |
309
|
|
|
|
|
|
|
do { local $_ = $to_coerce; Path::Tiny::path($_) } |
310
|
|
|
|
|
|
|
) |
311
|
|
|
|
|
|
|
: ( |
312
|
|
|
|
|
|
|
do { |
313
|
107
|
|
|
107
|
|
900
|
|
|
107
|
|
|
|
|
300
|
|
|
107
|
|
|
|
|
55477
|
|
314
|
18
|
50
|
|
|
|
282
|
defined($to_coerce) && !ref($to_coerce) |
315
|
|
|
|
|
|
|
or Scalar::Util::blessed($to_coerce) && ( |
316
|
|
|
|
|
|
|
sub { |
317
|
|
|
|
|
|
|
require overload; |
318
|
|
|
|
|
|
|
overload::Overloaded( |
319
|
|
|
|
|
|
|
ref $_[0] |
320
|
|
|
|
|
|
|
or $_[0] |
321
|
|
|
|
|
|
|
) |
322
|
0
|
0
|
|
|
|
0
|
and overload::Method( |
323
|
0
|
0
|
|
|
|
0
|
( ref $_[0] or $_[0] ), $_[1] ); |
324
|
|
|
|
|
|
|
} |
325
|
|
|
|
|
|
|
)->( $to_coerce, q[""] ); |
326
|
|
|
|
|
|
|
) |
327
|
|
|
|
|
|
|
? scalar( |
328
|
|
|
|
|
|
|
do { local $_ = $to_coerce; Path::Tiny::path($_) } |
329
|
|
|
|
|
|
|
) |
330
|
0
|
|
|
|
|
0
|
: ( ( ref($to_coerce) eq 'ARRAY' ) ) ? scalar( |
|
0
|
|
|
|
|
0
|
|
331
|
|
|
|
|
|
|
do { local $_ = $to_coerce; Path::Tiny::path(@$_) } |
332
|
|
|
|
|
|
|
) |
333
|
|
|
|
|
|
|
: $to_coerce; |
334
|
|
|
|
|
|
|
}; |
335
|
|
|
|
|
|
|
blessed($default_value) && $default_value->isa("Path::Tiny") |
336
|
|
|
|
|
|
|
or croak( "Type check failed in default: %s should be %s", |
337
|
|
|
|
|
|
|
"config_file", "Path" ); |
338
|
|
|
|
|
|
|
$default_value; |
339
|
0
|
|
|
0
|
|
0
|
} |
340
|
0
|
0
|
0
|
|
|
0
|
) |
|
|
|
0
|
|
|
|
|
341
|
|
|
|
|
|
|
); |
342
|
|
|
|
|
|
|
} |
343
|
|
|
|
|
|
|
|
344
|
|
|
|
|
|
|
# Accessors for data |
345
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Config.pm, line 44 |
346
|
|
|
|
|
|
|
@_ > 1 |
347
|
0
|
0
|
0
|
|
|
0
|
? do { |
|
|
|
0
|
|
|
|
|
348
|
|
|
|
|
|
|
( ref( $_[1] ) eq 'HASH' ) |
349
|
|
|
|
|
|
|
or croak( "Type check failed in %s: value should be %s", |
350
|
|
|
|
|
|
|
"accessor", "HashRef" ); |
351
|
0
|
|
|
|
|
0
|
$_[0]{"data"} = $_[1]; |
|
0
|
|
|
|
|
0
|
|
352
|
|
|
|
|
|
|
$_[0]; |
353
|
|
|
|
|
|
|
} |
354
|
18
|
0
|
|
|
|
838
|
: do { |
|
0
|
0
|
|
|
|
0
|
|
|
0
|
0
|
|
|
|
0
|
|
|
|
50
|
|
|
|
|
|
355
|
|
|
|
|
|
|
( |
356
|
|
|
|
|
|
|
exists( $_[0]{"data"} ) ? $_[0]{"data"} : ( |
357
|
|
|
|
|
|
|
$_[0]{"data"} = do { |
358
|
18
|
50
|
33
|
|
|
176
|
my $default_value = |
359
|
|
|
|
|
|
|
$Mite::Config::__data_DEFAULT__->( $_[0] ); |
360
|
|
|
|
|
|
|
( ref($default_value) eq 'HASH' ) |
361
|
18
|
|
|
|
|
208
|
or croak( |
362
|
|
|
|
|
|
|
"Type check failed in default: %s should be %s", |
363
|
|
|
|
|
|
|
"data", "HashRef" ); |
364
|
|
|
|
|
|
|
$default_value; |
365
|
|
|
|
|
|
|
} |
366
|
|
|
|
|
|
|
) |
367
|
|
|
|
|
|
|
) |
368
|
|
|
|
|
|
|
} |
369
|
|
|
|
|
|
|
} |
370
|
|
|
|
|
|
|
|
371
|
|
|
|
|
|
|
# Accessors for mite_dir |
372
|
0
|
0
|
|
|
|
0
|
# has declaration, file lib/Mite/Config.pm, line 25 |
373
|
|
|
|
|
|
|
@_ == 1 or croak('Reader "mite_dir" usage: $self->mite_dir()'); |
374
|
|
|
|
|
|
|
( |
375
|
0
|
|
|
|
|
0
|
exists( $_[0]{"mite_dir"} ) ? $_[0]{"mite_dir"} : ( |
376
|
0
|
|
|
|
|
0
|
$_[0]{"mite_dir"} = do { |
377
|
|
|
|
|
|
|
my $default_value = do { |
378
|
901
|
50
|
|
901
|
0
|
4344
|
my $to_coerce = |
379
|
|
|
|
|
|
|
$Mite::Config::__mite_dir_DEFAULT__->( |
380
|
|
|
|
|
|
|
$_[0] ); |
381
|
901
|
100
|
|
|
|
2495
|
( |
382
|
824
|
|
|
|
|
2691
|
( |
383
|
|
|
|
|
|
|
do { |
384
|
9
|
50
|
|
|
|
174
|
use Scalar::Util (); |
385
|
|
|
|
|
|
|
Scalar::Util::blessed($to_coerce) |
386
|
|
|
|
|
|
|
and $to_coerce->isa(q[Path::Tiny]); |
387
|
|
|
|
|
|
|
} |
388
|
9
|
|
|
|
|
116
|
) |
389
|
|
|
|
|
|
|
) ? $to_coerce : ( |
390
|
|
|
|
|
|
|
do { |
391
|
|
|
|
|
|
|
|
392
|
|
|
|
|
|
|
defined($to_coerce) and do { |
393
|
|
|
|
|
|
|
ref( \$to_coerce ) eq 'SCALAR' |
394
|
|
|
|
|
|
|
or ref( \( my $val = $to_coerce ) ) eq |
395
|
|
|
|
|
|
|
'SCALAR'; |
396
|
|
|
|
|
|
|
} |
397
|
|
|
|
|
|
|
) |
398
|
842
|
50
|
|
842
|
0
|
2952
|
? scalar( |
399
|
|
|
|
|
|
|
do { local $_ = $to_coerce; Path::Tiny::path($_) } |
400
|
|
|
|
|
|
|
) |
401
|
842
|
100
|
|
|
|
2057
|
: ( |
402
|
834
|
|
|
|
|
1334
|
do { |
403
|
834
|
|
|
|
|
2244
|
|
404
|
|
|
|
|
|
|
defined($to_coerce) && !ref($to_coerce) |
405
|
|
|
|
|
|
|
or Scalar::Util::blessed($to_coerce) && ( |
406
|
|
|
|
|
|
|
sub { |
407
|
|
|
|
|
|
|
require overload; |
408
|
|
|
|
|
|
|
overload::Overloaded( |
409
|
107
|
|
|
107
|
|
900
|
ref $_[0] |
|
107
|
|
|
|
|
277
|
|
|
107
|
|
|
|
|
69758
|
|
410
|
18
|
50
|
|
|
|
515
|
or $_[0] |
411
|
|
|
|
|
|
|
) |
412
|
|
|
|
|
|
|
and overload::Method( |
413
|
|
|
|
|
|
|
( ref $_[0] or $_[0] ), $_[1] ); |
414
|
|
|
|
|
|
|
} |
415
|
|
|
|
|
|
|
)->( $to_coerce, q[""] ); |
416
|
|
|
|
|
|
|
) |
417
|
|
|
|
|
|
|
? scalar( |
418
|
0
|
0
|
|
|
|
0
|
do { local $_ = $to_coerce; Path::Tiny::path($_) } |
419
|
0
|
0
|
|
|
|
0
|
) |
420
|
|
|
|
|
|
|
: ( ( ref($to_coerce) eq 'ARRAY' ) ) ? scalar( |
421
|
|
|
|
|
|
|
do { local $_ = $to_coerce; Path::Tiny::path(@$_) } |
422
|
|
|
|
|
|
|
) |
423
|
|
|
|
|
|
|
: $to_coerce; |
424
|
|
|
|
|
|
|
}; |
425
|
|
|
|
|
|
|
blessed($default_value) && $default_value->isa("Path::Tiny") |
426
|
0
|
|
|
|
|
0
|
or croak( "Type check failed in default: %s should be %s", |
|
0
|
|
|
|
|
0
|
|
427
|
|
|
|
|
|
|
"mite_dir", "Path" ); |
428
|
|
|
|
|
|
|
$default_value; |
429
|
|
|
|
|
|
|
} |
430
|
|
|
|
|
|
|
) |
431
|
|
|
|
|
|
|
); |
432
|
|
|
|
|
|
|
} |
433
|
|
|
|
|
|
|
|
434
|
|
|
|
|
|
|
# Accessors for mite_dir_name |
435
|
0
|
|
|
0
|
|
0
|
# has declaration, file lib/Mite/Config.pm, line 11 |
436
|
0
|
0
|
0
|
|
|
0
|
if ($__XS) { |
|
|
|
0
|
|
|
|
|
437
|
|
|
|
|
|
|
Class::XSAccessor->import( |
438
|
|
|
|
|
|
|
chained => 1, |
439
|
|
|
|
|
|
|
"getters" => { "mite_dir_name" => "mite_dir_name" }, |
440
|
|
|
|
|
|
|
); |
441
|
|
|
|
|
|
|
} |
442
|
|
|
|
|
|
|
else { |
443
|
0
|
0
|
0
|
|
|
0
|
*mite_dir_name = sub { |
|
|
|
0
|
|
|
|
|
444
|
|
|
|
|
|
|
@_ == 1 |
445
|
|
|
|
|
|
|
or croak('Reader "mite_dir_name" usage: $self->mite_dir_name()'); |
446
|
|
|
|
|
|
|
$_[0]{"mite_dir_name"}; |
447
|
0
|
|
|
|
|
0
|
}; |
|
0
|
|
|
|
|
0
|
|
448
|
|
|
|
|
|
|
} |
449
|
|
|
|
|
|
|
|
450
|
18
|
0
|
|
|
|
50
|
# Accessors for search_for_mite_dir |
|
0
|
0
|
|
|
|
0
|
|
|
0
|
0
|
|
|
|
0
|
|
|
|
50
|
|
|
|
|
|
451
|
|
|
|
|
|
|
# has declaration, file lib/Mite/Config.pm, line 46 |
452
|
|
|
|
|
|
|
@_ > 1 |
453
|
|
|
|
|
|
|
? do { |
454
|
18
|
50
|
33
|
|
|
204
|
( |
455
|
|
|
|
|
|
|
!ref $_[1] |
456
|
|
|
|
|
|
|
and (!defined $_[1] |
457
|
18
|
|
|
|
|
130
|
or $_[1] eq q() |
458
|
|
|
|
|
|
|
or $_[1] eq '0' |
459
|
|
|
|
|
|
|
or $_[1] eq '1' ) |
460
|
|
|
|
|
|
|
) |
461
|
|
|
|
|
|
|
or croak( "Type check failed in %s: value should be %s", |
462
|
|
|
|
|
|
|
"accessor", "Bool" ); |
463
|
|
|
|
|
|
|
$_[0]{"search_for_mite_dir"} = $_[1]; |
464
|
|
|
|
|
|
|
$_[0]; |
465
|
|
|
|
|
|
|
} |
466
|
|
|
|
|
|
|
: ( $_[0]{"search_for_mite_dir"} ); |
467
|
|
|
|
|
|
|
} |
468
|
|
|
|
|
|
|
|
469
|
|
|
|
|
|
|
# See UNIVERSAL |
470
|
|
|
|
|
|
|
my ( $self, $role ) = @_; |
471
|
|
|
|
|
|
|
our %DOES; |
472
|
|
|
|
|
|
|
return $DOES{$role} if exists $DOES{$role}; |
473
|
|
|
|
|
|
|
return 1 if $role eq __PACKAGE__; |
474
|
|
|
|
|
|
|
if ( $INC{'Moose/Util.pm'} |
475
|
|
|
|
|
|
|
and my $meta = Moose::Util::find_meta( ref $self or $self ) ) |
476
|
|
|
|
|
|
|
{ |
477
|
|
|
|
|
|
|
$meta->can('does_role') and $meta->does_role($role) and return 1; |
478
|
|
|
|
|
|
|
} |
479
|
|
|
|
|
|
|
return $self->SUPER::DOES($role); |
480
|
|
|
|
|
|
|
} |
481
|
|
|
|
|
|
|
|
482
|
|
|
|
|
|
|
# Alias for Moose/Moo-compatibility |
483
|
|
|
|
|
|
|
shift->DOES(@_); |
484
|
|
|
|
|
|
|
} |
485
|
15
|
50
|
66
|
|
|
355
|
|
|
|
|
66
|
|
|
|
|
486
|
|
|
|
|
|
|
1; |