File Coverage

blib/lib/Text/Template/Simple/Dummy.pm
Criterion Covered Total %
statement 16 16 100.0
branch 1 2 50.0
condition 1 2 50.0
subroutine 5 5 100.0
pod 1 1 100.0
total 24 26 92.3


line stmt bran cond sub pod time code
1             package Text::Template::Simple::Dummy;
2             # Dummy Plug provided by the nice guy Mr. Ikari from NERV :p
3             # All templates are compiled into this package.
4             # You can define subs/methods here and then access
5             # them inside templates. It is also possible to declare
6             # and share package variables under strict (safe mode can
7             # have problems though). See the Pod for more info.
8 62     62   1074 use strict;
  62         155  
  62         4042  
9 62     62   1770 use warnings;
  62         117  
  62         4401  
10 62     62   54381 use Text::Template::Simple::Caller;
  62         346  
  62         2348  
11 62     62   735 use Text::Template::Simple::Util qw();
  62         140  
  62         7828  
12              
13             our $VERSION = '0.86';
14              
15             sub stack { # just a wrapper
16 8   50 8 1 31 my $opt = shift || {};
17 8 50       39 Text::Template::Simple::Util::fatal('tts.caller.stack.hash')
18             if ! Text::Template::Simple::Util::ishref($opt);
19 8         26 $opt->{frame} = 1;
20 8         90 return Text::Template::Simple::Caller->stack( $opt );
21             }
22              
23             1;
24              
25             __END__
26              
27             =head1 NAME
28              
29             Text::Template::Simple::Dummy - Container class
30              
31             =head1 SYNOPSIS
32              
33             TODO
34              
35             =head1 DESCRIPTION
36              
37             This document describes version C<0.86> of C<Text::Template::Simple::Dummy>
38             released on C<5 March 2012>.
39              
40             All templates are compiled into this class.
41              
42             =head1 FUNCTIONS
43              
44             C<Text::Template::Simple::Dummy> contains some utility functions
45             that are accessible by all templates.
46              
47             =head2 stack
48              
49             Issues a full stack trace and returns the output as string dump. Accepts
50             options as a hashref:
51              
52             stack({ opt => $option, frame => $backtrace_level });
53              
54             Can be used inside templates like this:
55              
56             <%= stack() %>
57              
58             See L<Text::Template::Simple::Caller> for more information.
59              
60             =head1 AUTHOR
61              
62             Burak Gursoy <burak@cpan.org>.
63              
64             =head1 COPYRIGHT
65              
66             Copyright 2004 - 2012 Burak Gursoy. All rights reserved.
67              
68             =head1 LICENSE
69              
70             This library is free software; you can redistribute it and/or modify
71             it under the same terms as Perl itself, either Perl version 5.12.3 or,
72             at your option, any later version of Perl 5 you may have available.
73              
74             =cut