[Catalyst-commits] r12195 - in trunk/Catalyst-Controller-WrapCGI:
lib/Catalyst/Controller lib/CatalystX t t/lib t/lib/TestGC
t/lib/TestGC/Controller
caelum at dev.catalyst.perl.org
caelum at dev.catalyst.perl.org
Sun Dec 6 03:50:13 GMT 2009
Author: caelum
Date: 2009-12-06 03:50:13 +0000 (Sun, 06 Dec 2009)
New Revision: 12195
Added:
trunk/Catalyst-Controller-WrapCGI/t/lib/Dongs.pm
trunk/Catalyst-Controller-WrapCGI/t/lib/TestGC.pm
trunk/Catalyst-Controller-WrapCGI/t/lib/TestGC/
trunk/Catalyst-Controller-WrapCGI/t/lib/TestGC/Controller/
trunk/Catalyst-Controller-WrapCGI/t/lib/TestGC/Controller/Root.pm
Modified:
trunk/Catalyst-Controller-WrapCGI/lib/Catalyst/Controller/CGIBin.pm
trunk/Catalyst-Controller-WrapCGI/lib/Catalyst/Controller/WrapCGI.pm
trunk/Catalyst-Controller-WrapCGI/lib/CatalystX/GlobalContext.pm
trunk/Catalyst-Controller-WrapCGI/t/global-context.t
trunk/Catalyst-Controller-WrapCGI/t/wrap-cgi.t
Log:
fix tests, redo (c) sections, saner is_perl_cgi, release
Modified: trunk/Catalyst-Controller-WrapCGI/lib/Catalyst/Controller/CGIBin.pm
===================================================================
--- trunk/Catalyst-Controller-WrapCGI/lib/Catalyst/Controller/CGIBin.pm 2009-12-05 22:32:19 UTC (rev 12194)
+++ trunk/Catalyst-Controller-WrapCGI/lib/Catalyst/Controller/CGIBin.pm 2009-12-06 03:50:13 UTC (rev 12195)
@@ -228,8 +228,10 @@
open STDERR, '>&', \*NULL;
close STDIN;
- do $cgi;
+ eval { $self->wrap_perl_cgi($cgi, '__DUMMY__') };
+
IO::File->new(">$tempfile")->print($@);
+
exit;
}
@@ -324,14 +326,6 @@
L<Catalyst::Controller::WrapCGI>, L<CatalystX::GlobalContext>,
L<Catalyst::Controller>, L<CGI>, L<Catalyst>
-=head1 AUTHOR
-
-Rafael Kitover, C<< <rkitover at cpan.org> >>
-
-=head1 CONTRIBUTORS
-
-Hans Dieter Pearcey, C<< <hdp at cpan.org> >>
-
=head1 BUGS
Please report any bugs or feature requests to C<bug-catalyst-controller-wrapcgi at
@@ -364,9 +358,15 @@
=back
+=head1 AUTHOR
+
+See L<Catalyst::Controller::WrapCGI/AUTHOR> and
+L<Catalyst::Controller::WrapCGI/CONTRIBUTORS>.
+
=head1 COPYRIGHT & LICENSE
-Copyright (c) 2008 Rafael Kitover
+Copyright (c) 2008-2009 L<Catalyst::Controller::WrapCGI/AUTHOR> and
+L<Catalyst::Controller::WrapCGI/CONTRIBUTORS>.
This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
Modified: trunk/Catalyst-Controller-WrapCGI/lib/Catalyst/Controller/WrapCGI.pm
===================================================================
--- trunk/Catalyst-Controller-WrapCGI/lib/Catalyst/Controller/WrapCGI.pm 2009-12-05 22:32:19 UTC (rev 12194)
+++ trunk/Catalyst-Controller-WrapCGI/lib/Catalyst/Controller/WrapCGI.pm 2009-12-06 03:50:13 UTC (rev 12195)
@@ -351,16 +351,6 @@
L<Catalyst::Controller::CGIBin>, L<CatalystX::GlobalContext>,
L<Catalyst::Controller>, L<CGI>, L<Catalyst>
-=head1 AUTHOR
-
-Matt S. Trout, C<< <mst at shadowcat.co.uk> >>
-
-=head1 CONTRIBUTORS
-
-Rafael Kitover C<< <rkitover at cpan.org> >>
-
-Hans Dieter Pearcey C<< <hdp at cpan.org> >>
-
=head1 BUGS
Please report any bugs or feature requests to C<bug-catalyst-controller-wrapcgi
@@ -393,9 +383,20 @@
=back
+=head1 AUTHOR
+
+Matt S. Trout C<< <mst at shadowcat.co.uk> >>
+
+=head1 CONTRIBUTORS
+
+Rafael Kitover C<< <rkitover at cpan.org> >>
+
+Hans Dieter Pearcey C<< <hdp at cpan.org> >>
+
=head1 COPYRIGHT & LICENSE
-Copyright (c) 2008 Matt S. Trout
+Copyright (c) 2008-2009 L<Catalyst::Controller::WrapCGI/AUTHOR> and
+L<Catalyst::Controller::WrapCGI/CONTRIBUTORS>.
This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
Modified: trunk/Catalyst-Controller-WrapCGI/lib/CatalystX/GlobalContext.pm
===================================================================
--- trunk/Catalyst-Controller-WrapCGI/lib/CatalystX/GlobalContext.pm 2009-12-05 22:32:19 UTC (rev 12194)
+++ trunk/Catalyst-Controller-WrapCGI/lib/CatalystX/GlobalContext.pm 2009-12-06 03:50:13 UTC (rev 12195)
@@ -77,10 +77,6 @@
L<Catalyst::Controller::CGIBin>, L<Catalyst::Controller::WrapCGI>,
L<Catalyst>
-=head1 AUTHOR
-
-Rafael Kitover, C<< <rkitover at cpan.org> >>
-
=head1 BUGS
Please report any bugs or feature requests to C<bug-catalyst-controller-wrapcgi
@@ -113,9 +109,15 @@
=back
+=head1 AUTHOR
+
+See L<Catalyst::Controller::WrapCGI/AUTHOR> and
+L<Catalyst::Controller::WrapCGI/CONTRIBUTORS>.
+
=head1 COPYRIGHT & LICENSE
-Copyright (c) 2008 Rafael Kitover
+Copyright (c) 2008-2009 L<Catalyst::Controller::WrapCGI/AUTHOR> and
+L<Catalyst::Controller::WrapCGI/CONTRIBUTORS>.
This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
Modified: trunk/Catalyst-Controller-WrapCGI/t/global-context.t
===================================================================
--- trunk/Catalyst-Controller-WrapCGI/t/global-context.t 2009-12-05 22:32:19 UTC (rev 12194)
+++ trunk/Catalyst-Controller-WrapCGI/t/global-context.t 2009-12-06 03:50:13 UTC (rev 12195)
@@ -2,35 +2,8 @@
use strict;
use warnings;
-
+use lib 't/lib';
use Test::More tests => 1;
+use Catalyst::Test 'TestGC';
-{
- package TestApp;
-
- use Catalyst;
- use CatalystX::GlobalContext ();
-
- sub auto : Private {
- my ($self, $c) = @_;
- CatalystX::GlobalContext->set_context($c);
- 1;
- }
-
- sub dummy : Local {
- my ($self, $c) = @_;
- $c->res->body(Dongs->foo);
- }
-
- __PACKAGE__->setup;
-
- package Dongs;
-
- use CatalystX::GlobalContext '$c';
-
- sub foo { $c->action }
-}
-
-use Catalyst::Test 'TestApp';
-
is(get('/dummy'), 'dummy', 'global context works');
Added: trunk/Catalyst-Controller-WrapCGI/t/lib/Dongs.pm
===================================================================
--- trunk/Catalyst-Controller-WrapCGI/t/lib/Dongs.pm (rev 0)
+++ trunk/Catalyst-Controller-WrapCGI/t/lib/Dongs.pm 2009-12-06 03:50:13 UTC (rev 12195)
@@ -0,0 +1,9 @@
+package Dongs;
+
+use strict;
+use warnings;
+use CatalystX::GlobalContext '$c';
+
+sub foo { $c->action }
+
+1;
Added: trunk/Catalyst-Controller-WrapCGI/t/lib/TestGC/Controller/Root.pm
===================================================================
--- trunk/Catalyst-Controller-WrapCGI/t/lib/TestGC/Controller/Root.pm (rev 0)
+++ trunk/Catalyst-Controller-WrapCGI/t/lib/TestGC/Controller/Root.pm 2009-12-06 03:50:13 UTC (rev 12195)
@@ -0,0 +1,22 @@
+package TestGC::Controller::Root;
+
+use strict;
+use warnings;
+use base 'Catalyst::Controller';
+use CatalystX::GlobalContext ();
+use Dongs ();
+
+__PACKAGE__->config->{namespace} = '';
+
+sub auto : Private {
+ my ($self, $c) = @_;
+ CatalystX::GlobalContext->set_context($c);
+ 1;
+}
+
+sub dummy : Local {
+ my ($self, $c) = @_;
+ $c->res->body(Dongs->foo);
+}
+
+1;
Added: trunk/Catalyst-Controller-WrapCGI/t/lib/TestGC.pm
===================================================================
--- trunk/Catalyst-Controller-WrapCGI/t/lib/TestGC.pm (rev 0)
+++ trunk/Catalyst-Controller-WrapCGI/t/lib/TestGC.pm 2009-12-06 03:50:13 UTC (rev 12195)
@@ -0,0 +1,8 @@
+package TestGC;
+
+use Catalyst::Runtime '5.70';
+use parent 'Catalyst';
+
+__PACKAGE__->setup;
+
+1;
Modified: trunk/Catalyst-Controller-WrapCGI/t/wrap-cgi.t
===================================================================
--- trunk/Catalyst-Controller-WrapCGI/t/wrap-cgi.t 2009-12-05 22:32:19 UTC (rev 12194)
+++ trunk/Catalyst-Controller-WrapCGI/t/wrap-cgi.t 2009-12-06 03:50:13 UTC (rev 12195)
@@ -21,7 +21,7 @@
$response = request POST '/cgi-bin/test.cgi', [
foo => 'bar',
bar => 'baz',
-], 'Content-Type' => 'form-data';
+], User_Agent => 'perl/5', Content_Type => 'form-data';
is($response->content, 'foo:bar bar:baz', 'POST to CGI (form-data)');
@@ -38,12 +38,13 @@
],
quux => [ undef, quux => Content => 4 ],
],
- 'Content-Type' => 'form-data';
+ User_Agent => 'perl/5',
+ Content_Type => 'form-data';
is($response->content, 'foo:1 bar:2 baz:3 quux:4', 'POST with file upload');
$response = request '/cgi-bin/test_pathinfo.cgi/path/%2Finfo';
-is($response->content, '/path/%2Finfo', 'PATH_INFO is correct');
+is($response->content, '/path//info', 'PATH_INFO is correct');
$response = request '/cgi-bin/test_filepathinfo.cgi/path/%2Finfo';
is($response->content, '/test_filepath_info/path/%2Finfo',
More information about the Catalyst-commits
mailing list