line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Geoffrey::Changelog::Yaml; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
60170
|
use utf8; |
|
1
|
|
|
|
|
13
|
|
|
1
|
|
|
|
|
5
|
|
4
|
1
|
|
|
1
|
|
39
|
use 5.016; |
|
1
|
|
|
|
|
4
|
|
5
|
1
|
|
|
1
|
|
4
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
15
|
|
6
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
20
|
|
7
|
1
|
|
|
1
|
|
433
|
use YAML::XS; |
|
1
|
|
|
|
|
2481
|
|
|
1
|
|
|
|
|
58
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
$Geoffrey::Changelog::Yaml::VERSION = '0.000100'; |
10
|
|
|
|
|
|
|
|
11
|
1
|
|
|
1
|
|
424
|
use parent 'Geoffrey::Role::Changelog'; |
|
1
|
|
|
|
|
287
|
|
|
1
|
|
|
|
|
4
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub new { |
14
|
0
|
|
|
0
|
1
|
|
my $s_class = shift; |
15
|
0
|
|
|
|
|
|
my $self = $s_class->SUPER::new(@_); |
16
|
0
|
|
0
|
|
|
|
$self->{ending} //= '.yml'; |
17
|
0
|
|
|
|
|
|
return bless $self, $s_class; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub tpl_main { |
21
|
0
|
|
|
0
|
1
|
|
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
|
|
|
|
|
|
|
sub tpl_sub { |
44
|
0
|
|
|
0
|
1
|
|
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
|
|
|
0
|
1
|
|
sub extension { return $_[0]->ending; } |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
sub load { |
58
|
0
|
|
|
0
|
1
|
|
my ( $self, $s_file ) = @_; |
59
|
0
|
|
|
|
|
|
return YAML::XS::LoadFile( $s_file . $self->extension ); |
60
|
|
|
|
|
|
|
} |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
sub write { |
63
|
0
|
|
|
0
|
1
|
|
my ( $self, $dir, $data, $dump ) = @_; |
64
|
0
|
0
|
|
|
|
|
return YAML::XS::Dump($data) if $dump; |
65
|
0
|
|
|
|
|
|
return YAML::XS::DumpFile( $dir . $self->extension, $data ); |
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
1; # End of Geoffrey::Changelog |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
__END__ |