line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package EPublisher::Source; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# ABSTRACT: Container for Source plugins |
4
|
|
|
|
|
|
|
|
5
|
16
|
|
|
16
|
|
71167
|
use strict; |
|
16
|
|
|
|
|
44
|
|
|
16
|
|
|
|
|
478
|
|
6
|
16
|
|
|
16
|
|
83
|
use warnings; |
|
16
|
|
|
|
|
28
|
|
|
16
|
|
|
|
|
398
|
|
7
|
16
|
|
|
16
|
|
74
|
use Carp; |
|
16
|
|
|
|
|
30
|
|
|
16
|
|
|
|
|
3258
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = 0.02; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub new{ |
12
|
21
|
|
|
21
|
1
|
9056
|
my ($class,$args) = @_; |
13
|
21
|
|
|
|
|
45
|
my $self; |
14
|
|
|
|
|
|
|
|
15
|
21
|
100
|
|
|
|
279
|
croak 'No source type given' if !$args->{type}; |
16
|
|
|
|
|
|
|
|
17
|
20
|
|
|
|
|
68
|
my $plugin = 'EPublisher::Source::Plugin::' . $args->{type}; |
18
|
20
|
|
|
|
|
37
|
eval{ |
19
|
20
|
|
|
|
|
124
|
(my $file = $plugin) =~ s!::!/!g; |
20
|
20
|
|
|
|
|
60
|
$file .= '.pm'; |
21
|
|
|
|
|
|
|
|
22
|
20
|
|
|
|
|
5562
|
require $file; |
23
|
19
|
|
|
|
|
220
|
$self = $plugin->new( $args ); |
24
|
|
|
|
|
|
|
}; |
25
|
|
|
|
|
|
|
|
26
|
20
|
100
|
|
|
|
276
|
croak "Problems with $plugin: $@" if $@; |
27
|
|
|
|
|
|
|
|
28
|
19
|
|
|
|
|
77
|
return $self; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
1; |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
__END__ |