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
|
|
54653
|
use strict; |
|
5
|
|
|
|
|
18
|
|
|
5
|
|
|
|
|
154
|
|
6
|
5
|
|
|
5
|
|
26
|
use warnings; |
|
5
|
|
|
|
|
10
|
|
|
5
|
|
|
|
|
186
|
|
7
|
|
|
|
|
|
|
|
8
|
5
|
|
|
5
|
|
28
|
use Carp; |
|
5
|
|
|
|
|
15
|
|
|
5
|
|
|
|
|
297
|
|
9
|
5
|
|
|
5
|
|
28
|
use File::Basename; |
|
5
|
|
|
|
|
11
|
|
|
5
|
|
|
|
|
343
|
|
10
|
5
|
|
|
5
|
|
2824
|
use File::Temp; |
|
5
|
|
|
|
|
66354
|
|
|
5
|
|
|
|
|
374
|
|
11
|
5
|
|
|
5
|
|
839
|
use IO::String; |
|
5
|
|
|
|
|
4563
|
|
|
5
|
|
|
|
|
141
|
|
12
|
5
|
|
|
5
|
|
2807
|
use Pod::Text; |
|
5
|
|
|
|
|
207651
|
|
|
5
|
|
|
|
|
426
|
|
13
|
|
|
|
|
|
|
|
14
|
5
|
|
|
5
|
|
965
|
use EPublisher; |
|
5
|
|
|
|
|
15
|
|
|
5
|
|
|
|
|
124
|
|
15
|
5
|
|
|
5
|
|
2363
|
use EPublisher::Target::Base; |
|
5
|
|
|
|
|
16
|
|
|
5
|
|
|
|
|
1279
|
|
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
|
810
|
my ($self, $sources) = @_; |
23
|
|
|
|
|
|
|
|
24
|
6
|
|
100
|
|
|
33
|
my $pods = $sources || $self->_config->{source}; |
25
|
6
|
|
100
|
|
|
17
|
my $width = $self->_config->{width} || 78; |
26
|
6
|
|
|
|
|
15
|
my $sentence = $self->_config->{sentence}; |
27
|
6
|
|
|
|
|
24
|
my $output = $self->_config->{output}; |
28
|
|
|
|
|
|
|
|
29
|
6
|
100
|
|
|
|
28
|
$pods = [] if !defined $pods; |
30
|
6
|
100
|
|
|
|
23
|
$pods = [ { pod => $pods } ] if !ref $pods; |
31
|
|
|
|
|
|
|
|
32
|
6
|
100
|
|
|
|
22
|
return if 'ARRAY' ne ref $pods; |
33
|
5
|
100
|
|
|
|
8
|
return if !@{ $pods }; |
|
5
|
|
|
|
|
18
|
|
34
|
|
|
|
|
|
|
|
35
|
4
|
100
|
|
|
|
16
|
if ( !$output ) { |
36
|
1
|
|
|
|
|
5
|
my $fh = File::Temp->new; |
37
|
1
|
|
|
|
|
546
|
$output = $fh->filename; |
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
4
|
|
|
|
|
239
|
my $io = IO::String->new( join "\n\n", map{ $_->{pod} }@{$pods} ); |
|
4
|
|
|
|
|
58
|
|
|
4
|
|
|
|
|
12
|
|
41
|
4
|
|
|
|
|
283
|
my $parser = Pod::Text->new( sentence => $sentence, width => $width ); |
42
|
|
|
|
|
|
|
|
43
|
4
|
|
|
|
|
707
|
$parser->parse_from_filehandle( $io, $output ); |
44
|
|
|
|
|
|
|
|
45
|
4
|
|
|
|
|
4116
|
return $output; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
1; |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
__END__ |