Fix base and headers
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Engine.pm
index 27dfb3d..ba926cb 100644 (file)
@@ -373,11 +373,11 @@ sub handler ($$) {
                 for my $begin ( @{ $c->get_action( 'begin', $namespace ) } ) {
                     $c->state( $c->execute( @{ $begin->[0] } ) );
                 }
-                for my $result ( @{ $c->get_action( $action, $default ) } ) {
+                for my $result ( @{ $c->get_action( $action, $default ) }[-1] ) {
                     $c->state( $c->execute( @{ $result->[0] } ) );
                     last unless $default;
                 }
-                for my $end ( @{ $c->get_action( 'end', $namespace ) } ) {
+                for my $end ( reverse @{ $c->get_action( 'end', $namespace ) } ) {
                     $c->state( $c->execute( @{ $end->[0] } ) );
                 }
             }
@@ -638,11 +638,11 @@ sub set_action {
     my %flags;
 
     for my $attr ( @{$attrs} ) {
-        if    ( $attr =~ /^Local$/ )         { $flags{local}++ }
-        elsif ( $attr =~ /^Global$/ )        { $flags{global}++ }
-        elsif ( $attr =~ /^Path\((.+)\)$/i ) { $flags{path} = $1 }
-        elsif ( $attr =~ /^Private$/i )      { $flags{private}++ }
-        elsif ( $attr =~ /Regex\((.+)\)$/i ) { $flags{regex} = $1 }
+        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 }
     }
 
     return unless keys %flags;