[Bps-public-commit] r16357 - in Path-Dispatcher/trunk: lib/Path/Dispatcher

sartak at bestpractical.com sartak at bestpractical.com
Sun Oct 19 05:24:56 EDT 2008


Author: sartak
Date: Sun Oct 19 05:24:55 2008
New Revision: 16357

Modified:
   Path-Dispatcher/trunk/   (props changed)
   Path-Dispatcher/trunk/lib/Path/Dispatcher/Rule.pm

Log:
 r74114 at onn:  sartak | 2008-10-19 05:24:13 -0400
 Make the code black optional


Modified: Path-Dispatcher/trunk/lib/Path/Dispatcher/Rule.pm
==============================================================================
--- Path-Dispatcher/trunk/lib/Path/Dispatcher/Rule.pm	(original)
+++ Path-Dispatcher/trunk/lib/Path/Dispatcher/Rule.pm	Sun Oct 19 05:24:55 2008
@@ -5,9 +5,9 @@
 use Path::Dispatcher::Stage;
 
 has block => (
-    is       => 'ro',
-    isa      => 'CodeRef',
-    required => 1,
+    is        => 'ro',
+    isa       => 'CodeRef',
+    predicate => 'has_block',
 );
 
 has prefix => (
@@ -45,6 +45,8 @@
 sub run {
     my $self = shift;
 
+    die "No codeblock to run" if !$self->has_block;
+
     $self->block->(@_);
 }
 



More information about the Bps-public-commit mailing list