Skip to content

Commit

Permalink
improved inline templates to use their checksum as name
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Jan 8, 2014
1 parent b6dc02b commit e865af5
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions Changes
Expand Up @@ -4,6 +4,7 @@
- Improved exception and not found pages with log messages.
- Improved exception page with more information.
- Improved not found page with a more generic message.
- Improved inline templates to use their checksum as name.

4.66 2014-01-04
- Added success attribute to Test::Mojo.
Expand Down
4 changes: 2 additions & 2 deletions lib/Mojolicious/Plugin/EPLRenderer.pm
Expand Up @@ -31,8 +31,8 @@ sub _epl {

# Inline
if (defined $inline) {
$log->debug('Rendering inline template.');
$$output = $mt->name('inline template')->render($inline, $c);
$log->debug(qq{Rendering inline template "$path".});
$$output = $mt->name(qq{inline template "$path"})->render($inline, $c);
}

# File
Expand Down
3 changes: 2 additions & 1 deletion t/mojolicious/group_lite_app.t
Expand Up @@ -201,7 +201,8 @@ like $log, qr!GET "/suspended"\.!, 'right message';
like $log, qr/Routing to a callback\./, 'right message';
like $log, qr/Nothing has been rendered, expecting delayed response\./,
'right message';
like $log, qr/Rendering inline template\./, 'right message';
like $log, qr/Rendering inline template "f75d6f5993c626fa8049366389f77928"\./,
'right message';
$t->app->log->unsubscribe(message => $cb);

# Suspended bridge (stopped)
Expand Down
3 changes: 2 additions & 1 deletion t/mojolicious/lite_app.t
Expand Up @@ -582,7 +582,8 @@ $t->get_ok('/reserved?data=just-works&json=test')->status_is(200)
# Exception in inline template
$t->get_ok('/inline/exception')->status_is(500)
->header_is(Server => 'Mojolicious (Perl)')
->content_is("Died at inline template line 1.\n\n");
->content_is(
"Died at inline template 6635c7011166fa11bb23c21912900ea9 line 1.\n\n");

# Exception in template from data section
$t->get_ok('/data/exception')->status_is(500)
Expand Down

0 comments on commit e865af5

Please sign in to comment.