Added support for ~ prefix to plugins and action classes
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Dispatcher.pm
index 5df4526..99c46bc 100644 (file)
@@ -640,10 +640,10 @@ sub _load_dispatch_types {
     my ( $self, @types ) = @_;
 
     my @loaded;
-
     # Preload action types
     for my $type (@types) {
-        my $class = Catalyst::Utils::resolve_namespace('Catalyst::DispatchType', $type);
+        # first param is undef because we cannot get the appclass
+        my $class = Catalyst::Utils::resolve_namespace(undef, 'Catalyst::DispatchType', $type);
         
         eval { Class::MOP::load_class($class) };
         Catalyst::Exception->throw( message => qq/Couldn't load "$class"/ )
@@ -666,8 +666,9 @@ of course it's being used.)
 
 sub dispatch_type {
     my ($self, $name) = @_;
-
-    $name = Catalyst::Utils::resolve_namespace('Catalyst::DispatchType', $name);
+    
+    # first param is undef because we cannot get the appclass
+    $name = Catalyst::Utils::resolve_namespace(undef, 'Catalyst::DispatchType', $name);
 
     for (@{ $self->_dispatch_types }) {
         return $_ if ref($_) eq $name;