| 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"
MC/DC0%0/1
$self->{"ending"} //= ".yml"
$self->{"ending"}
Truth table0%0/2
A
A= $self->{"ending"}
| |||||||||||||
| 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
| |||||||||||||
| 65 | 0 | return YAML::XS::DumpFile( $dir . $self->extension, $data ); | |||||||||||
| 66 | } | ||||||||||||
| 67 | |||||||||||||
| 68 | 2 | 1; # End of Geoffrey::Changelog | |||||||||||
| 69 | |||||||||||||
| 70 | __END__ | ||||||||||||