File Coverage

blib/lib/Dotiac/DTL/Tag/debug.pm
Criterion Covered Total %
statement 15 61 24.5
branch n/a
condition n/a
subroutine 5 16 31.2
pod 11 11 100.0
total 31 88 35.2


line stmt bran cond sub pod time code
1             #debug.pm
2             #Last Change: 2009-01-19
3             #Copyright (c) 2009 Marc-Seabstian "Maluku" Lucksch
4             #Version 0.8
5             ####################
6             #This file is part of the Dotiac::DTL project.
7             #http://search.cpan.org/perldoc?Dotiac::DTL
8             #
9             #debug.pm is published under the terms of the MIT license, which basically
10             #means "Do with it whatever you want". For more information, see the
11             #license.txt file that should be enclosed with libsofu distributions. A copy of
12             #the license is (at the time of writing) also available at
13             #http://www.opensource.org/licenses/mit-license.php .
14             ###############################################################################
15            
16             package Dotiac::DTL::Tag::debug;
17 11     11   62 use base qw/Dotiac::DTL::Tag/;
  11         22  
  11         936  
18 11     11   64 use strict;
  11         22  
  11         363  
19 11     11   75 use warnings;
  11         23  
  11         334  
20 11     11   3057 use Data::Dumper;
  11         9408  
  11         644  
21 11     11   107 use Carp;
  11         23  
  11         8543  
22            
23             our $VERSION = 0.8;
24            
25             sub new {
26 0     0 1   my $class=shift;
27 0           my $self={p=>shift()};
28 0           bless $self,$class;
29 0           return $self;
30             }
31             sub print {
32 0     0 1   my $self=shift;
33 0           print $self->{p};
34 0           print "
\n",Data::Dumper->Dump([\@_,Carp::longmess()],[qw/Parameter Stack/]),"
\n";
35 0           $self->{n}->print(@_);
36             }
37             sub string {
38 0     0 1   my $self=shift;
39 0           return $self->{p}."
\n".Data::Dumper->Dump([\@_,Carp::longmess()],[qw/Parameter Stack/])."
\n".$self->{n}->string(@_);
40            
41             }
42             sub perl {
43 0     0 1   my $self=shift;
44 0           my $fh=shift;
45 0           my $id=shift;
46 0           $self->SUPER::perl($fh,$id,@_);
47 0           print $fh "use Data::Dumper;\n";
48 0           print $fh "use Carp;\n";
49 0           return $self->{n}->perl($fh,$id+1,@_);
50             }
51             sub perlprint {
52 0     0 1   my $self=shift;
53 0           my $fh=shift;
54 0           my $id=shift;
55 0           my $level=shift;
56 0           $self->SUPER::perlprint($fh,$id,$level,@_);
57 0           print $fh "\t" x $level,'print "
\n",Data::Dumper->Dump([[$vars,$escape,@_],Carp::longmess()],[qw/Parameter Stack/]),"
\n";',"\n";
58 0           return $self->{n}->perlprint($fh,$id+1,$level,@_);
59             }
60             sub perlstring {
61 0     0 1   my $self=shift;
62 0           my $fh=shift;
63 0           my $id=shift;
64 0           my $level=shift;
65 0           $self->SUPER::perlstring($fh,$id,$level,@_);
66 0           print $fh "\t" x $level,'$r.="
\n".Data::Dumper->Dump([[$vars,$escape,@_],Carp::longmess()],[qw/Parameter Stack/])."
\n";',"\n";
67 0           return $self->{n}->perlstring($fh,$id+1,$level,@_);
68             }
69             sub perleval {
70 0     0 1   my $self=shift;
71 0           my $fh=shift;
72 0           my $id=shift;
73 0           $self->{n}->perleval($fh,$id+1,@_);
74             }
75             sub perlinit {
76 0     0 1   my $self=shift;
77 0           my $fh=shift;
78 0           my $id=shift;
79 0           $self->{n}->perlinit($fh,$id+1,@_);
80             }
81             sub perlcount {
82 0     0 1   my $self=shift;
83 0           my $id=shift;
84 0           return $self->{n}->perlcount($id+1);
85             }
86             sub next {
87 0     0 1   my $self=shift;
88 0           $self->{n}=shift;
89             }
90             sub eval {
91 0     0 1   my $self=shift;
92 0           $self->{n}->eval(@_);
93             }
94             1;
95            
96             __END__