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