line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package EPublisher::Target::Plugin::Text; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
# ABSTRACT: Use Ascii text as a target for EPublisher |
4
|
|
|
|
|
|
|
|
5
|
5
|
|
|
5
|
|
74766
|
use strict; |
|
5
|
|
|
|
|
23
|
|
|
5
|
|
|
|
|
180
|
|
6
|
5
|
|
|
5
|
|
30
|
use warnings; |
|
5
|
|
|
|
|
10
|
|
|
5
|
|
|
|
|
180
|
|
7
|
|
|
|
|
|
|
|
8
|
5
|
|
|
5
|
|
37
|
use Carp; |
|
5
|
|
|
|
|
10
|
|
|
5
|
|
|
|
|
347
|
|
9
|
5
|
|
|
5
|
|
36
|
use File::Basename; |
|
5
|
|
|
|
|
11
|
|
|
5
|
|
|
|
|
370
|
|
10
|
5
|
|
|
5
|
|
3031
|
use File::Temp; |
|
5
|
|
|
|
|
72316
|
|
|
5
|
|
|
|
|
445
|
|
11
|
5
|
|
|
5
|
|
946
|
use IO::String; |
|
5
|
|
|
|
|
5182
|
|
|
5
|
|
|
|
|
162
|
|
12
|
5
|
|
|
5
|
|
3231
|
use Pod::Text; |
|
5
|
|
|
|
|
221234
|
|
|
5
|
|
|
|
|
468
|
|
13
|
|
|
|
|
|
|
|
14
|
5
|
|
|
5
|
|
1188
|
use EPublisher; |
|
5
|
|
|
|
|
16
|
|
|
5
|
|
|
|
|
143
|
|
15
|
5
|
|
|
5
|
|
2514
|
use EPublisher::Target::Base; |
|
5
|
|
|
|
|
17
|
|
|
5
|
|
|
|
|
1407
|
|
16
|
|
|
|
|
|
|
our @ISA = qw(EPublisher::Target::Base); |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
our $VERSION = 0.03; |
19
|
|
|
|
|
|
|
our $DEBUG = 0; |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub deploy { |
22
|
6
|
|
|
6
|
1
|
1075
|
my ($self, $sources) = @_; |
23
|
|
|
|
|
|
|
|
24
|
6
|
|
100
|
|
|
34
|
my $pods = $sources || $self->_config->{source}; |
25
|
6
|
|
100
|
|
|
21
|
my $width = $self->_config->{width} || 78; |
26
|
6
|
|
|
|
|
21
|
my $sentence = $self->_config->{sentence}; |
27
|
6
|
|
|
|
|
20
|
my $output = $self->_config->{output}; |
28
|
|
|
|
|
|
|
|
29
|
6
|
100
|
|
|
|
26
|
$pods = [] if !defined $pods; |
30
|
6
|
100
|
|
|
|
37
|
$pods = [ { pod => $pods } ] if !ref $pods; |
31
|
|
|
|
|
|
|
|
32
|
6
|
100
|
|
|
|
26
|
return if 'ARRAY' ne ref $pods; |
33
|
5
|
100
|
|
|
|
11
|
return if !@{ $pods }; |
|
5
|
|
|
|
|
20
|
|
34
|
|
|
|
|
|
|
|
35
|
4
|
100
|
|
|
|
16
|
if ( !$output ) { |
36
|
1
|
|
|
|
|
13
|
my $fh = File::Temp->new; |
37
|
1
|
|
|
|
|
1264
|
$output = $fh->filename; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
4
|
|
|
|
|
317
|
my $io = IO::String->new( join "\n\n", map{ $_->{pod} }@{$pods} ); |
|
4
|
|
|
|
|
61
|
|
|
4
|
|
|
|
|
13
|
|
41
|
4
|
|
|
|
|
334
|
my $parser = Pod::Text->new( sentence => $sentence, width => $width ); |
42
|
|
|
|
|
|
|
|
43
|
4
|
|
|
|
|
760
|
$parser->parse_from_filehandle( $io, $output ); |
44
|
|
|
|
|
|
|
|
45
|
4
|
|
|
|
|
5876
|
return $output; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
1; |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
__END__ |