[Catalyst-commits] r10059 - in
Catalyst-Plugin-PluginLoader/1.000/trunk: lib/Catalyst/Plugin
t t/lib t/lib/Catalyst/Plugin
caelum at dev.catalyst.perl.org
caelum at dev.catalyst.perl.org
Sun May 10 13:39:17 GMT 2009
Author: caelum
Date: 2009-05-10 13:39:16 +0000 (Sun, 10 May 2009)
New Revision: 10059
Added:
Catalyst-Plugin-PluginLoader/1.000/trunk/t/lib/Catalyst/Plugin/Zero.pm
Modified:
Catalyst-Plugin-PluginLoader/1.000/trunk/lib/Catalyst/Plugin/PluginLoader.pm
Catalyst-Plugin-PluginLoader/1.000/trunk/t/01_basic.t
Catalyst-Plugin-PluginLoader/1.000/trunk/t/lib/MyApp.pm
Log:
C::P::PluginLoader - use goto in next::method
Modified: Catalyst-Plugin-PluginLoader/1.000/trunk/lib/Catalyst/Plugin/PluginLoader.pm
===================================================================
--- Catalyst-Plugin-PluginLoader/1.000/trunk/lib/Catalyst/Plugin/PluginLoader.pm 2009-05-10 05:15:37 UTC (rev 10058)
+++ Catalyst-Plugin-PluginLoader/1.000/trunk/lib/Catalyst/Plugin/PluginLoader.pm 2009-05-10 13:39:16 UTC (rev 10059)
@@ -90,7 +90,7 @@
goto &$old_next_method;
}
- my $class = shift;
+ my ($class) = @_;
my $code;
while (my $next_class = shift @isa) {
@@ -99,7 +99,7 @@
}
return unless $code;
- $class->$code(@_);
+ goto &$code;
};
no warnings 'redefine';
Modified: Catalyst-Plugin-PluginLoader/1.000/trunk/t/01_basic.t
===================================================================
--- Catalyst-Plugin-PluginLoader/1.000/trunk/t/01_basic.t 2009-05-10 05:15:37 UTC (rev 10058)
+++ Catalyst-Plugin-PluginLoader/1.000/trunk/t/01_basic.t 2009-05-10 13:39:16 UTC (rev 10059)
@@ -1,14 +1,14 @@
use strict;
use warnings;
-use Test::More tests => 4;
+use Test::More tests => 5;
use FindBin;
use lib "$FindBin::Bin/lib";
use Catalyst::Test "MyApp";
-# 3 tests run from 3 plugins' setup methods
+# 4 tests run from 4 plugins' setup methods
is(get('/'), "MyApp::Plugin::One Catalyst::Plugin::Two Catalyst::Plugin::Three",
'plugin methods work');
Added: Catalyst-Plugin-PluginLoader/1.000/trunk/t/lib/Catalyst/Plugin/Zero.pm
===================================================================
--- Catalyst-Plugin-PluginLoader/1.000/trunk/t/lib/Catalyst/Plugin/Zero.pm (rev 0)
+++ Catalyst-Plugin-PluginLoader/1.000/trunk/t/lib/Catalyst/Plugin/Zero.pm 2009-05-10 13:39:16 UTC (rev 10059)
@@ -0,0 +1,14 @@
+package Catalyst::Plugin::Zero;
+
+use strict;
+use warnings;
+
+sub setup {
+ Test::More::ok(1, "Catalyst::Plugin::Zero->setup called");
+
+ shift->next::method(@_);
+}
+
+sub plugin_zero { __PACKAGE__ };
+
+1;
Modified: Catalyst-Plugin-PluginLoader/1.000/trunk/t/lib/MyApp.pm
===================================================================
--- Catalyst-Plugin-PluginLoader/1.000/trunk/t/lib/MyApp.pm 2009-05-10 05:15:37 UTC (rev 10058)
+++ Catalyst-Plugin-PluginLoader/1.000/trunk/t/lib/MyApp.pm 2009-05-10 13:39:16 UTC (rev 10059)
@@ -3,7 +3,7 @@
use strict;
use warnings;
-use Catalyst qw/PluginLoader Three/;
+use Catalyst qw/Zero PluginLoader Three/;
__PACKAGE__->config(
'Plugin::PluginLoader' => {
More information about the Catalyst-commits
mailing list