Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

upgrade Mojolicious to 2.x hooks

  • Loading branch information...
commit 72d3f3c76e3fa17fddef38e3ab6b1feca02010bd 1 parent 7814084
@dpavlin authored
View
2  Makefile.PL
@@ -5,7 +5,7 @@ version_from 'lib/MojoFacets.pm';
author 'Dobrica Pavlinusic <dpavlin@rot13.org>';
license 'dual';
-requires 'Mojolicious' => '1.13';
+requires 'Mojolicious' => '2.61';
requires 'Data::Dump';
requires 'File::Slurp';
requires 'JSON';
View
4 lib/MojoFacets.pm
@@ -51,13 +51,13 @@ sub startup {
# $self->plugin( 'request_timer' );
- $self->plugins->add_hook(
+ $self->hook(
after_dispatch => sub {
my ($self) = @_;
save_action( $self );
}
);
-
+
eval 'use MojoFacets::Plugin::NYTProf';
if ( $@ ) {
warn "profile disabled: ",substr($@,0,40) if $@;
View
4 lib/MojoFacets/Plugin/NYTProf.pm
@@ -7,7 +7,7 @@ sub register {
my ($self, $app) = @_;
# Start timer
- $app->plugins->add_hook(
+ $app->hook(
before_dispatch => sub {
my ($self, $c) = @_;
return unless $ENV{PROFILE};
@@ -19,7 +19,7 @@ sub register {
);
# End timer
- $app->plugins->add_hook(
+ $app->hook(
after_dispatch => sub {
my ($self, $c) = @_;
my $p = $ENV{PROFILE} || return;
Please sign in to comment.
Something went wrong with that request. Please try again.