Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
no need to use closures
  • Loading branch information
kraih committed Jan 19, 2015
1 parent 57bb53b commit 61fa651
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions lib/Mojolicious/Plugin/DefaultHelpers.pm
Expand Up @@ -11,20 +11,8 @@ sub register {
my ($self, $app) = @_;

# DEPRECATED in Tiger Face!
$app->helper(
render_exception => sub {
deprecated 'Mojolicious::Controller::render_exception is DEPRECATED in'
. ' favor of the reply->exception helper';
shift->helpers->reply->exception(@_);
}
);
$app->helper(
render_not_found => sub {
deprecated 'Mojolicious::Controller::render_not_found is DEPRECATED in'
. ' favor of the reply->not_found helper';
shift->helpers->reply->not_found;
}
);
$app->helper(render_exception => \&_render_esception);
$app->helper(render_not_found => \&_render_not_found);

# Controller alias helpers
for my $name (qw(app flash param stash session url_for validation)) {
Expand Down Expand Up @@ -161,6 +149,20 @@ sub _is_fresh {
return $c->app->static->is_fresh($c, \%options);
}

# DEPRECATED in Tiger Face!
sub _render_exception {
deprecated 'Mojolicious::Controller::render_exception is DEPRECATED in'
. ' favor of the reply->exception helper';
shift->helpers->reply->exception(@_);
}

# DEPRECATED in Tiger Face!
sub _render_not_found {
deprecated 'Mojolicious::Controller::render_not_found is DEPRECATED in'
. ' favor of the reply->not_found helper';
shift->helpers->reply->not_found;
}

sub _static {
my ($c, $file) = @_;
return !!$c->rendered if $c->app->static->serve($c, $file);
Expand Down

0 comments on commit 61fa651

Please sign in to comment.