From: Tomas Doran Date: Mon, 23 Nov 2009 22:50:27 +0000 (+0000) Subject: Update to work with latest Catalyst and not warn X-Git-Tag: v0.15^0 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Plugin-SubRequest.git;a=commitdiff_plain;h=61114b68bad9233a9f502b3f3d12eb48e0a050fe Update to work with latest Catalyst and not warn --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9043907 --- /dev/null +++ b/.gitignore @@ -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 --- 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. diff --git a/Makefile.PL b/Makefile.PL index 9bc88c9..79fe822 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -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 --- 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. diff --git a/lib/Catalyst/Plugin/SubRequest.pm b/lib/Catalyst/Plugin/SubRequest.pm index 0cfd8b3..12c663a 100644 --- a/lib/Catalyst/Plugin/SubRequest.pm +++ b/lib/Catalyst/Plugin/SubRequest.pm @@ -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. -=head1 AUTHOR +=head1 AUTHORS Marcus Ramberg, C +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 +the Catalyst::Plugin::SubRequest L as listed above. =head1 LICENSE diff --git a/t/lib/TestApp.pm b/t/lib/TestApp.pm index fe4b490..09de5dd 100644 --- a/t/lib/TestApp.pm +++ b/t/lib/TestApp.pm @@ -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 index 0000000..d0b8686 --- /dev/null +++ b/t/lib/TestApp/Controller/Root.pm @@ -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; +