[Bps-public-commit] r16412 - in Path-Dispatcher/trunk: lib/Path/Dispatcher t t/lib/Path/Dispatcher/Test

sartak at bestpractical.com sartak at bestpractical.com
Tue Oct 21 10:00:55 EDT 2008


Author: sartak
Date: Tue Oct 21 10:00:54 2008
New Revision: 16412

Modified:
   Path-Dispatcher/trunk/   (props changed)
   Path-Dispatcher/trunk/lib/Path/Dispatcher/Declarative.pm
   Path-Dispatcher/trunk/t/016-more-under.t
   Path-Dispatcher/trunk/t/100-declarative.t
   Path-Dispatcher/trunk/t/lib/Path/Dispatcher/Test/App.pm
   Path-Dispatcher/trunk/t/lib/Path/Dispatcher/Test/Framework.pm

Log:
 r74243 at onn:  sartak | 2008-10-21 09:59:24 -0400
 Require "-base" because otherwise "use MyApp::Dispatcher" fails when we just want to use it


Modified: Path-Dispatcher/trunk/lib/Path/Dispatcher/Declarative.pm
==============================================================================
--- Path-Dispatcher/trunk/lib/Path/Dispatcher/Declarative.pm	(original)
+++ Path-Dispatcher/trunk/lib/Path/Dispatcher/Declarative.pm	Tue Oct 21 10:00:54 2008
@@ -23,6 +23,11 @@
     my $self = shift;
     my $pkg  = caller;
 
+    my @args = grep { !/^-[bB]ase$/ } @_;
+
+    # just loading the class..
+    return if @args == @_;
+
     do {
         no strict 'refs';
         push @{ $pkg . '::ISA' }, $self;
@@ -30,7 +35,7 @@
 
     local $CALLER = $pkg;
 
-    $exporter->($self, @_);
+    $exporter->($self, @args);
 }
 
 sub build_sugar {

Modified: Path-Dispatcher/trunk/t/016-more-under.t
==============================================================================
--- Path-Dispatcher/trunk/t/016-more-under.t	(original)
+++ Path-Dispatcher/trunk/t/016-more-under.t	Tue Oct 21 10:00:54 2008
@@ -7,7 +7,7 @@
 
 do {
     package Under::Where;
-    use Path::Dispatcher::Declarative;
+    use Path::Dispatcher::Declarative -base;
 
     under 'ticket' => sub {
         on 'create' => sub { push @calls, "ticket create" };

Modified: Path-Dispatcher/trunk/t/100-declarative.t
==============================================================================
--- Path-Dispatcher/trunk/t/100-declarative.t	(original)
+++ Path-Dispatcher/trunk/t/100-declarative.t	Tue Oct 21 10:00:54 2008
@@ -7,7 +7,7 @@
 
 do {
     package MyApp::Dispatcher;
-    use Path::Dispatcher::Declarative;
+    use Path::Dispatcher::Declarative -base;
 
     on qr/(b)(ar)(.*)/ => sub {
         push @calls, [$1, $2, $3];

Modified: Path-Dispatcher/trunk/t/lib/Path/Dispatcher/Test/App.pm
==============================================================================
--- Path-Dispatcher/trunk/t/lib/Path/Dispatcher/Test/App.pm	(original)
+++ Path-Dispatcher/trunk/t/lib/Path/Dispatcher/Test/App.pm	Tue Oct 21 10:00:54 2008
@@ -2,7 +2,7 @@
 package Path::Dispatcher::Test::App;
 use strict;
 use warnings;
-use Path::Dispatcher::Test::Framework;
+use Path::Dispatcher::Test::Framework -base;
 
 before qr/foo/ => sub {
     push @main::calls, 'app before foo';

Modified: Path-Dispatcher/trunk/t/lib/Path/Dispatcher/Test/Framework.pm
==============================================================================
--- Path-Dispatcher/trunk/t/lib/Path/Dispatcher/Test/Framework.pm	(original)
+++ Path-Dispatcher/trunk/t/lib/Path/Dispatcher/Test/Framework.pm	Tue Oct 21 10:00:54 2008
@@ -2,7 +2,7 @@
 package Path::Dispatcher::Test::Framework;
 use strict;
 use warnings;
-use Path::Dispatcher::Declarative;
+use Path::Dispatcher::Declarative -base;
 
 before qr/foo/ => sub {
     push @main::calls, 'framework before foo';



More information about the Bps-public-commit mailing list