[Bps-public-commit] path-dispatcher-declarative branch, master, updated. fe8e72dd7ee5d4e51c766e6ef8c91fafdbd2b8ba

Shawn Moore sartak at bestpractical.com
Sun Oct 17 04:38:06 EDT 2010


The branch, master has been updated
       via  fe8e72dd7ee5d4e51c766e6ef8c91fafdbd2b8ba (commit)
      from  310b766369f038ed5d866c2dc0414d5cf9ca5d55 (commit)

Summary of changes:
 lib/Path/Dispatcher/Declarative/Builder.pm |   16 ++--------------
 1 files changed, 2 insertions(+), 14 deletions(-)

- Log -----------------------------------------------------------------
commit fe8e72dd7ee5d4e51c766e6ef8c91fafdbd2b8ba
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Sun Oct 17 17:37:48 2010 +0900

    Refactor
    
        Since we don't care about names we can make this a lot more readable
        :)

diff --git a/lib/Path/Dispatcher/Declarative/Builder.pm b/lib/Path/Dispatcher/Declarative/Builder.pm
index a1d0de6..07400e3 100644
--- a/lib/Path/Dispatcher/Declarative/Builder.pm
+++ b/lib/Path/Dispatcher/Declarative/Builder.pm
@@ -230,20 +230,8 @@ sub _add_rule {
     my $rule_name = "$file:$line";
 
     if (!defined(wantarray)) {
-        if ($UNDER_RULE) {
-            $UNDER_RULE->add_rule($rule);
-
-            my $full_name = $UNDER_RULE->has_name
-                          ? "(" . $UNDER_RULE->name . " - rule $rule_name)"
-                          : "(anonymous Under - rule $rule_name)";
-
-            $rule->name($full_name) unless $rule->has_name;
-        }
-        else {
-            $self->dispatcher->add_rule($rule);
-            $rule->name("(" . $self->dispatcher->name . " - rule $rule_name)")
-                unless $rule->has_name;
-        }
+        my $parent = $UNDER_RULE || $self->dispatcher;
+        $parent->add_rule($rule);
     }
     else {
         $rule->name($rule_name)

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list