line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
114865
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
47
|
|
2
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
70
|
|
3
|
|
|
|
|
|
|
package Config::Any::TOML; |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $VERSION = '0.002'; # VERSION |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
# ABSTRACT: Load TOML config files |
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
|
5
|
use base 'Config::Any::Base'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
2328
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub extensions { |
13
|
0
|
|
|
0
|
1
|
0
|
return qw( toml ); |
14
|
|
|
|
|
|
|
} |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub load { |
18
|
2
|
|
|
2
|
1
|
168080
|
my $class = shift; |
19
|
2
|
|
|
|
|
7
|
my $file = shift; |
20
|
|
|
|
|
|
|
|
21
|
2
|
50
|
|
|
|
189
|
open( my $fh, $file ) or die $!; |
22
|
2
|
|
|
|
|
5
|
my $content = do { local $/; <$fh> }; |
|
2
|
|
|
|
|
13
|
|
|
2
|
|
|
|
|
85
|
|
23
|
2
|
|
|
|
|
25
|
close $fh; |
24
|
|
|
|
|
|
|
|
25
|
2
|
|
|
|
|
37
|
require TOML; |
26
|
|
|
|
|
|
|
|
27
|
2
|
|
|
|
|
661
|
my ( $data, $err ) = TOML::from_toml($content); |
28
|
2
|
100
|
|
|
|
14872
|
unless ($data) { |
29
|
1
|
|
|
|
|
9
|
die "Error parsing toml: $err"; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
1
|
|
|
|
|
13
|
return $data; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
|
36
|
1
|
|
|
1
|
1
|
1565
|
sub requires_any_of { 'TOML' } |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
1; |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
__END__ |