| line | stmt | bran | cond | sub | pod | time | code | 
| 1 |  |  |  |  |  |  | package EPublisher::Target; | 
| 2 |  |  |  |  |  |  |  | 
| 3 |  |  |  |  |  |  | # ABSTRACT: Container for Target plugins | 
| 4 |  |  |  |  |  |  |  | 
| 5 | 6 |  |  | 6 |  | 795 | use strict; | 
|  | 6 |  |  |  |  | 9 |  | 
|  | 6 |  |  |  |  | 190 |  | 
| 6 | 6 |  |  | 6 |  | 30 | use warnings; | 
|  | 6 |  |  |  |  | 11 |  | 
|  | 6 |  |  |  |  | 143 |  | 
| 7 | 6 |  |  | 6 |  | 29 | use Carp; | 
|  | 6 |  |  |  |  | 17 |  | 
|  | 6 |  |  |  |  | 1132 |  | 
| 8 |  |  |  |  |  |  |  | 
| 9 |  |  |  |  |  |  | our $VERSION = 0.01; | 
| 10 |  |  |  |  |  |  |  | 
| 11 |  |  |  |  |  |  | sub new{ | 
| 12 | 5 |  |  | 5 | 1 | 1221 | my ($class,$args) = @_; | 
| 13 | 5 |  |  |  |  | 9 | my $self; | 
| 14 |  |  |  |  |  |  |  | 
| 15 | 5 |  |  |  |  | 16 | my $plugin = 'EPublisher::Target::Plugin::' . $args->{type}; | 
| 16 | 5 |  |  |  |  | 11 | eval{ | 
| 17 | 5 |  |  |  |  | 29 | (my $file = $plugin) =~ s!::!/!g; | 
| 18 | 5 |  |  |  |  | 16 | $file .= '.pm'; | 
| 19 |  |  |  |  |  |  |  | 
| 20 | 5 |  |  |  |  | 2375 | require $file; | 
| 21 | 4 |  |  |  |  | 51 | $self = $plugin->new( $args ); | 
| 22 |  |  |  |  |  |  | }; | 
| 23 |  |  |  |  |  |  |  | 
| 24 | 5 | 100 |  |  |  | 208 | croak "Problems with $plugin: $@" if $@; | 
| 25 |  |  |  |  |  |  |  | 
| 26 | 4 |  |  |  |  | 16 | return $self; | 
| 27 |  |  |  |  |  |  | } | 
| 28 |  |  |  |  |  |  |  | 
| 29 |  |  |  |  |  |  | 1; | 
| 30 |  |  |  |  |  |  |  | 
| 31 |  |  |  |  |  |  | __END__ |