Added support for whitespaces between brackets and quoted string for attributes
Sebastian Riedel [Fri, 6 May 2005 14:12:32 +0000 (14:12 +0000)]
Changes
lib/Catalyst/Dispatcher.pm

diff --git a/Changes b/Changes
index 625ffb8..3e67a46 100644 (file)
--- a/Changes
+++ b/Changes
@@ -8,6 +8,8 @@ This file documents the revision history for Perl extension Catalyst.
         - added deep recursion detection
         - fixed auto actions
         - fixed inheritance in dispatcher
+        - allow whitespaces between brackets and quoted string
+          in Path and Regex attributes
 
 5.10  Sat Apr 23 11:16:00 2005
         - updated dependencies to require latest module::pluggable::fast
index dfe6eee..e8e3797 100644 (file)
@@ -269,11 +269,13 @@ sub set_action {
     my %flags;
 
     for my $attr ( @{$attrs} ) {
-        if    ( $attr =~ /^(Local|Relative)$/ )        { $flags{local}++ }
-        elsif ( $attr =~ /^(Global|Absolute)$/ )       { $flags{global}++ }
-        elsif ( $attr =~ /^Path\((.+)\)$/i )           { $flags{path} = $1 }
-        elsif ( $attr =~ /^Private$/i )                { $flags{private}++ }
-        elsif ( $attr =~ /^(Regex|Regexp)\((.+)\)$/i ) { $flags{regex} = $2 }
+        if    ( $attr =~ /^(Local|Relative)$/ )    { $flags{local}++ }
+        elsif ( $attr =~ /^(Global|Absolute)$/ )   { $flags{global}++ }
+        elsif ( $attr =~ /^Path\(\s*(.+)\s*\)$/i ) { $flags{path} = $1 }
+        elsif ( $attr =~ /^Private$/i )            { $flags{private}++ }
+        elsif ( $attr =~ /^(Regex|Regexp)\(\s*(.+)\s*\)$/i ) {
+            $flags{regex} = $2;
+        }
     }
 
     if ( $flags{private} && ( keys %flags > 1 ) ) {