line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
10
|
|
|
10
|
|
224
|
use 5.008; |
|
10
|
|
|
|
|
44
|
|
|
10
|
|
|
|
|
414
|
|
2
|
10
|
|
|
10
|
|
60
|
use strict; |
|
10
|
|
|
|
|
21
|
|
|
10
|
|
|
|
|
323
|
|
3
|
10
|
|
|
10
|
|
57
|
use warnings; |
|
10
|
|
|
|
|
20
|
|
|
10
|
|
|
|
|
524
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package Hook::Modular::Rule; |
6
|
|
|
|
|
|
|
BEGIN { |
7
|
10
|
|
|
10
|
|
214
|
$Hook::Modular::Rule::VERSION = '1.101050'; |
8
|
|
|
|
|
|
|
} |
9
|
|
|
|
|
|
|
# ABSTRACT: A Workflow rule |
10
|
10
|
|
|
10
|
|
60
|
use UNIVERSAL::require; |
|
10
|
|
|
|
|
22
|
|
|
10
|
|
|
|
|
88
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub new { |
13
|
16
|
|
|
16
|
1
|
25
|
shift; # we don't need the class |
14
|
16
|
|
|
|
|
33
|
my $config = shift; |
15
|
16
|
50
|
|
|
|
99
|
if (my $exp = $config->{expression}) { |
16
|
0
|
|
|
|
|
0
|
$config->{module} = 'Expression'; |
17
|
|
|
|
|
|
|
} |
18
|
16
|
|
|
|
|
48
|
my $module_suffix = delete $config->{module}; |
19
|
16
|
|
|
|
|
29
|
my $module; |
20
|
16
|
|
|
|
|
27
|
my $found = 0; |
21
|
16
|
|
|
|
|
32
|
my @tried; |
22
|
16
|
|
|
|
|
108
|
for my $ns (Hook::Modular->rule_namespaces) { |
23
|
21
|
|
|
|
|
126
|
$module = $ns . '::' . $module_suffix; |
24
|
21
|
|
|
|
|
44
|
push @tried => $module; |
25
|
21
|
100
|
|
|
|
173
|
if ($module->require) { |
26
|
16
|
|
|
|
|
937
|
$found++; |
27
|
16
|
|
|
|
|
46
|
last; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
} |
30
|
16
|
50
|
|
|
|
162
|
$found or die sprintf "can't find any of %s", join(', ' => @tried); |
31
|
16
|
|
|
|
|
98
|
my $self = bless {%$config}, $module; |
32
|
16
|
|
|
|
|
99
|
$self->init; |
33
|
16
|
|
|
|
|
115
|
$self; |
34
|
|
|
|
|
|
|
} |
35
|
16
|
|
|
16
|
1
|
33
|
sub init { } |
36
|
10
|
|
|
10
|
|
2281
|
use constant id => 'xxx'; |
|
10
|
|
|
|
|
23
|
|
|
10
|
|
|
|
|
640
|
|
37
|
10
|
|
|
10
|
|
54
|
use constant as_title => 'xxx'; |
|
10
|
|
|
|
|
23
|
|
|
10
|
|
|
|
|
621
|
|
38
|
|
|
|
|
|
|
1; |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
__END__ |