Note DispatchType::Regex depreciation in docs and add warning if used.
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Dispatcher.pm
index 8451b8d..73d3f84 100644 (file)
@@ -22,7 +22,7 @@ use namespace::clean -except => 'meta';
 # See Catalyst-Plugin-Server for them being added to, which should be much less ugly.
 
 # Preload these action types
-our @PRELOAD = qw/Index Path Regex/;
+our @PRELOAD = qw/Index Path/;
 
 # Postload these action types
 our @POSTLOAD = qw/Default/;
@@ -517,7 +517,14 @@ sub register {
             # FIXME - Some error checking and re-throwing needed here, as
             #         we eat exceptions loading dispatch types.
             eval { Class::MOP::load_class($class) };
-            push( @{ $self->dispatch_types }, $class->new ) unless $@;
+            if( $@ ){
+                warn( "Attempt to use deprecated $key dispatch type.\n"
+                    . "  Use Chained methods instead or install\n"
+                    . "  Catalyst::DispatchType::Regex if necessary.\n")
+                    if $key =~ /^(Local)?Regex$/;
+            } else {
+                push( @{ $self->dispatch_types }, $class->new );
+            }
             $registered->{$class} = 1;
         }
     }
@@ -588,8 +595,8 @@ sub _find_or_create_namespace_node {
 
 =head2 $self->setup_actions( $class, $context )
 
-Loads all of the preload dispatch types, registers their actions and then
-loads all of the postload dispatch types, and iterates over the tree of
+Loads all of the pre-load dispatch types, registers their actions and then
+loads all of the post-load dispatch types, and iterates over the tree of
 actions, displaying the debug information if appropriate.
 
 =cut