Wiki/Node/Para.pm

filter: Statementstmt 100% 29 / 29 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 9 / 9 Podpod n/a totaltotal 100% 38 / 38 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Wiki/Node/Mono.pm ↑ Summary
1 #############################################################################
2 # (c) by Tels 2004. Part of Convert::Wiki
3 #
4 # represents a text paragraph node
5 #############################################################################
6  
7 package Convert::Wiki::Node::Para;
8  
9 4 ▶use 5.006001;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 4 ▶use Convert::Wiki::Node;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 4 ▶use Text::Format;
Subroutine BEGIN: called CC=1 SCAR=0.0
15  
16 4 ▶use vars qw/$VERSION @ISA $formatter/;
Subroutine BEGIN: called CC=1 SCAR=0.0
17  
18 4 @ISA = qw/Convert::Wiki::Node/;
19  
20 4 $VERSION = '0.03';
21  
22 #############################################################################
23  
24 BEGIN
25 4 ▶ {
Subroutine BEGIN: called CC=1 SCAR=0.0
26 4 $formatter= Text::Format->new( {
27 columns => 76,
28 firstIndent => 0,
29 } );
30 }
31  
32 sub _init
33 24 ▶ {
Subroutine _init: called CC=1 SCAR=0.0
34 24 my ($self,$args) = @_;
35  
36 24 $self->SUPER::_init($args);
37  
38 24 $self->{txt} =~ s/\n/ /g; # remove all newlines
39  
40 24 $self;
41 }
42  
43 sub _as_wiki
44 22 ▶ {
Subroutine _as_wiki: called CC=1 SCAR=0.0
45 22 my ($self,$txt) = @_;
46  
47 22 $txt = $formatter->format($txt);
48  
49 22 $txt =~ s/\n\z//; # last newline
50 22 $txt .= "\n\n";
51 }
52  
53 4 1;
54 __END__
« Wiki/Node/Mono.pm ↑ Summary