line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Cot::Plugin; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
1201
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
28
|
|
4
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
20
|
|
5
|
1
|
|
|
1
|
|
24
|
use 5.008005; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
43
|
|
6
|
|
|
|
|
|
|
our $VERSION = "0.11"; |
7
|
|
|
|
|
|
|
$VERSION = eval $VERSION; |
8
|
1
|
|
|
1
|
|
4
|
use Carp; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
245
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub import { |
11
|
2
|
|
|
2
|
|
21
|
my $class = shift; |
12
|
2
|
|
|
|
|
4
|
my $pkg = caller(0); |
13
|
2
|
100
|
|
|
|
10
|
if ( $class eq 'Cot::Plugin' ) { |
14
|
1
|
|
|
|
|
3
|
foreach (@_) { |
15
|
0
|
|
|
|
|
0
|
my $klass = "Cot::Plugin::$_"; |
16
|
0
|
0
|
|
|
|
0
|
eval "require $klass" or croak "Plugin[$_] is not installed."; |
17
|
0
|
|
|
|
|
0
|
$klass->_regist($pkg); |
18
|
|
|
|
|
|
|
} |
19
|
1
|
|
|
|
|
7
|
return; |
20
|
|
|
|
|
|
|
} |
21
|
1
|
|
|
|
|
6
|
$class->_regist($pkg); |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub _regist { |
25
|
1
|
|
|
1
|
|
3
|
my ( $class, $pkg ) = @_; |
26
|
1
|
50
|
|
|
|
12
|
croak "$pkg is not Cot object[$class importing...]" |
27
|
|
|
|
|
|
|
unless $pkg->isa('Cot'); |
28
|
1
|
|
|
|
|
8
|
$pkg->_register_plugin($class); |
29
|
|
|
|
|
|
|
} |
30
|
1
|
|
|
1
|
0
|
8
|
sub new { bless {}, shift; } |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub init { |
33
|
0
|
|
|
0
|
0
|
|
my ( $self, $c ) = @_; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
1; |
37
|
|
|
|
|
|
|
__END__ |