DOC.pm

filter: Statementstmt 75.0% 18 / 24 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 83.3% 5 / 6 Podpod 100% 1 / 1 totaltotal 72.7% 24 / 33 CC 2 SCAR 8.9
CC
2
Cov
69%
gather_data_from_file
6.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.4
« XLS.pm ↑ Summary PPT.pm »
1 package Plucene::SearchEngine::Index::DOC;
2 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 our $VERSION = '0.001'; # VERSION
5 # ABSTRACT: a Plucene backend for indexing Microsoft Word documents
6 1 ▶use parent qw(Plucene::SearchEngine::Index::Text);
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 ▶use IPC::Run3;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 ▶use File::Temp;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 1 __PACKAGE__->register_handler('application/doc', '.doc');
12  
13  
14 0 ▶sub gather_data_from_file {
Subroutine gather_data_from_file: not called CC=2 SCAR=17.9
Pod documented
15 0 my ($self, $filename) = @_;
16 0 ▶ return unless $filename =~ m/\.doc$/;
Branch: 1 branch
BranchTrueFalseTotal
unless $filename =~ /\.doc$/ 0 0 0
17  
18 0 my $tmp_txt = File::Temp->new();
19 0 run3 ['antiword', $filename],
20 \undef, # stdin is /dev/null
21 $tmp_txt, # some temporary file
22 undef; # inherit the parent's stderr
23 0 $self->gather_data_from_file( $tmp_txt->filename );
24 0 return $self;
25 }
26  
27 1 1;
28  
29 __END__
« XLS.pm ↑ Summary PPT.pm »