blib/lib/Geoffrey/Changelog/Yaml.pm

filter: Statementstmt 57.5% 19 / 33 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 50.0% 6 / 12 Podpod 100% 6 / 6 totaltotal 55.3% 31 / 56 CC 3 SCAR 10.0
CC
3
Cov
51%
new
6.0
write
6.0
tpl_main
2.0
CRAP 2.7
↑ Summary
1 package Geoffrey::Changelog::Yaml;
2  
3 2 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use 5.016;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 2 ▶use YAML::XS;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 2 $Geoffrey::Changelog::Yaml::VERSION = '0.000100';
10  
11 2 ▶use parent 'Geoffrey::Role::Changelog';
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 0 ▶sub new {
Subroutine new: not called CC=2 SCAR=17.9
Pod documented
14 0 my $s_class = shift;
15 0 my $self = $s_class->SUPER::new(@_);
16 0 ▶ $self->{ending} //= '.yml';
Condition0%0/2
$self->{"ending"} //= ".yml"
l!l
00
MC/DC0%0/1
$self->{"ending"} //= ".yml"
$self->{"ending"}
Truth table0%0/2
A
A= $self->{"ending"}
Aresult
11
00
17 0 return bless $self, $s_class;
18 }
19  
20 0 ▶sub tpl_main {
Subroutine tpl_main: not called CC=1 SCAR=6.9
Pod documented
21 0 my $s_message = <<'END_MESSAGE';
22  
23 ---
24 templates:
25 - name: tpl_std
26 columns:
27 - name: id
28 type: integer
29 notnull: 1
30 primarykey: 1
31 default: autoincrement
32  
33 prefix: smpl
34 postfix: end
35  
36 changelogs:
37 - "01"
38 END_MESSAGE
39  
40 0 return $s_message;
41 }
42  
43 0 ▶sub tpl_sub {
Subroutine tpl_sub: not called CC=1 SCAR=6.9
Pod documented
44 0 my $s_message = <<'END_MESSAGE';
45 - id: 001.01-maz
46 author: "Mario Zieschang"
47 entries:
48 - action: table.add
49 name: 'client'
50 template: 'tpl_std'
51 END_MESSAGE
52 0 return $s_message;
53 }
54  
55 0 ▶sub extension { return $_[0]->ending; }
Subroutine extension: not called CC=1 SCAR=6.9
Pod documented
56  
57 0 ▶sub load {
Subroutine load: not called CC=1 SCAR=6.9
Pod documented
58 0 my ( $self, $s_file ) = @_;
59 0 return YAML::XS::LoadFile( $s_file . $self->extension );
60 }
61  
62 0 ▶sub write {
Subroutine write: not called CC=2 SCAR=17.9
Pod documented
63 0 my ( $self, $dir, $data, $dump ) = @_;
64 0 ▶ return YAML::XS::Dump($data) if $dump;
Branch: 1 branch
BranchTrueFalseTotal
if $dump 0 0 0
65 0 return YAML::XS::DumpFile( $dir . $self->extension, $data );
66 }
67  
68 2 1; # End of Geoffrey::Changelog
69  
70 __END__
↑ Summary