line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package YAML::Conditional; |
2
|
14
|
|
|
14
|
|
893783
|
use 5.006; use strict; use warnings; our $VERSION = '1.00'; |
|
14
|
|
|
14
|
|
148
|
|
|
14
|
|
|
14
|
|
73
|
|
|
14
|
|
|
|
|
23
|
|
|
14
|
|
|
|
|
291
|
|
|
14
|
|
|
|
|
81
|
|
|
14
|
|
|
|
|
45
|
|
|
14
|
|
|
|
|
708
|
|
3
|
14
|
|
|
14
|
|
6206
|
use YAML::XS qw/Dump DumpFile Load LoadFile/; use base 'Struct::Conditional'; |
|
14
|
|
|
14
|
|
38142
|
|
|
14
|
|
|
|
|
831
|
|
|
14
|
|
|
|
|
104
|
|
|
14
|
|
|
|
|
26
|
|
|
14
|
|
|
|
|
6904
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
sub encode { |
6
|
0
|
|
|
0
|
1
|
0
|
Dump($_[1]); |
7
|
|
|
|
|
|
|
} |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub encode_file { |
10
|
0
|
|
|
0
|
0
|
0
|
DumpFile($_[1], $_[2]); |
11
|
|
|
|
|
|
|
} |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub decode { |
14
|
15
|
50
|
33
|
15
|
1
|
88
|
if ($_[1] !~ m/\n/ && -f $_[1]) { |
15
|
0
|
|
|
|
|
0
|
$_[0]->decode_file($_[1]); |
16
|
|
|
|
|
|
|
} |
17
|
15
|
|
|
|
|
1603
|
Load($_[1]); |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub decode_file { |
21
|
0
|
|
|
0
|
1
|
0
|
LoadFile($_[1], $_[2]); |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub compile { |
25
|
15
|
|
|
15
|
1
|
3053
|
my ($self, $yaml, $params, $return_struct, $out_file) = @_; |
26
|
15
|
50
|
|
|
|
96
|
$yaml = $self->decode($yaml) unless ref $yaml; |
27
|
15
|
50
|
|
|
|
91
|
$params = $self->decode($params) unless ref $params; |
28
|
15
|
|
|
|
|
129
|
$yaml = $self->SUPER::compile($yaml, $params); |
29
|
15
|
0
|
|
|
|
9486
|
return $return_struct |
|
|
50
|
|
|
|
|
|
30
|
|
|
|
|
|
|
? $yaml |
31
|
|
|
|
|
|
|
: $out_file |
32
|
|
|
|
|
|
|
? $self->encode_file($out_file, $yaml) |
33
|
|
|
|
|
|
|
: $self->encode($yaml); |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
1; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
__END__ |