TreePath/Backend/File.pm

filter: Statementstmt 76.0% 19 / 25 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 62.5% 5 / 8 Podpod n/a totaltotal 71.4% 25 / 35 CC 2 SCAR 4.4
CC
2
Cov
74%
_load
2.0
_create
2.0
_update
2.0
CRAP 1.6
« TreePath.pm ↑ Summary
1 package TreePath::Backend::File;
2 3 $TreePath::Backend::File::VERSION = '0.22';
3  
4 3 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 3 ▶use Config::JFDI;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 3 ▶use YAML qw(LoadFile);
Subroutine BEGIN: called CC=1 SCAR=0.0
7 3 ▶use Carp qw/croak/;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 2 ▶sub _load {
Subroutine _load: called CC=2 SCAR=7.0
10 2 my $self = shift;
11  
12 2 my $config = $self->conf;
13 my $file = $config->{$self->configword}->{backend}->{args}->{file}
14 2 ▶ or die "'file' is not defined in conf file !";
Branch: 1 branch
BranchTrueFalseTotal
my $file = $$config{$self->configword}{"backend"}{"args"}{"file"} or die "'file' is not defined in conf file !" 2 0 2
15  
16 2 $self->_log("Loading tree from file $file");
17  
18 # Can not use a arrayref with this, only hashref :(
19 # my ($jfdi_h, $jfdi) = Config::JFDI->open($file)
20 # or croak "Error (conf: $file) : $!\n";
21 # return $jfdi->get;
22  
23 2 return LoadFile($file);
24 }
25  
26 0 ▶sub _create {
Subroutine _create: not called CC=1 SCAR=6.9
27 0 my $self = shift;
28 0 my $node = shift;
29  
30 }
31  
32 0 ▶sub _update {
Subroutine _update: not called CC=1 SCAR=6.9
33 0 my $self = shift;
34 0 my $node = shift;
35  
36 }
37  
38 0 ▶sub _delete {
Subroutine _delete: not called CC=1 SCAR=6.9
39 0 my $self = shift;
40 0 my $nodes = shift;
41  
42 }
43  
44 =head1 NAME
45  
46 TreePath::Backend::File - Backend 'File' for TreePath
47  
48 =head1 VERSION
49  
50 version 0.22
51  
52 =head1 CONFIGURATION
53  
54 See t/conf/treefromfile.yml
55  
56 TreePath:
57 debug: 0
58 backend:
59 name: File
60  
61  
62 =head1 AUTHOR
63  
64 Daniel Brosseau, C<< <dab at catapulse.org> >>
65  
66 =head1 LICENSE AND COPYRIGHT
67  
68 Copyright 2014 Daniel Brosseau.
69  
70 This program is free software; you can redistribute it and/or modify it
71 under the terms of either: the GNU General Public License as published
72 by the Free Software Foundation; or the Artistic License.
73  
74 See http://dev.perl.org/licenses/ for more information.
75  
76  
77 =cut
78  
79 3 1;
« TreePath.pm ↑ Summary