X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FEngine.pm;h=4d25d70f5dc1384ffef6211fec8e58c06a95fcec;hb=3cb1db8ca312e1a9c16cbf31543858dd98653ad1;hp=5ef4639ce8911c7bb25a48de20d98475b14f579b;hpb=7833fdfca73ff8a03769523ec85c2343a3994360;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/Engine.pm b/lib/Catalyst/Engine.pm index 5ef4639..4d25d70 100644 --- a/lib/Catalyst/Engine.pm +++ b/lib/Catalyst/Engine.pm @@ -104,7 +104,8 @@ sub action { last unless ${$i}; push @snippets, ${$i}; } - return [ $name, \@snippets ]; + return [ $self->actions->{regex}->{$name}, + $name, \@snippets ]; } } } @@ -337,8 +338,20 @@ sub forward { $command = _prefix( $caller, $command ); $command = "\!$command"; } + elsif ( $command =~ /^\!(.*)$/ ) { + my $try = $1; + my $caller = caller(0); + my $prefix = _class2prefix($caller); + $try = "!$prefix/$command"; + $command = $try if $c->actions->{plain}->{$try}; + } my ( $class, $code ); if ( my $action = $c->action($command) ) { + if ( $action->[2] ) { + $c->log->debug(qq/Couldn't forward "$command" to regex action/) + if $c->debug; + return 0; + } ( $class, $code ) = @{ $action->[0] }; } else { @@ -489,8 +502,8 @@ sub prepare_action { # It's a regex if ($#$result) { - my $match = $result->[0]; - my @snippets = @{ $result->[1] }; + my $match = $result->[1]; + my @snippets = @{ $result->[2] }; $c->log->debug(qq/Requested action "$path" matched "$match"/) if $c->debug; $c->log->debug(