From: Tomas Doran Date: Sun, 8 Feb 2009 07:16:25 +0000 (+0000) Subject: Switch to MRO::Compat X-Git-Tag: v0.07~1 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Plugin-Cache.git;a=commitdiff_plain;h=ab8e499f20f1230ea96f0bd770516783a2427fb5 Switch to MRO::Compat --- diff --git a/Changes b/Changes index efc2e8e..63722d2 100644 --- 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 diff --git a/lib/Catalyst/Plugin/Cache.pm b/lib/Catalyst/Plugin/Cache.pm index 9e080f7..608d1e2 100644 --- a/lib/Catalyst/Plugin/Cache.pm +++ b/lib/Catalyst/Plugin/Cache.pm @@ -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 ) = @_; diff --git a/lib/Catalyst/Plugin/Cache/Choose/KeyRegexes.pm b/lib/Catalyst/Plugin/Cache/Choose/KeyRegexes.pm index 66a5839..611b249 100644 --- a/lib/Catalyst/Plugin/Cache/Choose/KeyRegexes.pm +++ b/lib/Catalyst/Plugin/Cache/Choose/KeyRegexes.pm @@ -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__;