line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Salvation::PluginCore; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
2230
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
25
|
|
4
|
1
|
|
|
1
|
|
3
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
19
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
3
|
use base 'Salvation::PluginCore::Object'; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
334
|
|
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
25
|
use Module::Load 'load'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
9
|
1
|
|
|
1
|
|
43
|
use Scalar::Util 'weaken'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
43
|
|
10
|
1
|
|
|
1
|
|
3
|
use Salvation::TC (); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
11
|
|
11
|
1
|
|
|
1
|
|
324
|
use String::CamelCase 'camelize'; |
|
1
|
|
|
|
|
327
|
|
|
1
|
|
|
|
|
41
|
|
12
|
1
|
|
|
1
|
|
4
|
use Salvation::Method::Signatures; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
4
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
our $VERSION = 0.01; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
|
17
|
1
|
50
|
|
1
|
|
899
|
method load_plugin( Str{1,} :infix!, Str{1,} :base_name! ) { |
|
1
|
50
|
|
1
|
|
48
|
|
|
1
|
|
|
2
|
|
1
|
|
|
1
|
|
|
|
|
194
|
|
|
2
|
|
|
|
|
274
|
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
8
|
|
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
10
|
|
|
2
|
|
|
|
|
295
|
|
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
51
|
|
|
2
|
|
|
|
|
3
|
|
18
|
|
|
|
|
|
|
|
19
|
2
|
|
|
|
|
6
|
$base_name = camelize( $base_name ); |
20
|
|
|
|
|
|
|
|
21
|
2
|
|
|
|
|
24
|
foreach my $class ( @{ $self -> linearized_isa() } ) { |
|
2
|
|
|
|
|
5
|
|
22
|
|
|
|
|
|
|
|
23
|
2
|
|
|
|
|
3
|
my $base_class = "${class}::${infix}"; |
24
|
2
|
|
|
|
|
4
|
my $plugin = "${base_class}::${base_name}"; |
25
|
|
|
|
|
|
|
|
26
|
2
|
|
|
|
|
3
|
my $base_name = "${infix}::${base_name}"; |
27
|
|
|
|
|
|
|
|
28
|
2
|
50
|
|
|
|
2
|
if( eval{ load $plugin; 1 } ) { |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
772
|
|
29
|
|
|
|
|
|
|
|
30
|
2
|
|
|
|
|
5
|
weaken( my $weak = $self ); |
31
|
|
|
|
|
|
|
|
32
|
2
|
|
|
|
|
14
|
$plugin = $plugin -> new( core => $weak, base_name => $base_name ); |
33
|
2
|
|
|
|
|
4
|
Salvation::TC -> assert( $plugin, $base_class ); |
34
|
|
|
|
|
|
|
|
35
|
2
|
|
|
|
|
454
|
return $plugin; |
36
|
0
|
|
|
|
|
0
|
} warn $@; |
37
|
|
|
|
|
|
|
} |
38
|
|
|
|
|
|
|
|
39
|
0
|
|
|
|
|
0
|
return undef; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
1
|
|
|
1
|
|
253
|
method linearized_isa() { |
|
2
|
|
|
2
|
|
2
|
|
|
2
|
|
|
|
|
20
|
|
43
|
|
|
|
|
|
|
|
44
|
2
|
|
|
|
|
10
|
return $self -> lazy( 'linearized_isa' ); |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
1
|
|
|
1
|
|
286
|
method build_linearized_isa() { |
|
1
|
|
|
1
|
|
1
|
|
|
1
|
|
|
|
|
1
|
|
48
|
|
|
|
|
|
|
|
49
|
1
|
|
|
|
|
2
|
my @out = (); |
50
|
1
|
|
|
|
|
1
|
my %seen = (); |
51
|
1
|
|
33
|
|
|
3
|
my @stack = ( ( ref( $self ) || $self ) ); |
52
|
|
|
|
|
|
|
|
53
|
1
|
|
|
|
|
3
|
while( defined( my $class = shift( @stack ) ) ) { |
54
|
|
|
|
|
|
|
|
55
|
2
|
50
|
|
|
|
6
|
next if $seen{ $class } ++; |
56
|
|
|
|
|
|
|
|
57
|
2
|
|
|
|
|
1
|
push( @out, $class ); |
58
|
|
|
|
|
|
|
|
59
|
2
|
|
|
|
|
3
|
my $isa = "${class}::ISA"; |
60
|
|
|
|
|
|
|
|
61
|
1
|
|
|
1
|
|
91
|
no strict 'refs'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
29
|
|
62
|
|
|
|
|
|
|
|
63
|
2
|
|
|
|
|
2
|
push( @stack, @{ *$isa } ); |
|
2
|
|
|
|
|
9
|
|
64
|
|
|
|
|
|
|
} |
65
|
|
|
|
|
|
|
|
66
|
1
|
|
|
|
|
5
|
return \@out; |
67
|
|
|
|
|
|
|
} |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
1; |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
__END__ |