my $c = shift;
my $command = shift;
- # Get the calling class
- my $caller = ( caller(0) )[0];
- if ( $caller->isa('Catalyst') ) {
- if ( ( caller(2) )[3] =~ /detach$/ ) { $caller = caller(3) }
- elsif ( ( caller(0) )[3] =~ /forward$/ ) { $caller = caller(1) }
- }
-
unless ($command) {
$c->log->debug('Nothing to forward to') if $c->debug;
return 0;
my $command_copy = $command;
unless ( $command_copy =~ s/^\/// ) {
- my $prefix =
- Catalyst::Utils::class2prefix( $caller,
- $c->config->{case_sensitive} )
- || '';
- $command_copy = "${prefix}/${command}";
+ my $namespace = $c->stack->[-1]->namespace;
+ $command_copy = "${namespace}/${command}";
}
unless ( $command_copy =~ /\// ) {
code => $code,
reverse => "$class->$method",
class => $class,
- namespace => $class,
+ namespace => Catalyst::Utils::class2prefix(
+ $class, $c->config->{case_sensitive}
+ ),
}
);
$result = $action;
return unless $c->debug;
my $privates = Text::SimpleTable->new(
- [ 24, 'Private' ],
- [ 23, 'Class' ],
- [ 23, 'Method' ]
+ [ 20, 'Private' ],
+ [ 38, 'Class' ],
+ [ 12, 'Method' ]
);
my $has_private = 0;