Switch to MRO::Compat
Tomas Doran [Sun, 8 Feb 2009 07:16:25 +0000 (07:16 +0000)]
Changes
lib/Catalyst/Plugin/Cache.pm
lib/Catalyst/Plugin/Cache/Choose/KeyRegexes.pm

diff --git a/Changes b/Changes
index efc2e8e..63722d2 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,3 +1,6 @@
+0.07  UNRELEASED
+        - Switch from NEXT to MRO::Compat
+
 0.06
         - clarify the documentation on how to configure a backend
         - due to stacked evals, certain start up errors were quietly
index 9e080f7..608d1e2 100644 (file)
@@ -11,7 +11,7 @@ our $VERSION = "0.06";
 use Scalar::Util ();
 use Catalyst::Utils ();
 use Carp ();
-use NEXT;
+use MRO::Compat;
 
 use Catalyst::Plugin::Cache::Curried;
 
@@ -25,7 +25,7 @@ sub setup {
     # and don't overwrite if some plugin was wicked
     $app->_cache_backends({}) unless $app->_cache_backends;
 
-    my $ret = $app->NEXT::setup( @_ );
+    my $ret = $app->maybe::next::method( @_ );
 
     $app->setup_cache_backends;
 
@@ -46,7 +46,7 @@ sub setup_cache_backends {
     my $app = shift;
 
     # give plugins a chance to find things for themselves
-    $app->NEXT::setup_cache_backends;
+    $app->maybe::next::method;
 
     foreach my $name ( keys %{ $app->config->{cache}{backends} } ) {
         next if $app->get_cache_backend( $name );
@@ -263,7 +263,7 @@ sub choose_cache_backend_wrapper {
     return $c->default_cache_backend;
 }
 
-sub choose_cache_backend { shift->NEXT::choose_cache_backend( @_ ) } # a convenient fallback
+sub choose_cache_backend { shift->maybe::next::method( @_ ) } # a convenient fallback
 
 sub cache_set {
     my ( $c, $key, $value, %meta ) = @_;
index 66a5839..611b249 100644 (file)
@@ -4,10 +4,11 @@ package Catalyst::Plugin::Cache::Choose::KeyRegexes;
 
 use strict;
 use warnings;
+use MRO::Compat;
 
 sub setup {
     my $app = shift;
-    my $ret = $app->NEXT::setup( @_ );
+    my $ret = $app->maybe::next::method( @_ );
 
     my $regexes = $app->config->{cache}{key_regexes} ||= [];
 
@@ -30,7 +31,7 @@ sub choose_cache_backend {
         return $backend if $meta{key} =~ $re;
     }
 
-    $c->NEXT::choose_cache_backend( %meta );
+    $c->maybe::next::method( %meta );
 }
 
 __PACKAGE__;