# Preload action types
for my $type (@types) {
- my $class =
- ( $type =~ /^\+(.*)$/ ) ? $1 : "Catalyst::DispatchType::${type}";
-
+ my $class = Catalyst::Utils::resolve_namespace('Catalyst::DispatchType', $type);
+
eval { Class::MOP::load_class($class) };
Catalyst::Exception->throw( message => qq/Couldn't load "$class"/ )
if $@;
sub dispatch_type {
my ($self, $name) = @_;
- unless ($name =~ s/^\+//) {
- $name = "Catalyst::DispatchType::" . $name;
- }
+ $name = Catalyst::Utils::resolve_namespace('Catalyst::DispatchType', $name);
for (@{ $self->_dispatch_types }) {
return $_ if ref($_) eq $name;
my %package_hash; # Only warn once per method, per package. These are infrequent enough that
# I haven't provided a way to disable them, patches welcome.
$meta->add_before_method_modifier($public_method_name, sub {
- my $class = blessed(shift);
+ my $class = caller(2);
+ chomp($class);
$package_hash{$class}++ || do {
- warn("Class $class is calling the deprecated method Catalyst::Dispatcher::$public_method_name,\n"
- . "this will be removed in Catalyst 5.9X\n");
+ warn("Class $class is calling the deprecated method\n"
+ . " Catalyst::Dispatcher::$public_method_name,\n"
+ . " this will be removed in Catalyst 5.9X\n");
};
});
}