Message/Convert/HtmlFormatPS.pm

filter: Statementstmt 100% 33 / 33 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 9 / 9 Podpod 50.0% 1 / 2 totaltotal 97.7% 43 / 44 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Message/Convert.pm ↑ Summary
1 # This code is part of Perl distribution Mail-Message version 4.05.
2 # The POD got stripped from this file by OODoc version 3.06.
3 # For contributors see file ChangeLog.
4  
5 # This software is copyright (c) 2001-2026 by Mark Overmeer.
6  
7 # This is free software; you can redistribute it and/or modify it under
8 # the same terms as the Perl 5 programming language system itself.
9 # SPDX-License-Identifier: Artistic-1.0-Perl OR GPL-1.0-or-later
10  
11  
12 package Mail::Message::Convert::HtmlFormatPS;{
13 1 our $VERSION = '4.05';
14 }
15  
16 1 ▶use parent 'Mail::Message::Convert';
Subroutine BEGIN: called CC=1 SCAR=0.0
17  
18 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
19 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
20  
21 1 ▶use Log::Report 'mail-message', import => [ qw// ];
Subroutine BEGIN: called CC=1 SCAR=0.0
22  
23 1 ▶use Mail::Message::Body::String ();
Subroutine BEGIN: called CC=1 SCAR=0.0
24  
25 1 ▶use HTML::TreeBuilder ();
Subroutine BEGIN: called CC=1 SCAR=0.0
26 1 ▶use HTML::FormatPS ();
Subroutine BEGIN: called CC=1 SCAR=0.0
27  
28 #--------------------
29  
30 sub init($)
31 1 ▶{ my ($self, $args) = @_;
Subroutine init: called CC=1 SCAR=0.0
Pod undocumented
32 1 my @formopts = map +($_ => delete $args->{$_}), grep m/^[A-Z]/, keys %$args;
33 1 $self->SUPER::init($args);
34  
35 1 $self->{MMCH_formatter} = HTML::FormatPS->new(@formopts);
36 1 $self;
37 }
38  
39 #--------------------
40  
41 sub format($)
42 1 ▶{ my ($self, $body) = @_;
Subroutine format: called CC=1 SCAR=0.0
Pod documented
43  
44 1 my $dec = $body->encode(transfer_encoding => 'none');
45 1 my $tree = HTML::TreeBuilder->new_from_file($dec->file);
46  
47 (ref $body)->new(
48 based_on => $body,
49 mime_type => 'application/postscript',
50 1 data => [ $self->{MMCH_formatter}->format($tree) ],
51 );
52 }
53  
54 1 1;
« Message/Convert.pm ↑ Summary