Message/Convert/HtmlFormatPS.pm

filter: Statementstmt 96.9% 32 / 33 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 9 / 9 Podpod 50.0% 1 / 2 totaltotal 95.4% 42 / 44 SCAR 0.0
CC
1
Cov
97%
init
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Message/Convert.pm ↑ Summary
1 # Copyrights 2001-2023 by [Mark Overmeer <markov@cpan.org>].
2 # For other contributors see ChangeLog.
3 # See the manual pages for details on the licensing terms.
4 # Pod stripped from pm file by OODoc 2.03.
5 # This code is part of distribution Mail-Message. Meta-POD processed with
6 # OODoc into POD and HTML manual-pages. See README.md
7 # Copyright Mark Overmeer. Licensed under the same terms as Perl itself.
8  
9 package Mail::Message::Convert::HtmlFormatPS;
10 1 ▶use vars '$VERSION';
Subroutine BEGIN: called CC=1 SCAR=0.0
11 1 $VERSION = '3.013';
12  
13 1 ▶use base 'Mail::Message::Convert';
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
16 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
17  
18 1 ▶use Mail::Message::Body::String;
Subroutine BEGIN: called CC=1 SCAR=0.0
19  
20 1 ▶use HTML::TreeBuilder;
Subroutine BEGIN: called CC=1 SCAR=0.0
21 1 ▶use HTML::FormatPS;
Subroutine BEGIN: called CC=1 SCAR=0.0
22  
23  
24 sub init($)
25 1 ▶{ my ($self, $args) = @_;
Subroutine init: called CC=1 SCAR=0.0
Pod undocumented
26  
27 1 my @formopts = map { ($_ => delete $args->{$_} ) }
28 grep m/^[A-Z]/, keys %$args;
29  
30 1 $self->SUPER::init($args);
31  
32 1 $self->{MMCH_formatter} = HTML::FormatPS->new(@formopts);
33 1 $self;
34 }
35  
36 #------------------------------------------
37  
38  
39 sub format($)
40 1 ▶{ my ($self, $body) = @_;
Subroutine format: called CC=1 SCAR=0.0
Pod documented
41  
42 1 my $dec = $body->encode(transfer_encoding => 'none');
43 1 my $tree = HTML::TreeBuilder->new_from_file($dec->file);
44  
45 (ref $body)->new
46 ( based_on => $body
47 , mime_type => 'application/postscript'
48 1 , data => [ $self->{MMCH_formatter}->format($tree) ]
49 );
50 }
51  
52 1 1;
« Message/Convert.pm ↑ Summary