line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package EPublisher::Target; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# ABSTRACT: Container for Target plugins |
4
|
|
|
|
|
|
|
|
5
|
10
|
|
|
10
|
|
66352
|
use strict; |
|
10
|
|
|
|
|
30
|
|
|
10
|
|
|
|
|
311
|
|
6
|
10
|
|
|
10
|
|
49
|
use warnings; |
|
10
|
|
|
|
|
19
|
|
|
10
|
|
|
|
|
263
|
|
7
|
10
|
|
|
10
|
|
62
|
use Carp; |
|
10
|
|
|
|
|
16
|
|
|
10
|
|
|
|
|
2035
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = 0.02; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub new{ |
12
|
6
|
|
|
6
|
1
|
1523
|
my ($class,$args) = @_; |
13
|
6
|
|
|
|
|
13
|
my $self; |
14
|
|
|
|
|
|
|
|
15
|
6
|
100
|
|
|
|
208
|
croak 'No target type given' if !$args->{type}; |
16
|
|
|
|
|
|
|
|
17
|
5
|
|
|
|
|
21
|
my $plugin = 'EPublisher::Target::Plugin::' . $args->{type}; |
18
|
5
|
|
|
|
|
9
|
eval{ |
19
|
5
|
|
|
|
|
32
|
(my $file = $plugin) =~ s!::!/!g; |
20
|
5
|
|
|
|
|
15
|
$file .= '.pm'; |
21
|
|
|
|
|
|
|
|
22
|
5
|
|
|
|
|
2469
|
require $file; |
23
|
4
|
|
|
|
|
76
|
$self = $plugin->new( $args ); |
24
|
|
|
|
|
|
|
}; |
25
|
|
|
|
|
|
|
|
26
|
5
|
100
|
|
|
|
258
|
croak "Problems with $plugin: $@" if $@; |
27
|
|
|
|
|
|
|
|
28
|
4
|
|
|
|
|
19
|
return $self; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
1; |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
__END__ |