line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Flexconf::Yaml; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
648
|
use YAML::XS; |
|
2
|
|
|
|
|
5997
|
|
|
2
|
|
|
|
|
664
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
sub parse { |
6
|
0
|
|
|
0
|
0
|
|
return Load shift; |
7
|
|
|
|
|
|
|
} |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub stringify { |
10
|
0
|
|
|
0
|
0
|
|
return Dump shift; |
11
|
|
|
|
|
|
|
} |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub load { |
14
|
0
|
|
|
0
|
0
|
|
my ( $filepath ) = @_; |
15
|
0
|
|
|
|
|
|
local $/; |
16
|
0
|
0
|
|
|
|
|
open FH, "<", $filepath or return undef; |
17
|
0
|
|
|
|
|
|
my $conf = ; |
18
|
0
|
|
|
|
|
|
$conf = Load $conf; |
19
|
0
|
|
|
|
|
|
close FH; |
20
|
0
|
|
|
|
|
|
$conf; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub save { |
24
|
0
|
|
|
0
|
0
|
|
my ( $filepath, $conf ) = @_; |
25
|
0
|
0
|
|
|
|
|
open FH, ">", $filepath or die("Could not open file. $!"); |
26
|
0
|
|
|
|
|
|
print FH Dump $conf; |
27
|
0
|
|
|
|
|
|
close FH; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
1; |