line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package EBook::EPUB::Check; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
45821
|
use 5.008_001; |
|
2
|
|
|
|
|
6
|
|
4
|
2
|
|
|
2
|
|
8
|
use strict; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
33
|
|
5
|
2
|
|
|
2
|
|
7
|
use warnings; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
42
|
|
6
|
2
|
|
|
2
|
|
6
|
use Carp (); |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
25
|
|
7
|
2
|
|
|
2
|
|
11
|
use Exporter qw/import/; |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
62
|
|
8
|
2
|
|
|
2
|
|
1107
|
use File::ShareDir (); |
|
2
|
|
|
|
|
9997
|
|
|
2
|
|
|
|
|
35
|
|
9
|
2
|
|
|
2
|
|
1016
|
use IPC::Run3 (); |
|
2
|
|
|
|
|
55589
|
|
|
2
|
|
|
|
|
45
|
|
10
|
2
|
|
|
2
|
|
732
|
use EBook::EPUB::Check::Result (); |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
295
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
our $VERSION = "0.00_02"; |
13
|
|
|
|
|
|
|
our @EXPORT = qw(epubcheck); |
14
|
|
|
|
|
|
|
our @EXPORT_OK = qw(); |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
sub epubcheck |
17
|
|
|
|
|
|
|
{ |
18
|
0
|
|
|
0
|
1
|
|
my ($epub, $jar) = @_; |
19
|
|
|
|
|
|
|
|
20
|
0
|
0
|
|
|
|
|
if (scalar @_ == 1) |
21
|
|
|
|
|
|
|
{ |
22
|
0
|
|
|
|
|
|
$jar = File::ShareDir::dist_file('EBook-EPUB-Check', 'epubcheck-3.0.1/epubcheck-3.0.1.jar'); |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
0
|
0
|
|
|
|
|
Carp::croak('jar file not found') unless -f $jar; |
26
|
|
|
|
|
|
|
|
27
|
0
|
0
|
0
|
|
|
|
if ( ! defined $epub || ! -f $epub ) |
28
|
|
|
|
|
|
|
{ |
29
|
0
|
|
|
|
|
|
Carp::carp('epub file not found'); |
30
|
0
|
|
|
|
|
|
return EBook::EPUB::Check::Result->new(\''); |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
|
33
|
0
|
|
|
|
|
|
my $out; |
34
|
0
|
|
|
|
|
|
my @cmd = ('java', '-jar', $jar, $epub); |
35
|
|
|
|
|
|
|
|
36
|
0
|
|
|
|
|
|
IPC::Run3::run3(\@cmd, \undef, \$out, \$out); |
37
|
|
|
|
|
|
|
|
38
|
0
|
|
|
|
|
|
return EBook::EPUB::Check::Result->new(\$out); |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
1; |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
__END__ |