[Bps-public-commit] r15479 - in Path-Dispatcher/trunk: lib/Path/Dispatcher/Dispatch t

sartak at bestpractical.com sartak at bestpractical.com
Tue Aug 26 09:26:09 EDT 2008


Author: sartak
Date: Tue Aug 26 09:26:08 2008
New Revision: 15479

Modified:
   Path-Dispatcher/trunk/   (props changed)
   Path-Dispatcher/trunk/lib/Path/Dispatcher/Dispatch/Match.pm
   Path-Dispatcher/trunk/t/103-input.t

Log:
 r70353 at onn:  sartak | 2008-08-26 09:26:03 -0400
 Set $_ to the path we matched against


Modified: Path-Dispatcher/trunk/lib/Path/Dispatcher/Dispatch/Match.pm
==============================================================================
--- Path-Dispatcher/trunk/lib/Path/Dispatcher/Dispatch/Match.pm	(original)
+++ Path-Dispatcher/trunk/lib/Path/Dispatcher/Dispatch/Match.pm	Tue Aug 26 09:26:08 2008
@@ -5,6 +5,11 @@
 use Path::Dispatcher::Stage;
 use Path::Dispatcher::Rule;
 
+has path => (
+    is       => 'ro',
+    required => 1,
+);
+
 has stage => (
     is       => 'ro',
     isa      => 'Path::Dispatcher::Stage',
@@ -32,6 +37,8 @@
     my $self = shift;
     my @args = @_;
 
+    local $_ = $self->path;
+
     if ($self->set_number_vars) {
         $self->run_with_number_vars(
             sub { $self->rule->run(@args) },

Modified: Path-Dispatcher/trunk/t/103-input.t
==============================================================================
--- Path-Dispatcher/trunk/t/103-input.t	(original)
+++ Path-Dispatcher/trunk/t/103-input.t	Tue Aug 26 09:26:08 2008
@@ -13,14 +13,14 @@
         from => 'app',
         one  => 'g',
         two  => undef,
-        it   => undef,
+        it   => 'args',
         args => [1, 2, 3],
     },
     {
         from => 'framework',
         one  => 'g',
         two  => undef,
-        it   => undef,
+        it   => 'args',
         args => [1, 2, 3],
     },
 ]);



More information about the Bps-public-commit mailing list