File Coverage

blib/lib/App/optex/textconv/ooxml.pm
Criterion Covered Total %
statement 16 17 94.1
branch 1 2 50.0
condition n/a
subroutine 5 5 100.0
pod n/a
total 22 24 91.6


line stmt bran cond sub pod time code
1             package App::optex::textconv::ooxml;
2              
3             our $VERSION = '0.14';
4              
5 1     1   18 use v5.14;
  1         3  
6 1     1   5 use warnings;
  1         2  
  1         27  
7 1     1   4 use Carp;
  1         4  
  1         138  
8              
9 1     1   9 use App::optex::textconv::Converter 'import';
  1         1  
  1         6  
10              
11             our @CONVERTER;
12              
13             BEGIN {
14              
15 1     1   8 require App::optex::textconv::ooxml::regex;
16              
17 1         3 eval { require App::optex::textconv::ooxml::xslt };
  1         501  
18 1 50       14 if ($@) {
19 1         46 @CONVERTER = (
20             [ qr/\.doc[xm]$/ => \&App::optex::textconv::ooxml::xslt::to_text ],
21             [ qr/\.ppt[xm]$/ => \&App::optex::textconv::ooxml::xslt::to_text ],
22             [ qr/\.xls[xm]$/ => \&App::optex::textconv::ooxml::regex::to_text ],
23             );
24             } else {
25 0           @CONVERTER = (
26             [ qr/\.doc[xm]$/ => \&App::optex::textconv::ooxml::regex::to_text ],
27             [ qr/\.ppt[xm]$/ => \&App::optex::textconv::ooxml::regex::to_text ],
28             [ qr/\.xls[xm]$/ => \&App::optex::textconv::ooxml::regex::to_text ],
29             );
30             }
31              
32             }
33              
34             1;