line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Bot::Cobalt::Conf::Role::Reader; |
2
|
|
|
|
|
|
|
$Bot::Cobalt::Conf::Role::Reader::VERSION = '0.021002'; |
3
|
8
|
|
|
8
|
|
25239
|
use Carp; |
|
8
|
|
|
|
|
12
|
|
|
8
|
|
|
|
|
426
|
|
4
|
8
|
|
|
8
|
|
30
|
use strictures 2; |
|
8
|
|
|
|
|
48
|
|
|
8
|
|
|
|
|
1134
|
|
5
|
|
|
|
|
|
|
|
6
|
8
|
|
|
8
|
|
1319
|
use Try::Tiny; |
|
8
|
|
|
|
|
9
|
|
|
8
|
|
|
|
|
379
|
|
7
|
|
|
|
|
|
|
|
8
|
8
|
|
|
8
|
|
33
|
use Bot::Cobalt::Common -types; |
|
8
|
|
|
|
|
36
|
|
|
8
|
|
|
|
|
53
|
|
9
|
8
|
|
|
8
|
|
352
|
use Bot::Cobalt::Serializer; |
|
8
|
|
|
|
|
10
|
|
|
8
|
|
|
|
|
137
|
|
10
|
|
|
|
|
|
|
|
11
|
8
|
|
|
8
|
|
44
|
use Moo::Role; |
|
8
|
|
|
|
|
8
|
|
|
8
|
|
|
|
|
42
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
has _serializer => ( |
14
|
|
|
|
|
|
|
is => 'ro', |
15
|
|
|
|
|
|
|
isa => InstanceOf['Bot::Cobalt::Serializer'], |
16
|
52
|
|
|
52
|
|
50756
|
builder => sub { Bot::Cobalt::Serializer->new }, |
17
|
|
|
|
|
|
|
); |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub readfile { |
20
|
12
|
|
|
12
|
0
|
19
|
my ($self, $path) = @_; |
21
|
|
|
|
|
|
|
|
22
|
12
|
50
|
|
|
|
29
|
confess "readfile() needs a path to read" |
23
|
|
|
|
|
|
|
unless defined $path; |
24
|
|
|
|
|
|
|
|
25
|
12
|
|
|
|
|
13
|
my $err; |
26
|
|
|
|
|
|
|
my $thawed_cf = try { |
27
|
12
|
|
|
12
|
|
476
|
$self->_serializer->readfile( $path ) |
28
|
|
|
|
|
|
|
} catch { |
29
|
0
|
|
|
0
|
|
0
|
$err = $_ |
30
|
12
|
|
|
|
|
84
|
}; |
31
|
|
|
|
|
|
|
|
32
|
12
|
50
|
|
|
|
334
|
confess "Serializer readfile() failed for $path; $err" |
33
|
|
|
|
|
|
|
if defined $err; |
34
|
|
|
|
|
|
|
|
35
|
12
|
|
|
|
|
32
|
$thawed_cf |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
1; |
40
|
|
|
|
|
|
|
__END__ |