line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTML::Widgets::NavMenu::ToJSON::Data_Persistence::YAML; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
1730
|
use 5.008; |
|
2
|
|
|
|
|
9
|
|
|
2
|
|
|
|
|
102
|
|
4
|
2
|
|
|
2
|
|
13
|
use strict; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
94
|
|
5
|
2
|
|
|
2
|
|
23
|
use warnings FATAL => 'all'; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
232
|
|
6
|
|
|
|
|
|
|
|
7
|
2
|
|
|
2
|
|
14
|
use parent 'HTML::Widgets::NavMenu::ToJSON::Data_Persistence'; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
24
|
|
8
|
|
|
|
|
|
|
|
9
|
2
|
|
|
2
|
|
1260
|
use YAML::XS (); |
|
2
|
|
|
|
|
4781
|
|
|
2
|
|
|
|
|
384
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our $VERSION = '0.0.7'; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
__PACKAGE__->mk_acc_ref([ qw( _filename ) ]); |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub _init |
17
|
|
|
|
|
|
|
{ |
18
|
1
|
|
|
1
|
|
1121
|
my ($self, $args) = @_; |
19
|
|
|
|
|
|
|
|
20
|
1
|
|
|
|
|
14
|
$self->_filename($args->{filename}); |
21
|
|
|
|
|
|
|
|
22
|
1
|
|
|
|
|
4
|
return; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub load |
28
|
|
|
|
|
|
|
{ |
29
|
1
|
|
|
1
|
1
|
1
|
my $self = shift; |
30
|
|
|
|
|
|
|
|
31
|
1
|
|
|
|
|
2
|
my $data; |
32
|
|
|
|
|
|
|
|
33
|
1
|
50
|
|
|
|
1
|
if (!eval |
34
|
|
|
|
|
|
|
{ |
35
|
1
|
|
|
|
|
8
|
($data) = YAML::XS::LoadFile($self->_filename()); |
36
|
|
|
|
|
|
|
|
37
|
0
|
|
|
|
|
0
|
1; |
38
|
|
|
|
|
|
|
}) |
39
|
|
|
|
|
|
|
{ |
40
|
1
|
|
|
|
|
91
|
$data = $self->_calc_initial_data(); |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
$self->_data( |
44
|
1
|
|
|
|
|
6
|
$data |
45
|
|
|
|
|
|
|
); |
46
|
|
|
|
|
|
|
|
47
|
1
|
|
|
|
|
2
|
return; |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
sub save |
52
|
|
|
|
|
|
|
{ |
53
|
1
|
|
|
1
|
1
|
2
|
my $self = shift; |
54
|
|
|
|
|
|
|
|
55
|
1
|
|
|
|
|
6
|
YAML::XS::DumpFile( |
56
|
|
|
|
|
|
|
$self->_filename, |
57
|
|
|
|
|
|
|
$self->_data |
58
|
|
|
|
|
|
|
); |
59
|
|
|
|
|
|
|
|
60
|
1
|
|
|
|
|
404
|
return; |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
1; # End of HTML::Widgets::NavMenu::ToJSON::Data_Persistence::YAML |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
__END__ |