uploaded 0.07 to the server, fixing path, and allowing you to pass params.
Marcus Ramberg [Mon, 1 Aug 2005 10:12:01 +0000 (10:12 +0000)]
Changes
MANIFEST
META.yml
SubRequest.pm
t/03pod.t [new file with mode: 0644]
t/04podcoverage.t [new file with mode: 0644]

diff --git a/Changes b/Changes
index 81679f3..a7841b9 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,5 +1,8 @@
 Revision history for Perl extension Catalyst::Plugin::Static.
 
+0.07  2005-08-01 12:08:00 
+        - reset path.
+        - allow passing params.
 0.06  2005-06-08 20:27:00 
         - Flush params as well
         - allow stuff to be passed to the stash
index 0b0af9d..eb33b71 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -6,4 +6,6 @@ README
 SubRequest.pm
 t/01use.t
 t/02subreq.t
+t/03pod.t
+t/04podcoverage.t
 t/lib/TestApp.pm
index b27764f..017804d 100644 (file)
--- a/META.yml
+++ b/META.yml
@@ -1,7 +1,7 @@
 # http://module-build.sourceforge.net/META-spec.html
 #XXXXXXX This is a prototype!!!  It will change in the future!!! XXXXX#
 name:         Catalyst-Plugin-SubRequest
-version:      0.06
+version:      0.07
 version_from: SubRequest.pm
 installdirs:  site
 requires:
index 98fb2db..10da3b2 100644 (file)
@@ -2,7 +2,7 @@ package Catalyst::Plugin::SubRequest;
 
 use strict;
 
-our $VERSION = '0.06';
+our $VERSION = '0.07';
 
 
 =head1 NAME
@@ -13,7 +13,7 @@ Catalyst::Plugin::SubRequest - Make subrequests to actions in Catalyst
 
     use Catalyst 'SubRequest';
 
-    $c->subreq('/test/foo/bar', template='magic.tt');
+    $c->subreq('/test/foo/bar', { template => 'magic.tt' });
 
 =head1 DESCRIPTION
 
@@ -24,7 +24,7 @@ dispatcher, so it will work like an external url call.
 
 =over 4 
 
-=item subreq path, [stash]
+=item subreq path, [stash as hash ref], [parameters as hash ref]
 
 =item sub_request
 
@@ -39,7 +39,7 @@ parameters are put into the stash.
 
 use Data::Dumper qw/Dumper/;
 sub sub_request {
-    my ( $c, $path, $stash ) = @_;
+    my ( $c, $path, $stash, $params ) = @_;
 
     my %old_req;
     $path =~ s/^\///;
@@ -47,16 +47,16 @@ sub sub_request {
     $old_req{content} = $c->res->output;$c->res->output(undef);
     $old_req{args}    = $c->req->arguments;
     $old_req{action}  = $c->req->action;$c->req->action(undef);
-    $old_req{path}  = $c->req->path;$c->req->path($path);
-    $old_req{params}  = $c->req->params;$c->req->{params} = {};
+    $old_req{path}    = $c->req->path;$c->req->path($path);
+    $old_req{params}  = $c->req->params;$c->req->params($params || {});
     $c->prepare_action();
-    $c->log->debug("Subrequest to $path , action is ". 
-                           $c->req->action )
-      if $c->debug;
+    $c->log->debug("Subrequest to $path , action is ".  $c->req->action )
+        if $c->debug;
     $c->dispatch();
     my $output  = $c->res->output;
     $c->req->{params}=$old_req{params};
     $c->req->arguments($old_req{args});
+    $c->req->path($old_req{path});
     $c->res->output($old_req{content});
     return $output;
 }
diff --git a/t/03pod.t b/t/03pod.t
new file mode 100644 (file)
index 0000000..1647794
--- /dev/null
+++ b/t/03pod.t
@@ -0,0 +1,7 @@
+use Test::More;
+
+eval "use Test::Pod 1.14";
+plan skip_all => 'Test::Pod 1.14 required' if $@;
+plan skip_all => 'set TEST_POD to enable this test' unless $ENV{TEST_POD};
+
+all_pod_files_ok();
diff --git a/t/04podcoverage.t b/t/04podcoverage.t
new file mode 100644 (file)
index 0000000..d91be5e
--- /dev/null
@@ -0,0 +1,7 @@
+use Test::More;
+
+eval "use Test::Pod::Coverage 1.04";
+plan skip_all => 'Test::Pod::Coverage 1.04 required' if $@;
+plan skip_all => 'set TEST_POD to enable this test' unless $ENV{TEST_POD};
+
+all_pod_coverage_ok();