line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package DCI::Meta; |
2
|
28
|
|
|
28
|
|
277
|
use strict; |
|
28
|
|
|
|
|
56
|
|
|
28
|
|
|
|
|
913
|
|
3
|
28
|
|
|
28
|
|
166
|
use warnings; |
|
28
|
|
|
|
|
49
|
|
|
28
|
|
|
|
|
4312
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
sub before_import { |
6
|
35
|
|
|
35
|
1
|
47265
|
my $class = shift; |
7
|
35
|
|
|
|
|
70
|
my ( $importer ) = @_; |
8
|
35
|
|
|
|
|
226
|
return $class->new( $importer ); |
9
|
|
|
|
|
|
|
} |
10
|
|
|
|
|
|
|
|
11
|
0
|
|
|
0
|
0
|
0
|
sub base { die "must override base()" } |
12
|
151
|
|
|
151
|
1
|
649
|
sub target { shift->{target} } |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub make_subclass { |
15
|
69
|
|
|
69
|
1
|
147
|
my $self = shift; |
16
|
69
|
|
|
|
|
112
|
my ( $target ) = @_; |
17
|
28
|
|
|
28
|
|
174
|
no strict 'refs'; |
|
28
|
|
|
|
|
49
|
|
|
28
|
|
|
|
|
5811
|
|
18
|
69
|
|
|
|
|
112
|
push @{ "$target\::ISA" } => $self->base; |
|
69
|
|
|
|
|
768
|
|
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub new { |
22
|
69
|
|
|
69
|
1
|
168
|
my $class = shift; |
23
|
69
|
|
|
|
|
128
|
my ( $target ) = @_; |
24
|
|
|
|
|
|
|
|
25
|
69
|
|
|
|
|
313
|
my $self = bless { target => $target }, $class; |
26
|
|
|
|
|
|
|
|
27
|
69
|
|
|
|
|
385
|
$self->make_subclass( $target ); |
28
|
69
|
|
|
329
|
|
590
|
$self->inject( $target, 'dci_meta' => sub { $self }); |
|
329
|
|
|
|
|
5983
|
|
29
|
|
|
|
|
|
|
|
30
|
69
|
50
|
|
|
|
648
|
$self->init() if $self->can( 'init' ); |
31
|
|
|
|
|
|
|
|
32
|
69
|
|
|
|
|
355
|
return $self; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub inject { |
36
|
252
|
|
|
252
|
1
|
393
|
my $self = shift; |
37
|
252
|
|
|
|
|
629
|
my ( $target, $name, $sub ) = @_; |
38
|
28
|
|
|
28
|
|
165
|
no strict 'refs'; |
|
28
|
|
|
|
|
193
|
|
|
28
|
|
|
|
|
1738
|
|
39
|
252
|
|
|
|
|
290
|
*{ "$target\::$name" } = $sub; |
|
252
|
|
|
|
|
2068
|
|
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
1; |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
__END__ |