[Templates-cvs] cvs commit: Template2/lib/Template Provider.pm
cvs@template-toolkit.org
cvs@template-toolkit.org
Mon, 01 Dec 2003 16:05:50 +0000
cvs 03/12/01 16:05:47
Modified: lib/Template Provider.pm
Log:
added "path" to info describing template source file
Revision Changes Path
2.73 +6 -2 Template2/lib/Template/Provider.pm
Index: Provider.pm
===================================================================
RCS file: /template-toolkit/Template2/lib/Template/Provider.pm,v
retrieving revision 2.72
retrieving revision 2.73
diff -u -r2.72 -r2.73
--- Provider.pm 2003/10/14 09:39:19 2.72
+++ Provider.pm 2003/12/01 16:05:45 2.73
@@ -27,7 +27,7 @@
#
#----------------------------------------------------------------------------
#
-# $Id: Provider.pm,v 2.72 2003/10/14 09:39:19 abw Exp $
+# $Id: Provider.pm,v 2.73 2003/12/01 16:05:45 abw Exp $
#
#============================================================================
@@ -44,7 +44,7 @@
use File::Basename;
use File::Spec;
-$VERSION = sprintf("%d.%02d", q$Revision: 2.72 $ =~ /(\d+)\.(\d+)/);
+$VERSION = sprintf("%d.%02d", q$Revision: 2.73 $ =~ /(\d+)\.(\d+)/);
# name of document class
$DOCUMENT = 'Template::Document' unless defined $DOCUMENT;
@@ -638,6 +638,7 @@
my $text = <FH>;
$data = {
name => $alias,
+ path => $name,
text => $text,
time => (stat $name)[9],
load => $now,
@@ -655,6 +656,9 @@
($data, $error) = (undef, Template::Constants::STATUS_DECLINED);
}
}
+
+ $data->{ path } = $data->{ name }
+ if $data and ! defined $data->{ path };
return ($data, $error);
}