line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package TreePath::Backend::File; |
2
|
|
|
|
|
|
|
$TreePath::Backend::File::VERSION = '0.14'; |
3
|
|
|
|
|
|
|
|
4
|
2
|
|
|
2
|
|
9715
|
use Moose::Role; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
20
|
|
5
|
2
|
|
|
2
|
|
15442
|
use Config::JFDI; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
138
|
|
6
|
2
|
|
|
2
|
|
26
|
use Carp qw/croak/; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
695
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub _load { |
9
|
1
|
|
|
1
|
|
2
|
my $self = shift; |
10
|
|
|
|
|
|
|
|
11
|
1
|
|
|
|
|
58
|
my $config = $self->conf; |
12
|
1
|
50
|
|
|
|
40
|
my $file = $config->{$self->configword}->{backend}->{args}->{file} |
13
|
|
|
|
|
|
|
or die "'file' is not defined in conf file !"; |
14
|
|
|
|
|
|
|
|
15
|
1
|
|
|
|
|
151
|
$self->_log("Loading tree from file $file"); |
16
|
|
|
|
|
|
|
|
17
|
1
|
50
|
|
|
|
9
|
my ($jfdi_h, $jfdi) = Config::JFDI->open($file) |
18
|
|
|
|
|
|
|
or croak "Error (conf: $file) : $!\n"; |
19
|
1
|
|
|
|
|
71516
|
return $jfdi->get; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub _create { |
23
|
0
|
|
|
0
|
|
|
my $self = shift; |
24
|
0
|
|
|
|
|
|
my $node = shift; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub _update { |
29
|
0
|
|
|
0
|
|
|
my $self = shift; |
30
|
0
|
|
|
|
|
|
my $node = shift; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub _delete { |
35
|
0
|
|
|
0
|
|
|
my $self = shift; |
36
|
0
|
|
|
|
|
|
my $nodes = shift; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
=head1 NAME |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
TreePath::Backend::File - Backend 'File' for TreePath |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
=head1 VERSION |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
version 0.14 |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=head1 CONFIGURATION |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
See t/conf/treefromfile.yml |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
TreePath: |
53
|
|
|
|
|
|
|
debug: 0 |
54
|
|
|
|
|
|
|
backend: |
55
|
|
|
|
|
|
|
name: File |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=head1 AUTHOR |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
Daniel Brosseau, C<< <dab at catapulse.org> >> |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
=head1 LICENSE AND COPYRIGHT |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
Copyright 2014 Daniel Brosseau. |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it |
67
|
|
|
|
|
|
|
under the terms of either: the GNU General Public License as published |
68
|
|
|
|
|
|
|
by the Free Software Foundation; or the Artistic License. |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
See http://dev.perl.org/licenses/ for more information. |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=cut |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
1; |