File Coverage

blib/lib/App/optex/textconv/ooxml.pm
Criterion Covered Total %
statement 15 16 93.7
branch 1 2 50.0
condition n/a
subroutine 5 5 100.0
pod n/a
total 21 23 91.3


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