blib/lib/HTML/HTMLDoc/PDF.pm

filter: Statementstmt 47.2% 17 / 36 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 62.5% 5 / 8 Podpod 66.6% 2 / 3 totaltotal 47.0% 24 / 51 CC 3 SCAR 11.3
CC
3
Cov
42%
new
6.0
to_file
6.0
to_string
2.0
CRAP 3.1
« blib/lib/HTML/HTMLDoc.pm ↑ Summary Build »
1 package HTML::HTMLDoc::PDF;
2  
3 1 ▶use 5.006;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use IO::File;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶use vars qw(@ISA $VERSION);
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 1 @ISA = qw();
10 1 $VERSION = '0.19';
11  
12 ###############
13 # create a new Object
14 # param:
15 # return: object:HTML::HTMLDOC
16 ###############
17 sub new {
18 0 ▶ my $package = shift;
Subroutine new: not called CC=2 SCAR=17.9
Pod undocumented
19 0 my $contentref = shift;
20
21 0 ▶ return undef if (ref($contentref) ne 'SCALAR');
Branch: 1 branch
BranchTrueFalseTotal
if ref $contentref ne "SCALAR" 0 0 0
22  
23 0 my $self = {};
24 0 bless($self, $package);
25  
26 0 $self->{'content'} = $contentref;
27 0 return $self;
28 }
29  
30 ###############
31 # returns the content as string
32 # param:
33 # return: conent:STRING
34 ###############
35 sub to_string {
36 0 ▶ my $self = shift;
Subroutine to_string: not called CC=1 SCAR=6.9
Pod documented
37 0 return ${$self->{'content'}};
38 }
39  
40 ###############
41 # writes the output to a file
42 # specified by filename
43 # param: filename|STRING
44 # return:
45 ###############
46 sub to_file {
47 0 ▶ my $self = shift;
Subroutine to_file: not called CC=2 SCAR=17.9
Pod documented
48 0 my $filename = shift;
49
50 0 my $file = new IO::File($filename, "w");
51 0 ▶ if (!$file) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($file) 0 0 0
52 0 return 0;
53 }
54 0 print $file ${$self->{'content'}};
55 0 $file->close();
56 0 return 1;
57 }
58  
59 1 1;
60 __END__
« blib/lib/HTML/HTMLDoc.pm ↑ Summary Build »