Update to work with latest Catalyst and not warn v0.15
Tomas Doran [Mon, 23 Nov 2009 22:50:27 +0000 (22:50 +0000)]
.gitignore [new file with mode: 0644]
Changes
Makefile.PL
README
lib/Catalyst/Plugin/SubRequest.pm
t/lib/TestApp.pm
t/lib/TestApp/Controller/Root.pm [new file with mode: 0644]

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..9043907
--- /dev/null
@@ -0,0 +1,7 @@
+MANIFEST
+MANIFEST.bak
+META.yml
+Makefile
+blib/
+inc/
+pm_to_blib
diff --git a/Changes b/Changes
index 0bb8323..b934422 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,5 +1,10 @@
 Revision history for Perl extension Catalyst::Plugin::SubRequest
 
+0.15  2009-11-23 22:47:32 GMT
+        - Be compatible with Catalyst 5.80014 by not writing to the
+          request body directly.
+        - Remove deprecation warnings by moving actions out of the test app.
+
 0.14  2009-10-18 18:30:00 BST
         - Tweak copyright info to ease downstream packaging.
 
index 9bc88c9..79fe822 100644 (file)
@@ -4,10 +4,12 @@ name 'Catalyst-Plugin-SubRequest';
 all_from 'lib/Catalyst/Plugin/SubRequest.pm';
 
 requires 'Catalyst::Runtime' => '5.7012';
-
 requires 'Test::More';
 
-auto_install;
+if ($Module::Install::AUTHOR) {
+    system("pod2text lib/Catalyst/Plugin/SubRequest.pm > README");
+}
+
 resources repository => 'http://dev.catalyst.perl.org/repos/Catalyst/trunk/Catalyst-Plugin-SubRequest/';
 
 WriteAll;
diff --git a/README b/README
index 97cc02a..957a048 100644 (file)
--- a/README
+++ b/README
@@ -32,6 +32,10 @@ THANK YOU
     SRI, for writing the awesome Catalyst framework
 
 COPYRIGHT
+    Copyright (c) 2005 - 2008 the Catalyst::Plugin::SubRequest "AUTHOR" as
+    listed above.
+
+LICENSE
     This program is free software, you can redistribute it and/or modify it
     under the same terms as Perl itself.
 
index 0cfd8b3..12c663a 100644 (file)
@@ -1,9 +1,10 @@
 package Catalyst::Plugin::SubRequest;
 
 use strict;
+use warnings;
 use Time::HiRes qw/tv_interval/;
 
-our $VERSION = '0.14';
+our $VERSION = '0.15';
 
 =head1 NAME
 
@@ -61,6 +62,7 @@ sub sub_request {
     } else {
         $request_mods{path} = $path;
     }
+    $request_mods{_body} = delete $request_mods{body};
 
     my $fake_engine = bless(
         {
@@ -98,10 +100,12 @@ sub sub_request {
 
 L<Catalyst>.
 
-=head1 AUTHOR
+=head1 AUTHORS
 
 Marcus Ramberg, C<mramberg@cpan.org>
 
+Tomas Doran (t0m) C<< bobtfish@bobtfish.net >>
+
 =head1 THANK YOU
 
 SRI, for writing the awesome Catalyst framework
@@ -109,7 +113,7 @@ SRI, for writing the awesome Catalyst framework
 =head1 COPYRIGHT
 
 Copyright (c) 2005 - 2008
-the Catalyst::Plugin::SubRequest L</AUTHOR>
+the Catalyst::Plugin::SubRequest L</AUTHORS>
 as listed above.
 
 =head1 LICENSE
index fe4b490..09de5dd 100644 (file)
@@ -1,4 +1,7 @@
 package TestApp;
+use strict;
+use warnings;
+use base qw/Catalyst/;
 
 use Catalyst qw[SubRequest];
 
@@ -8,35 +11,4 @@ __PACKAGE__->config(
 
 __PACKAGE__->setup();
 
-    sub begin : Private {
-        my ( $self, $c ) = @_;
-        $c->res->body('1');
-    }
-
-    sub subtest : Global {
-        my ( $self, $c ) = @_;
-        my $subreq= $c->res->body().
-                    $c->subreq('/normal/4');
-        $c->res->body($subreq);
-    }
-  
-    sub normal : Global {
-        my ( $self, $c, $arg ) = @_;
-        $c->res->body($c->res->body().$arg);
-    }
-    
-    sub subtest_params : Global {
-        my ( $self, $c ) = @_;
-        my $before = $c->req->params->{value};
-        my $subreq = $c->subreq('/normal/2');
-        my $after = $c->req->params->{value};
-        $c->res->body($c->res->body().$after);
-    }
-
-    sub end : Private {
-        my ( $self, $c ) = @_;
-        $c->res->body($c->res->body().'3');
-    }
-
-
 1;
diff --git a/t/lib/TestApp/Controller/Root.pm b/t/lib/TestApp/Controller/Root.pm
new file mode 100644 (file)
index 0000000..d0b8686
--- /dev/null
@@ -0,0 +1,38 @@
+package TestApp::Controller::Root;
+use strict;
+use warnings;
+
+use base qw/Catalyst::Controller/;
+
+sub begin : Private {
+    my ( $self, $c ) = @_;
+    $c->res->body('1');
+}
+
+sub subtest : Global {
+    my ( $self, $c ) = @_;
+    my $subreq= $c->res->body().
+                $c->subreq('/normal/4');
+    $c->res->body($subreq);
+}
+
+sub normal : Global {
+    my ( $self, $c, $arg ) = @_;
+    $c->res->body($c->res->body().$arg);
+}
+
+sub subtest_params : Global {
+    my ( $self, $c ) = @_;
+    my $before = $c->req->params->{value};
+    my $subreq = $c->subreq('/normal/2');
+    my $after = $c->req->params->{value};
+    $c->res->body($c->res->body().$after);
+}
+
+sub end : Private {
+    my ( $self, $c ) = @_;
+    $c->res->body($c->res->body().'3');
+}
+
+1;
+