lib/Pod/Perldoc/ToANSI.pm

filter: Statementstmt 53.1% 17 / 32 Branchbran 0.0% 0 / 6 Conditioncond 0.0% 0 / 5 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 31.2% 5 / 16 Podpod 0.0% 0 / 11 totaltotal 30.1% 22 / 73 CC 6 SCAR 21.8
CC
6
Cov
40%
parse_from_file
30.0
new
6.0
is_pageable
2.0
CRAP 8.8
« lib/Pod/Perldoc/ToMan.pm ↑ Summary lib/Pod/Perldoc/ToText.pm »
1 package Pod::Perldoc::ToANSI;
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 ▶use parent qw(Pod::Perldoc::BaseTo);
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 ▶use vars qw($VERSION);
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 $VERSION = '3.28';
8  
9 0 ▶sub is_pageable { 1 }
Subroutine is_pageable: not called CC=1 SCAR=6.9
Pod undocumented
10 0 ▶sub write_with_binmode { 0 }
Subroutine write_with_binmode: not called CC=1 SCAR=6.9
Pod undocumented
11 0 ▶sub output_extension { 'txt' }
Subroutine output_extension: not called CC=1 SCAR=6.9
Pod undocumented
12  
13 1 ▶use Pod::Text::Color ();
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 0 ▶sub alt { shift->_perldoc_elem('alt' , @_) }
Subroutine alt: not called CC=1 SCAR=6.9
Pod undocumented
16 0 ▶sub indent { shift->_perldoc_elem('indent' , @_) }
Subroutine indent: not called CC=1 SCAR=6.9
Pod undocumented
17 0 ▶sub loose { shift->_perldoc_elem('loose' , @_) }
Subroutine loose: not called CC=1 SCAR=6.9
Pod undocumented
18 0 ▶sub quotes { shift->_perldoc_elem('quotes' , @_) }
Subroutine quotes: not called CC=1 SCAR=6.9
Pod undocumented
19 0 ▶sub sentence { shift->_perldoc_elem('sentence', @_) }
Subroutine sentence: not called CC=1 SCAR=6.9
Pod undocumented
20 0 ▶sub width { shift->_perldoc_elem('width' , @_) }
Subroutine width: not called CC=1 SCAR=6.9
Pod undocumented
21  
22 0 ▶sub new { return bless {}, ref($_[0]) || $_[0] }
Subroutine new: not called CC=2 SCAR=17.9
Pod undocumented
Condition0%0/3
ref $_[0] || $_[0]
l!l&&r!l&&!r
000
MC/DC0%0/2
ref $_[0] || $_[0]
ref $_[0] $_[0]
Truth table0%0/3
A || B
A= ref $_[0]B= $_[0]
ABresult
1X1
011
000
23  
24 0 ▶sub parse_from_file {
Subroutine parse_from_file: not called CC=5 SCAR=34.0
Pod undocumented
25 0 my $self = shift;
26  
27 my @options =
28 0 map {; $_, $self->{$_} }
29 grep !m/^_/s,
30 keys %$self
31 ;
32  
33 0 ▶ defined(&Pod::Perldoc::DEBUG)
Branch: 3 branches
BranchTrueFalseTotal
defined &Pod::Perldoc::DEBUG and 0 and print "About to call new Pod::Text::Color ", $Pod::Text::VERSION ? "(v$Pod::Text::VERSION) " : "", "with options: ", @options ? "[@options]" : "(nil)", "\n" 0 0 0
$Pod::Text::VERSION ? : 0 0 0
@options ? : 0 0 0
Condition0%0/2
defined &Pod::Perldoc::DEBUG and 0
!ll
00
MC/DC0%0/1
defined &Pod::Perldoc::DEBUG and 0
defined &Pod::Perldoc::DEBUG
Truth table0%0/2
A
A= defined &Pod::Perldoc::DEBUG
Aresult
00
11
34 and Pod::Perldoc::DEBUG()
35 and print "About to call new Pod::Text::Color ",
36 $Pod::Text::VERSION ? "(v$Pod::Text::VERSION) " : '',
37 "with options: ",
38 @options ? "[@options]" : "(nil)", "\n";
39 ;
40  
41 0 Pod::Text::Color->new(@options)->parse_from_file(@_);
42 }
43  
44 1 1;
45  
46 =head1 NAME
47  
48 Pod::Perldoc::ToANSI - render Pod with ANSI color escapes
49  
50 =head1 SYNOPSIS
51  
52 perldoc -o ansi Some::Modulename
53  
54 =head1 DESCRIPTION
55  
56 This is a "plug-in" class that allows Perldoc to use
57 Pod::Text as a formatter class.
58  
59 It supports the following options, which are explained in
60 L<Pod::Text>: alt, indent, loose, quotes, sentence, width
61  
62 For example:
63  
64 perldoc -o term -w indent:5 Some::Modulename
65  
66 =head1 CAVEAT
67  
68 This module may change to use a different text formatter class in the
69 future, and this may change what options are supported.
70  
71 =head1 SEE ALSO
72  
73 L<Pod::Text>, L<Pod::Text::Color>, L<Pod::Perldoc>
74  
75 =head1 COPYRIGHT AND DISCLAIMERS
76  
77 Copyright (c) 2011 Mark Allen. All rights reserved.
78  
79 This library is free software; you can redistribute it and/or modify it
80 under the same terms as Perl itself.
81  
82 This program is distributed in the hope that it will be useful, but
83 without any warranty; without even the implied warranty of
84 merchantability or fitness for a particular purpose.
85  
86 =head1 AUTHOR
87  
88 Current maintainer: Mark Allen C<< <mallen@cpan.org> >>
89  
90 Past contributions from:
91 brian d foy C<< <bdfoy@cpan.org> >>
92 Adriano R. Ferreira C<< <ferreira@cpan.org> >>,
93 Sean M. Burke C<< <sburke@cpan.org> >>
94  
95  
96 =cut
« lib/Pod/Perldoc/ToMan.pm ↑ Summary lib/Pod/Perldoc/ToText.pm »