line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Geoffrey::Changeset; |
2
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
21082
|
use utf8; |
|
3
|
|
|
|
|
19
|
|
|
3
|
|
|
|
|
15
|
|
4
|
3
|
|
|
3
|
|
124
|
use 5.016; |
|
3
|
|
|
|
|
10
|
|
5
|
3
|
|
|
3
|
|
19
|
use strict; |
|
3
|
|
|
|
|
17
|
|
|
3
|
|
|
|
|
74
|
|
6
|
3
|
|
|
3
|
|
18
|
use warnings; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
95
|
|
7
|
3
|
|
|
3
|
|
526
|
use Geoffrey::Utils; |
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
151
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
$Geoffrey::Changeset::VERSION = '0.000205'; |
10
|
|
|
|
|
|
|
|
11
|
3
|
|
|
3
|
|
448
|
use parent 'Geoffrey::Role::Core'; |
|
3
|
|
|
|
|
352
|
|
|
3
|
|
|
|
|
27
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub action { |
14
|
36
|
|
|
36
|
1
|
75
|
my ( $self, $s_action ) = @_; |
15
|
36
|
|
|
|
|
119
|
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
|
|
|
|
|
8
|
$_[0]->{postfix} = $_[1]; |
26
|
3
|
|
|
|
|
10
|
return $_[0]->{postfix}; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub prefix { |
30
|
3
|
50
|
0
|
3
|
1
|
427
|
return $_[0]->{prefix} // q~~ if !defined $_[1]; |
31
|
3
|
|
|
|
|
12
|
$_[0]->{prefix} = $_[1]; |
32
|
3
|
|
|
|
|
10
|
return $_[0]->{prefix}; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub template { |
36
|
37
|
100
|
100
|
37
|
1
|
224
|
return $_[0]->{template} // q~~ if !defined $_[1]; |
37
|
1
|
|
|
|
|
3
|
$_[0]->{template} = $_[1]; |
38
|
1
|
|
|
|
|
3
|
return $_[0]->{template}; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub handle_entry { |
42
|
36
|
|
|
36
|
1
|
71
|
my ( $self, $hr_entry ) = @_; |
43
|
36
|
50
|
|
|
|
81
|
return unless $hr_entry; |
44
|
36
|
50
|
|
|
|
94
|
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
|
|
|
|
|
145
|
my ( $s_sub, $s_action ) = Geoffrey::Utils::parse_package_sub( delete $hr_entry->{action} ); |
49
|
36
|
|
|
|
|
118
|
my $o_action = $self->action($s_action); |
50
|
35
|
100
|
66
|
|
|
332
|
if ( !$s_sub || !$o_action->can($s_sub) ) { |
51
|
1
|
|
|
|
|
544
|
require Geoffrey::Exception::RequiredValue; |
52
|
1
|
|
|
|
|
5
|
Geoffrey::Exception::RequiredValue::throw_action_sub($s_action); |
53
|
|
|
|
|
|
|
} |
54
|
34
|
100
|
|
|
|
114
|
$o_action->dryrun(1) if delete $hr_entry->{dryrun}; |
55
|
34
|
|
|
|
|
122
|
my $result = $o_action->$s_sub($hr_entry); |
56
|
12
|
|
|
|
|
73
|
$o_action->dryrun(0); |
57
|
12
|
|
|
|
|
135
|
return $result; |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
sub handle_entries { |
62
|
30
|
|
|
30
|
1
|
1087
|
my ( $self, $ar_entries ) = @_; |
63
|
30
|
50
|
|
|
|
85
|
return unless $ar_entries; |
64
|
30
|
|
|
|
|
45
|
$self->handle_entry($_) for ( @{$ar_entries} ); |
|
30
|
|
|
|
|
106
|
|
65
|
6
|
|
|
|
|
18
|
return scalar @{$ar_entries}; |
|
6
|
|
|
|
|
22
|
|
66
|
|
|
|
|
|
|
} |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
1; # End of Geoffrey::Changeset |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
__END__ |