line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package YAML::Conditional; |
2
|
14
|
|
|
14
|
|
828748
|
use 5.006; use strict; use warnings; our $VERSION = '0.03'; |
|
14
|
|
|
14
|
|
152
|
|
|
14
|
|
|
14
|
|
65
|
|
|
14
|
|
|
|
|
22
|
|
|
14
|
|
|
|
|
266
|
|
|
14
|
|
|
|
|
65
|
|
|
14
|
|
|
|
|
40
|
|
|
14
|
|
|
|
|
681
|
|
3
|
14
|
|
|
14
|
|
5593
|
use YAML::XS qw/Dump DumpFile Load LoadFile/; use base 'Struct::Conditional'; |
|
14
|
|
|
14
|
|
34765
|
|
|
14
|
|
|
|
|
761
|
|
|
14
|
|
|
|
|
97
|
|
|
14
|
|
|
|
|
28
|
|
|
14
|
|
|
|
|
6297
|
|
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
|
87
|
if ($_[1] !~ m/\n/ && -f $_[1]) { |
15
|
0
|
|
|
|
|
0
|
$_[0]->decode_file($_[1]); |
16
|
|
|
|
|
|
|
} |
17
|
15
|
|
|
|
|
1490
|
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
|
2808
|
my ($self, $yaml, $params, $return_struct, $out_file) = @_; |
26
|
15
|
50
|
|
|
|
87
|
$yaml = $self->decode($yaml) unless ref $yaml; |
27
|
15
|
50
|
|
|
|
86
|
$params = $self->decode($params) unless ref $params; |
28
|
15
|
|
|
|
|
130
|
$yaml = $self->SUPER::compile($yaml, $params); |
29
|
15
|
0
|
|
|
|
8759
|
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__ |