File Coverage

File:/tmp/__ttc/ttc_mod/sample___tt.pm
Coverage:23.9%

linestmtbrancondsubpodtimecode
1package ttc_mod::sample___tt;
2sub getDocument {
3#------------------------------------------------------------------------
4# Compiled template generated by the Template Toolkit version 2.19
5#------------------------------------------------------------------------
6
7Template::Coverable::Document->new({
8    METADATA => {
9        'modtime' => '1213679678',
10        'name' => 'sample.tt',
11    },
12    BLOCK => sub {
13
1
38
        my $context = shift || die "template sub called without context\n";
14
1
11
        my $stash = $context->stash;
15
1
8
        my $output = '';
16
1
6
        my $error;
17
18
1
1
7
17
        eval { BLOCK: {
19    #line 1 "./sample.tt"
20
1
7
    $output .= $stash->get('title');
21    #line 1 "./sample.tt"
22
1
23
    if ($stash->get('subtitle')) {
23
0
0
    $output .= ' - ' . $stash->get('subtitle');
24    }
25
26
1
9
    $output .= "\n~~~~\n";
27    #line 3 "./sample.tt"
28
1
19
    if ($stash->get('verbose') && $stash->get(['rows', 0, 'size', 0]) > 0) {
29
0
0
    $output .= $context->process('show_rows');
30    }
31
32
1
8
    $output .= "\n~~~~\n\n";
33
34
1
9
    $output .= "\n";
35        } };
36
1
9
        if ($@) {
37
0
0
            $error = $context->catch($@, \$output);
38
0
0
            die $error unless $error->type eq 'return';
39        }
40
41
1
12
        return $output;
42    },
43    DEFBLOCKS => {
44        'show_rows' => sub {
45
0
0
            my $context = shift || die "template sub called without context\n";
46
0
0
            my $stash = $context->stash;
47
0
0
            my $output = '';
48
0
0
            my $error;
49
50
0
0
0
0
            eval { BLOCK: {
51
0
0
        $output .= "\n ";
52        #line 9 "./sample.tt"
53
54        # FOREACH
55
0
0
        do {
56
0
0
            my ($value, $error, $oldloop);
57
0
0
            my $list = $stash->get('rows');
58
59
0
0
            unless (UNIVERSAL::isa($list, 'Template::Iterator')) {
60
0
0
                $list = Template::Config->iterator($list)
61                    || die $Template::Config::ERROR, "\n";
62            }
63
64
0
0
            ($value, $error) = $list->get_first();
65
0
0
0
0
            eval { $oldloop = $stash->get('loop') };
66
0
0
            $stash->set('loop', $list);
67
0
0
            eval {
68
0
0
        LOOP: while (! $error) {
69
0
0
                    $stash->{'row'} = $value;
70
0
0
        $output .= " ";
71        #line 8 "./sample.tt"
72
0
0
        $output .= $stash->get(['row', 0, 'x', 0]);
73
0
0
        $output .= " / ";
74        #line 8 "./sample.tt"
75
0
0
        $output .= $stash->get(['row', 0, 'y', 0]);
76
0
0
        $output .= " = ";
77        #line 8 "./sample.tt"
78
0
0
        $output .= $stash->get(['row', 0, 'y', 0]) eq 0 ? 'N/A' : ($stash->get(['row', 0, 'x', 0]) / $stash->get(['row', 0, 'y', 0]));
79
0
0
        $output .= "\n ";;
80
0
0
                    ($value, $error) = $list->get_next();
81                }
82            };
83
0
0
            $stash->set('loop', $oldloop);
84
0
0
            die $@ if $@;
85
0
0
            $error = 0 if $error && $error eq Template::Constants::STATUS_DONE;
86
0
0
            die $error if $error;
87        };
88
89            } };
90
0
0
            if ($@) {
91
0
0
                $error = $context->catch($@, \$output);
92
0
0
                die $error unless $error->type eq 'return';
93            }
94
95
0
0
            return $output;
96        },
97    },
98
1
0
37
});
99};
1001;