From dc52fec399f0081a4c153cb348e24435d7958441 Mon Sep 17 00:00:00 2001 From: Htbaa Date: Sat, 26 Feb 2011 12:46:02 +0100 Subject: [PATCH] Inline wrappers and includes now work on Windows closes gh-13 --- Changes | 2 ++ lib/MojoX/Renderer/TT.pm | 1 + t/lite_app.t | 4 ++-- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Changes b/Changes index c7f9e01..d9f1854 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,8 @@ Revision history for MojoX-Renderer-TT {{$NEXT}} + - Inline wrappers and includes now work on Windows + (GH#13, Christiaan Kras) 1.11 February 6, 2011 - Change to use relative paths (Marcus Ramberg) diff --git a/lib/MojoX/Renderer/TT.pm b/lib/MojoX/Renderer/TT.pm index 7cd47cf..1578fe3 100644 --- a/lib/MojoX/Renderer/TT.pm +++ b/lib/MojoX/Renderer/TT.pm @@ -151,6 +151,7 @@ sub _template_content { my ($path) = @_; my ($t) = ($path =~ m{templates[\/|\\](.*)$}); + $t =~ s/\\/\//g; if (-r $path) { return $self->SUPER::_template_content(@_); diff --git a/t/lite_app.t b/t/lite_app.t index 183b4e9..8d9bd4d 100644 --- a/t/lite_app.t +++ b/t/lite_app.t @@ -94,13 +94,13 @@ __DATA__ @@ include.inc Hello -@@ includes/include.inc +@@ includes/sub/include.inc Hallo @@ include.html.tt [%- INCLUDE 'include.inc' -%] Include! -[% INCLUDE 'includes/include.inc' -%] +[% INCLUDE 'includes/sub/include.inc' -%] @@ layouts/layout.html.tt w[%- content -%]d