X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=lib%2FCatalyst%2FDispatcher.pm;h=5df4526e51baf131890f1e52ac37320f250a82bd;hp=c06c2a4f7ec315054e4ad6b24a68c4e0f3d70006;hb=17b3d80076b6acb25d56ed83b0ed7134ed4fb343;hpb=3cd3bc6ae6c0282f98f1dd65676b98be379933ce diff --git a/lib/Catalyst/Dispatcher.pm b/lib/Catalyst/Dispatcher.pm index c06c2a4..5df4526 100644 --- a/lib/Catalyst/Dispatcher.pm +++ b/lib/Catalyst/Dispatcher.pm @@ -643,9 +643,8 @@ sub _load_dispatch_types { # 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 $@; @@ -668,9 +667,7 @@ of course it's being used.) 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; @@ -707,7 +704,6 @@ foreach my $public_method_name (qw/ 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 {