Subject: | [PATCH] Port to Class::C3 for CataMoose compat. |
Date: | Mon, 03 Nov 2008 15:05:30 +0000 |
To: | bug-Catalyst-Plugin-Static-Simple [...] rt.cpan.org |
From: | ilmari [...] ilmari.org (Dagfinn Ilmari Mannsåker) |
Hi,
Here's a patch to switch from NEXT to Class::C3 and ->next::method so
the plugin will work with the upcoming 5.80 release of Catalyst.
=== Makefile.PL
==================================================================
--- Makefile.PL (revision 31391)
+++ Makefile.PL (local)
@@ -6,6 +6,7 @@
requires 'Catalyst::Runtime' => '5.30';
requires 'MIME::Types' => '1.15';
requires 'Test::More';
+requires 'Class::C3';
unless( can_use 'Catalyst' => '5.33' ) {
requires 'File::Slurp';
=== lib/Catalyst/Plugin/Static/Simple.pm
==================================================================
--- lib/Catalyst/Plugin/Static/Simple.pm (revision 31391)
+++ lib/Catalyst/Plugin/Static/Simple.pm (local)
@@ -7,6 +7,7 @@
use File::Spec ();
use IO::File ();
use MIME::Types ();
+use Class::C3;
our $VERSION = '0.20';
@@ -49,7 +50,7 @@
$c->_locate_static_file( $path );
}
- return $c->NEXT::ACTUAL::prepare_action(@_);
+ return $c->next::method(@_);
}
sub dispatch {
@@ -64,7 +65,7 @@
return $c->_serve_static;
}
else {
- return $c->NEXT::ACTUAL::dispatch(@_);
+ return $c->next::method(@_);
}
}
@@ -76,13 +77,13 @@
$c->log->debug( 'Static::Simple: ' . join q{ }, @{$c->_debug_msg} );
}
- return $c->NEXT::ACTUAL::finalize(@_);
+ return $c->next::method(@_);
}
sub setup {
my $c = shift;
- $c->NEXT::setup(@_);
+ $c->maybe::next::method(@_);
if ( Catalyst->VERSION le '5.33' ) {
require File::Slurp;
--
ilmari
"A disappointingly low fraction of the human race is,
at any given time, on fire." - Stig Sandbeck Mathisen