Permalink
Browse files

cleanup

  • Loading branch information...
1 parent dd1e13f commit cad21f8393d94e4f4c456743e35e5d95b901bb45 @yko committed Aug 25, 2010
Showing with 11 additions and 19 deletions.
  1. +4 −16 lib/MojoX/Renderer.pm
  2. +7 −3 t/mojolicious/lite_app.t
View
@@ -129,21 +129,13 @@ sub render {
# Render
$self->handler->{text}->($self, $c, \$output, {text => $text});
-
- # Extends
- $content->{content} = b("$output")
- if ($c->stash->{extends} || $c->stash->{layout});
}
# Data
elsif (defined $data) {
# Render
$self->handler->{data}->($self, $c, \$output, {data => $data});
-
- # Extends
- $content->{content} = b("$output")
- if ($c->stash->{extends} || $c->stash->{layout});
}
# JSON
@@ -152,24 +144,20 @@ sub render {
# Render
$self->handler->{json}->($self, $c, \$output, {json => $json});
$format = 'json';
-
- # Extends
- $content->{content} = b("$output")
- if ($c->stash->{extends} || $c->stash->{layout});
}
# Template or templateless handler
else {
# Render
return unless $self->_render_template($c, \$output, $options);
-
- # Extends
- $content->{content} = b("$output")
- if ($c->stash->{extends} || $c->stash->{layout});
}
# Extends
+ $content->{content} = b("$output")
+ if ($c->stash->{extends} || $c->stash->{layout});
+
+ # Extends
while ((my $extends = $self->_extends($c)) && !$json && !$data) {
# Handler
View
@@ -792,19 +792,23 @@ $t->get_ok('/template_inheritance')->status_is(200)
->header_is(Server => 'Mojolicious (Perl)')
->header_is('X-Powered-By' => 'Mojolicious (Perl)')
->content_is(
- "<title>Welcome</title>\nSidebar!\nLayout content\nHello World!\nDefault footer!\n");
+ "<title>Welcome</title>\nSidebar!\nLayout content\nHello World!\nDefault footer!\n"
+ );
# GET /layout_without_inheritance
$t->get_ok('/layout_without_inheritance')->status_is(200)
->header_is(Server => 'Mojolicious (Perl)')
->header_is('X-Powered-By' => 'Mojolicious (Perl)')
- ->content_is("Default header!\nDefault sidebar!\nLayout content\nDefault footer!\n");
+ ->content_is(
+ "Default header!\nDefault sidebar!\nLayout content\nDefault footer!\n");
# GET /double_inheritance
$t->get_ok('/double_inheritance')->status_is(200)
->header_is(Server => 'Mojolicious (Perl)')
->header_is('X-Powered-By' => 'Mojolicious (Perl)')
- ->content_is("<title>Welcome</title>\nSidebar too!\nLayout content\nHello World!\nDefault footer!\n");
+ ->content_is(
+ "<title>Welcome</title>\nSidebar too!\nLayout content\nHello World!\nDefault footer!\n"
+ );
# GET /nested-includes
$t->get_ok('/nested-includes')->status_is(200)

0 comments on commit cad21f8

Please sign in to comment.