upgrade Mojolicious to 2.x hooks
authorDobrica Pavlinusic <dpavlin@rot13.org>
Sun, 15 Jul 2012 14:55:50 +0000 (16:55 +0200)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Sun, 15 Jul 2012 14:55:50 +0000 (16:55 +0200)
Makefile.PL
lib/MojoFacets.pm
lib/MojoFacets/Plugin/NYTProf.pm

index 02090be..207ca0c 100755 (executable)
@@ -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';
index 9146e2f..c2ef3d4 100644 (file)
@@ -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 $@;
index 20424eb..e0577fb 100644 (file)
@@ -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;