line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Geoffrey::Changeset; |
2
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
21944
|
use utf8; |
|
3
|
|
|
|
|
21
|
|
|
3
|
|
|
|
|
18
|
|
4
|
3
|
|
|
3
|
|
120
|
use 5.016; |
|
3
|
|
|
|
|
9
|
|
5
|
3
|
|
|
3
|
|
17
|
use strict; |
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
73
|
|
6
|
3
|
|
|
3
|
|
18
|
use warnings; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
90
|
|
7
|
3
|
|
|
3
|
|
523
|
use Geoffrey::Utils; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
161
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
$Geoffrey::Changeset::VERSION = '0.000203'; |
10
|
|
|
|
|
|
|
|
11
|
3
|
|
|
3
|
|
587
|
use parent 'Geoffrey::Role::Core'; |
|
3
|
|
|
|
|
303
|
|
|
3
|
|
|
|
|
22
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub action { |
14
|
36
|
|
|
36
|
1
|
105
|
my ( $self, $s_action ) = @_; |
15
|
36
|
|
|
|
|
148
|
return Geoffrey::Utils::action_obj_from_name( |
16
|
|
|
|
|
|
|
$s_action, |
17
|
|
|
|
|
|
|
dbh => $self->dbh, |
18
|
|
|
|
|
|
|
converter => $self->converter, |
19
|
|
|
|
|
|
|
template => $self->template, |
20
|
|
|
|
|
|
|
); |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub postfix { |
24
|
3
|
50
|
0
|
3
|
1
|
11
|
return $_[0]->{postfix} // q~~ if !defined $_[1]; |
25
|
3
|
|
|
|
|
9
|
$_[0]->{postfix} = $_[1]; |
26
|
3
|
|
|
|
|
11
|
return $_[0]->{postfix}; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub prefix { |
30
|
3
|
50
|
0
|
3
|
1
|
628
|
return $_[0]->{prefix} // q~~ if !defined $_[1]; |
31
|
3
|
|
|
|
|
14
|
$_[0]->{prefix} = $_[1]; |
32
|
3
|
|
|
|
|
11
|
return $_[0]->{prefix}; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub template { |
36
|
37
|
100
|
100
|
37
|
1
|
253
|
return $_[0]->{template} // q~~ if !defined $_[1]; |
37
|
1
|
|
|
|
|
2
|
$_[0]->{template} = $_[1]; |
38
|
1
|
|
|
|
|
3
|
return $_[0]->{template}; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub handle_entry { |
42
|
36
|
|
|
36
|
1
|
84
|
my ( $self, $hr_entry ) = @_; |
43
|
36
|
50
|
|
|
|
95
|
return unless $hr_entry; |
44
|
36
|
50
|
|
|
|
113
|
unless ( $hr_entry->{action} ) { |
45
|
0
|
|
|
|
|
0
|
require Geoffrey::Exception::General; |
46
|
0
|
|
|
|
|
0
|
Geoffrey::Exception::General::throw_no_params( 'handle_entry', 'action', $hr_entry ); |
47
|
|
|
|
|
|
|
} |
48
|
36
|
|
|
|
|
179
|
my ( $s_sub, $s_action ) = Geoffrey::Utils::parse_package_sub( delete $hr_entry->{action} ); |
49
|
36
|
|
|
|
|
143
|
my $o_action = $self->action($s_action); |
50
|
35
|
100
|
66
|
|
|
410
|
if ( !$s_sub || !$o_action->can($s_sub) ) { |
51
|
1
|
|
|
|
|
632
|
require Geoffrey::Exception::RequiredValue; |
52
|
1
|
|
|
|
|
6
|
Geoffrey::Exception::RequiredValue::throw_action_sub($s_action); |
53
|
|
|
|
|
|
|
} |
54
|
34
|
100
|
|
|
|
139
|
$o_action->dryrun(1) if delete $hr_entry->{dryrun}; |
55
|
34
|
|
|
|
|
148
|
my $result = $o_action->$s_sub($hr_entry); |
56
|
12
|
|
|
|
|
103
|
$o_action->dryrun(0); |
57
|
12
|
|
|
|
|
211
|
return $result; |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
sub handle_entries { |
62
|
30
|
|
|
30
|
1
|
1153
|
my ( $self, $ar_entries ) = @_; |
63
|
30
|
50
|
|
|
|
91
|
return unless $ar_entries; |
64
|
30
|
|
|
|
|
51
|
$self->handle_entry($_) for ( @{$ar_entries} ); |
|
30
|
|
|
|
|
116
|
|
65
|
6
|
|
|
|
|
17
|
return scalar @{$ar_entries}; |
|
6
|
|
|
|
|
32
|
|
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
1; # End of Geoffrey::Changeset |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
__END__ |