Compare commits

...
Author SHA1 Message Date
Ask Bjørn Hansen 392b97e81a Ignore .ttc files from tests 2011-02-05 12:22:44 -08:00
Ask Bjørn Hansen a5e276f633 Update Changes 2011-02-05 12:20:42 -08:00
Ask Bjørn Hansen fc453fe4fb Try fixing tests on Strawberry Perl (RT#65282)
(thanks Christiaan Kras)
2011-02-05 12:12:47 -08:00
Ask Bjørn Hansen 32c83d6109 Fix bugtracker URL in META.yml 2011-02-05 12:11:05 -08:00
Maxim VuetsandAsk Bjørn Hansen 5e5c23d786 Make Mojolicious 'layout'/'extends' working 2011-02-05 10:02:09 -08:00
Ask Bjørn Hansen fa30565b6b 1.0 released 2011-01-22 17:14:48 -08:00
5 changed files with 41 additions and 10 deletions
+6
View File
@@ -1,6 +1,12 @@
Revision history for MojoX-Renderer-TT
{{$NEXT}}
- Support Mojolicious 'layout'/'extends' (Maxim Vuets, Marcus
Ramberg)
- Fix Strawberry Perl tests (RT#65282, Christiaan Kras, Ask)
- Update bugtracker URL in META.yml
1.0 January 22, 2011
- Require (and be compatible with) Mojolicious 1.0+
- Added inline template support (Viacheslav Tykhanovskyi & Ask)
- Fix inline rendering and test failures (Marcus Ramberg)
+5 -6
View File
@@ -21,12 +21,11 @@ bundle = @Basic
remove = Readme
remove = Manifest
[Repository]
repository = git://github.com/abh/mojox-renderer-tt.git
web = https://github.com/abh/mojox-renderer-tt
[Bugtracker]
web = https://github.com/abh/mojox-renderer-tt/issues
[MetaResources]
bugtracker.web = https://github.com/abh/mojox-renderer-tt/issues
repository.web = http://github.com/abh/mojox-renderer-tt
repository.url = git://github.com/abh/mojox-renderer-tt.git
repository.type = git
[Homepage]
+4 -1
View File
@@ -71,6 +71,9 @@ sub _render {
my $helper = MojoX::Renderer::TT::Helper->new(ctx => $c);
# Purge previous result
$$output = '';
my @params = ({%{$c->stash}, c => $c, h => $helper}, $output, {binmode => ':utf8'});
$self->tt->{SERVICE}->{CONTEXT}->{LOAD_TEMPLATES}->[0]->ctx($c);
@@ -152,7 +155,7 @@ sub _template_content {
my $self = shift;
my ($path) = @_;
my ($t) = ($path =~ m{templates\/(.*)$});
my ($t) = ($path =~ m{templates[\/|\\](.*)$});
if (-r $path) {
return $self->SUPER::_template_content(@_);
+2
View File
@@ -0,0 +1,2 @@
/tmp/
*.ttc
+24 -3
View File
@@ -5,7 +5,7 @@ use warnings;
use utf8;
use Test::More tests => 25;
use Test::More tests => 31;
use Mojolicious::Lite;
use Mojo::ByteStream 'b';
@@ -24,7 +24,11 @@ get '/with_include' => 'include';
get '/with_wrapper' => 'wrapper';
#get '/with_auto_wrapper' => sub { shift->render(auto_wrapper => layout => 'layout') };
get '/with_auto_wrapper' => 'auto_wrapper';
get '/inheritance_base' => 'inheritance_base';
get '/inheritance_derived' => 'inheritance_derived';
get '/unicode' => 'unicode';
@@ -53,7 +57,11 @@ $t->get_ok('/with_include')->content_is("HelloInclude!Hallo");
$t->get_ok('/with_wrapper')->content_is("wrapped");
# With auto wrapper
#$t->get_ok('/with_auto_wrapper')->content_is("wrapped");
$t->get_ok('/with_auto_wrapper')->content_is("wrapped");
# Inheritance
$t->get_ok('/inheritance_base')->content_is("untouched");
$t->get_ok('/inheritance_derived')->content_is("edited");
# Unicode
$t->get_ok('/unicode')->content_is("привет");
@@ -100,9 +108,22 @@ w[%- content -%]d
rappe
[%- END -%]
@@ layouts/auto_layout.html.tt
w[%- h.content -%]d
@@ auto_wrapper.html.tt
[% CALL h.layout('auto_layout') %]
rappe
@@ inheritance_base.html.tt
[% verb = BLOCK %]untouch[% END %]
[% h.content('verb', verb) %]ed
@@ inheritance_derived.html.tt
[% CALL h.extends('inheritance_base') %]
[% verb = BLOCK %]edit[% END %]
[% h.content('verb', verb) %]
@@ unicode.html.tt
привет