| 1 | package Geoffrey::Changelog::None; | ||||||||||||
| 2 | |||||||||||||
| 3 | 3 | ▶ | use utf8; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 4 | 3 | ▶ | use 5.016; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 5 | 3 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 6 | 3 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 7 | 3 | ▶ | use File::Slurp qw/write_file read_file/; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 8 | 3 | ▶ | use Data::Dumper; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 9 | |||||||||||||
| 10 | 3 | $Geoffrey::Changelog::None::VERSION = '0.000206'; | |||||||||||
| 11 | |||||||||||||
| 12 | 3 | ▶ | use parent 'Geoffrey::Role::Changelog'; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 13 | |||||||||||||
| 14 | 4 | ▶ | sub new { | ||||||||||
|
Subroutine
new: called CC=3 SCAR=11.3
Pod
documented
| |||||||||||||
| 15 | 4 | my $class = shift; | |||||||||||
| 16 | 4 | my $self = $class->SUPER::new(@_); | |||||||||||
| 17 | 4 | ▶ | $self->{ending} //= '.pl'; | ||||||||||
|
Condition50%1/2
$self->{"ending"} //= ".pl"
MC/DC0%0/1
$self->{"ending"} //= ".pl"
$self->{"ending"}
Truth table50%1/2
A
A= $self->{"ending"}
| |||||||||||||
| 18 | 4 | ▶ | $self->{from_hash} //= 0; | ||||||||||
|
Condition50%1/2
$self->{"from_hash"} //= 0
MC/DC0%0/1
$self->{"from_hash"} //= 0
$self->{"from_hash"}
Truth table50%1/2
A
A= $self->{"from_hash"}
| |||||||||||||
| 19 | 4 | return bless $self, $class; | |||||||||||
| 20 | } | ||||||||||||
| 21 | |||||||||||||
| 22 | 6 | ▶ | sub from_hash { | ||||||||||
|
Subroutine
from_hash: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||||
| 23 | 6 | my ( $self, $b_load_from_hash ) = @_; | |||||||||||
| 24 | 6 | ▶ | return $self->{from_hash} if !defined $b_load_from_hash; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 25 | 1 | $self->{from_hash} = $b_load_from_hash; | |||||||||||
| 26 | 1 | return $self; | |||||||||||
| 27 | } | ||||||||||||
| 28 | |||||||||||||
| 29 | 1 | ▶ | sub tpl_main { | ||||||||||
|
Subroutine
tpl_main: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||
| 30 | return { | ||||||||||||
| 31 | 1 | templates => [ | |||||||||||
| 32 | { | ||||||||||||
| 33 | name => 'tpl_std', | ||||||||||||
| 34 | columns => [ { name => 'id', type => 'integer', notnull => 1, primarykey => 1, default => 'inc', }, ], | ||||||||||||
| 35 | }, | ||||||||||||
| 36 | ], | ||||||||||||
| 37 | prefix => 'smpl', | ||||||||||||
| 38 | postfix => 'end', | ||||||||||||
| 39 | changelogs => [ '01', ], | ||||||||||||
| 40 | }; | ||||||||||||
| 41 | } | ||||||||||||
| 42 | |||||||||||||
| 43 | 1 | ▶ | sub tpl_sub { | ||||||||||
|
Subroutine
tpl_sub: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||
| 44 | return [ | ||||||||||||
| 45 | { | ||||||||||||
| 46 | 1 | id => '001.01-maz', | |||||||||||
| 47 | author => 'Mario Zieschang', | ||||||||||||
| 48 | entries => [ { action => 'table.add', name => 'client', template => 'tpl_std', columns => [], }, ], | ||||||||||||
| 49 | } | ||||||||||||
| 50 | ]; | ||||||||||||
| 51 | } | ||||||||||||
| 52 | |||||||||||||
| 53 | 5 | ▶ | sub load { | ||||||||||
|
Subroutine
load: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||||
| 54 | 5 | my ( $self, $ur_file_structure ) = @_; | |||||||||||
| 55 | 5 | ▶ | return $self->from_hash ? $ur_file_structure : do( $ur_file_structure . $self->ending() ); | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 56 | } | ||||||||||||
| 57 | |||||||||||||
| 58 | 4 | ▶ | sub write { | ||||||||||
|
Subroutine
write: called CC=2 SCAR=7.4
Pod
documented
| |||||||||||||
| 59 | 4 | my ( $self, $dir, $hr_data, $b_dump ) = @_; | |||||||||||
| 60 | 4 | my $s_file = $dir . $self->ending; | |||||||||||
| 61 | 4 | $hr_data = Data::Dumper->new( [$hr_data] )->Terse(1)->Deparse(1)->Sortkeys(1)->Dump; | |||||||||||
| 62 | 4 | ▶ | return $hr_data if $b_dump; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 63 | 0 | return write_file( $s_file, $hr_data ); | |||||||||||
| 64 | } | ||||||||||||
| 65 | |||||||||||||
| 66 | 3 | 1; # End of Geoffrey::Changelog | |||||||||||
| 67 | |||||||||||||
| 68 | __END__ | ||||||||||||