X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FDispatcher.pm;h=995cca55fe421e7263c54b1eaaf1d5c21a61f13e;hb=531f1ab6f98c126f57075dbbca4884ac9728703c;hp=575b1a6a91238088a8f3cd2e55c7f597bf8efe5d;hpb=3ea37672f96be0393a84199bf098d0111b347f33;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/Dispatcher.pm b/lib/Catalyst/Dispatcher.pm index 575b1a6..995cca5 100644 --- a/lib/Catalyst/Dispatcher.pm +++ b/lib/Catalyst/Dispatcher.pm @@ -2,6 +2,7 @@ package Catalyst::Dispatcher; use Moose; use Class::MOP; +with 'MooseX::Emulate::Class::Accessor::Fast'; use Catalyst::Exception; use Catalyst::Utils; @@ -133,8 +134,13 @@ sub _command2action { my $action; # go to a string path ("/foo/bar/gorch") - # or action object which stringifies to that - $action = $self->_invoke_as_path( $c, "$command", \@args ); + # or action object + if (Scalar::Util::blessed($command) && $command->isa('Catalyst::Action')) { + $action = $command; + } + else { + $action = $self->_invoke_as_path( $c, "$command", \@args ); + } # go to a component ( "MyApp::*::Foo" or $c->component("...") # - a path or an object)