[Catalyst-commits] r9664 - Catalyst-Runtime/5.80/branches/register_actions/lib/Catalyst

hdp at dev.catalyst.perl.org hdp at dev.catalyst.perl.org
Tue Apr 7 20:31:51 GMT 2009


Author: hdp
Date: 2009-04-07 21:31:51 +0100 (Tue, 07 Apr 2009)
New Revision: 9664

Modified:
   Catalyst-Runtime/5.80/branches/register_actions/lib/Catalyst/Controller.pm
Log:
split out methods to show rafl what I mean

Modified: Catalyst-Runtime/5.80/branches/register_actions/lib/Catalyst/Controller.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/register_actions/lib/Catalyst/Controller.pm	2009-04-07 14:23:19 UTC (rev 9663)
+++ Catalyst-Runtime/5.80/branches/register_actions/lib/Catalyst/Controller.pm	2009-04-07 20:31:51 UTC (rev 9664)
@@ -174,16 +174,26 @@
     return $namespace;
 };
 
+sub get_action_methods {
+    my $self = shift;
+    my $meta = find_meta($self);
+    confess("Metaclass for " . ref($meta) ." for " . $meta->name 
+        . " cannot support register_actions.")
+        unless $meta->can('get_all_methods_with_attributes');
+    my @methods = $meta->get_all_methods_with_attributes;
+    return @methods;
+}
 
 sub register_actions {
     my ( $self, $c ) = @_;
+    $self->register_action_methods( $c, $self->get_action_methods );
+}
+
+sub register_action_methods {
+    my ( $self, $c, @methods ) = @_;
     my $class = ref $self || $self;
     #this is still not correct for some reason.
     my $namespace = $self->action_namespace($c);
-    my $meta = find_meta($self);
-    confess("Metaclass for " . ref($meta) ." for " . $meta->name 
-        . " cannot support register_actions.")
-        unless $meta->can('get_all_methods_with_attributes');
     my @methods = $meta->get_all_methods_with_attributes;
 
     foreach my $method (@methods) {




More information about the Catalyst-commits mailing list