line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package VCS::Lite::Store::YAML; |
2
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
6133
|
use strict; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
189
|
|
4
|
3
|
|
|
3
|
|
14
|
use warnings; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
126
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '0.12'; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
#---------------------------------------------------------------------------- |
9
|
|
|
|
|
|
|
|
10
|
3
|
|
|
3
|
|
11
|
use base qw(VCS::Lite::Store); |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
523
|
|
11
|
3
|
|
|
3
|
|
651
|
use YAML qw(LoadFile DumpFile); |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
#---------------------------------------------------------------------------- |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub load { |
16
|
|
|
|
|
|
|
my ($self,$path) = @_; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
LoadFile($path); |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub save { |
22
|
|
|
|
|
|
|
my ($self,$obj) = @_; |
23
|
|
|
|
|
|
|
my $storep = $self->store_path($obj->path); |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
DumpFile($storep, $obj); |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub repos_name { |
29
|
|
|
|
|
|
|
my ($self,$ele,$ext) = @_; |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
$ext ||= 'yml'; |
32
|
|
|
|
|
|
|
$ele ? "${ele}_$ext" : "VCSControl.$ext"; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
1; |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
__END__ |