File Coverage

blib/lib/Dotiac/DTL/Reduced.pm
Criterion Covered Total %
statement 6 17 35.2
branch 0 14 0.0
condition 0 6 0.0
subroutine 2 4 50.0
pod 2 2 100.0
total 10 43 23.2


line stmt bran cond sub pod time code
1             ###############################################################################
2             #Reduced.pm
3             #Last Change: 2009-01-19
4             #Copyright (c) 2009 Marc-Seabstian "Maluku" Lucksch
5             #Version 0.8
6             ####################
7             #This file is part of the Dotiac::DTL project.
8             #http://search.cpan.org/perldoc?Dotiac::DTL
9             #
10             #Reduced.pm is published under the terms of the MIT license, which basically
11             #means "Do with it whatever you want". For more information, see the
12             #license.txt file that should be enclosed with libsofu distributions. A copy of
13             #the license is (at the time of writing) also available at
14             #http://www.opensource.org/licenses/mit-license.php .
15             ###############################################################################
16            
17             package Dotiac::DTL::Reduced;
18 1     1   1933 use base qw/Dotiac::DTL::Core/;
  1         1  
  1         831  
19 1     1   6 use Exporter;
  1         2  
  1         385  
20             require File::Spec;
21            
22             our @EXPORT=();
23             our @EXPORT_OK=qw/Context Template/;
24             our $VERSION = 0.8;
25            
26             sub Template {
27 0     0 1   my $file=shift;
28 0 0         if (-e $file) {
    0          
    0          
29             }
30             elsif (-e "$file.html") {
31 0           $file="$file.html"
32             }
33             elsif (-e "$file.txt") {
34 0           $file="$file.txt" ;
35             }
36             else {
37 0           foreach my $dir (@Dotiac::DTL::TEMPLATE_DIRS) {
38 0 0 0       $file=File::Spec->catfile($dir,"$file.html") and last if -e File::Spec->catfile($dir,"$file.html");
39 0 0 0       $file=File::Spec->catfile($dir,"$file.txt") and last if -e File::Spec->catfile($dir,"$file.txt");
40 0 0 0       $file=File::Spec->catfile($dir,$file) and last if -e File::Spec->catfile($dir,$file);
41             }
42             }
43 0 0         return Dotiac::DTL->new($file,@_) if -e $file;
44 0           return Dotiac::DTL->new(\$file,@_);
45             }
46            
47             sub Context {
48 0     0 1   return $_[0];
49             }
50             1;
51            
52             __END__