From: Florian Ragwitz Date: Thu, 14 Jan 2010 04:02:47 +0000 (+0000) Subject: Merge branch 'master' into psgi X-Git-Tag: 5.89000~42 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=d5c1270360c155009fa138b6f0630044304f3c86;hp=22a5833d436649391dc95877ca33f549308c6c3c Merge branch 'master' into psgi master: Depend on n:c 0.12 to work on perl >= 5.11.2. Version 5.80018. canonical() is a no-op for the base uri. Fix a deprecation warning in the tests. Fix URI bug masked by HTTP::Request::AsCGI Deprecate bare imports of Catalyst::Test - either use an app name or don't run the import method. As-per r12564 Apply patch to clarify uri_for action from Octavian Rasnita on list Version 5.80017. require autoclean once only Bump version of ::Role::WithOverloading Bump dep Un stupid Correctly pass argv option into Catalyst::Engine::HTTP Changelog Adopt::NEXT warnings Back out r12493, use \Q instead Don't screw over people using --detach, Clarify comment. Conflicts: lib/Catalyst/Engine/CGI.pm lib/Catalyst/Engine/HTTP.pm t/aggregate/unit_core_script_server.t --- diff --git a/Changes b/Changes index e29a5a4..236786b 100644 --- a/Changes +++ b/Changes @@ -1,18 +1,50 @@ # This file documents the revision history for Perl extension Catalyst. +5.80018 2010-01-12 22:24:20 + + Bug fixed: + - Call ->canonical on URI derived from $ENV{REQUEST_URI} to get + paths correctly decoded. This bug was previously hidden by a bug + in HTTP::Request::AsCGI + + Documentation: + - Clarify that uri_for_action works on private paths, with example. + + Deprecations: + - Saying use Catalyst::Test; (without an application name or () to stop + the importer running is now deprecated and will issue a warning. + You should be saying use Catalyst::Test (); + +5.80017 2010-01-10 02:27:29 + Documentation: - Fix docs for ->forward method when passed a class name - this should be a component name (e.g. View::HTML, not a full class name, like MyApp::View::HTML). Bug fixes: - - Remove the erroneous --detach option from Catalyst::Script::FastCGI - - --daemon option to Catalyst::Script::FastCGI is fixed. + - --daemon and -d options to Catalyst::Script::FastCGI are fixed. - Fix the debug dump for applications which use Catalyst::Plugin::Session (RT#52898) - Fix regression in the case where mod_rewrite is being used to rewrite requests into a path below your application base introduced with the %2F related fixes in 5.80014_02. + - Do not crash on SIGHUP if Catalyst::Engine::HTTP->run is not passed the + argv key in the options hash. + - Correctly pass the arguments to Catalyst::Script::Server through to + Catalyst::Engine::HTTP->run so that the server can restart itself + with the correct options on SIGHUP. + - Require new MooseX::MethodAttributes to be compatible with Moose + versions >= 0.93_01 + - Require new MooseX::Role::WithOverloading to be compatible with Moose + versions >= 0.93_01 + + Cleanups: + - Stop suppressing warnings from Class::C3::Adopt::NEXT now that most plugins + have been updated to not use NEXT. If you get warnings then please upgrade + your components or log a bug with the component author if an upgrade is + not available. The Class::C3::Adopt::NEXT documentation contains information + about how to suppress the warnings in your application if you need to. 5.80016 2009-12-11 23:23:33 diff --git a/Makefile.PL b/Makefile.PL index d779464..d3bcff3 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -17,14 +17,13 @@ all_from 'lib/Catalyst/Runtime.pm'; requires 'List::MoreUtils'; requires 'namespace::autoclean' => '0.09'; -requires 'namespace::clean'; -requires 'namespace::autoclean'; +requires 'namespace::clean' => '0.12'; requires 'B::Hooks::EndOfScope' => '0.08'; requires 'MooseX::Emulate::Class::Accessor::Fast' => '0.00903'; requires 'Class::MOP' => '0.95'; requires 'Moose' => '0.93'; -requires 'MooseX::MethodAttributes::Inheritable' => '0.17'; -requires 'MooseX::Role::WithOverloading' => '0.03'; +requires 'MooseX::MethodAttributes::Inheritable' => '0.19'; +requires 'MooseX::Role::WithOverloading' => '0.05'; requires 'Carp'; requires 'Class::C3::Adopt::NEXT' => '0.07'; requires 'CGI::Simple::Cookie'; diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index 737ccc4..06130d1 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -79,7 +79,7 @@ __PACKAGE__->stats_class('Catalyst::Stats'); # Remember to update this in Catalyst::Runtime as well! -our $VERSION = '5.80016'; +our $VERSION = '5.80018'; $VERSION = eval $VERSION; sub import { @@ -1330,6 +1330,20 @@ $c->uri_for >>. You can also pass in a Catalyst::Action object, in which case it is passed to C<< $c->uri_for >>. +Note that although the path looks like a URI that dispatches to the wanted action, it is not a URI, but an internal path to that action. + +For example, if the action looks like: + + package MyApp::Controller::Users; + + sub lst : Path('the-list') {} + +You can use: + + $c->uri_for_action('/users/lst') + +and it will create the URI /users/the-list. + =back =cut @@ -2889,6 +2903,8 @@ numa: Dan Sully obra: Jesse Vincent +Octavian Rasnita + omega: Andreas Marienborg Oleg Kostyuk diff --git a/lib/Catalyst/Engine.pm b/lib/Catalyst/Engine.pm index ff7e548..ee4477a 100644 --- a/lib/Catalyst/Engine.pm +++ b/lib/Catalyst/Engine.pm @@ -304,7 +304,8 @@ sub finalize_error { - # Trick IE + # Trick IE. Old versions of IE would display their own error page instead + # of ours if we'd give it less than 512 bytes. $c->res->{body} .= ( ' ' x 512 ); # Return 500 diff --git a/lib/Catalyst/Runtime.pm b/lib/Catalyst/Runtime.pm index 74d9ce1..c65bfbb 100644 --- a/lib/Catalyst/Runtime.pm +++ b/lib/Catalyst/Runtime.pm @@ -7,7 +7,7 @@ BEGIN { require 5.008004; } # Remember to update this in Catalyst as well! -our $VERSION='5.80016'; +our $VERSION='5.80018'; $VERSION = eval $VERSION; diff --git a/lib/Catalyst/Script/FastCGI.pm b/lib/Catalyst/Script/FastCGI.pm index f4c3c27..c806439 100644 --- a/lib/Catalyst/Script/FastCGI.pm +++ b/lib/Catalyst/Script/FastCGI.pm @@ -27,7 +27,7 @@ has daemon => ( traits => [qw(Getopt)], isa => Bool, is => 'ro', - cmd_aliases => 'd', + cmd_aliases => [qw/d detach/], # Eww, detach is here as we fucked it up.. Deliberately not documented documentation => 'Daemonize (go into the background)', ); diff --git a/lib/Catalyst/Script/Server.pm b/lib/Catalyst/Script/Server.pm index 7798c55..003a57e 100644 --- a/lib/Catalyst/Script/Server.pm +++ b/lib/Catalyst/Script/Server.pm @@ -195,6 +195,7 @@ sub _application_args { $self->port, $self->host, { + argv => $self->ARGV, map { $_ => $self->$_ } qw/ fork keepalive diff --git a/lib/Catalyst/Test.pm b/lib/Catalyst/Test.pm index 7868e03..3962927 100644 --- a/lib/Catalyst/Test.pm +++ b/lib/Catalyst/Test.pm @@ -107,6 +107,12 @@ our $default_host; sub import { my ($self, $class, $opts) = @_; + Carp::carp( +qq{Importing Catalyst::Test without an application name is deprecated:\n +Instead of saying: use Catalyst::Test; +say: use Catalyst::Test (); # If you don't want to import a test app right now. +or say: use Catalyst::Test 'MyApp'; # If you do want to import a test app.\n\n}) + unless $class; $import->($self, '-all' => { class => $class }); $opts = {} unless ref $opts eq 'HASH'; $default_host = $opts->{default_host} if exists $opts->{default_host}; diff --git a/t/aggregate/deprecated_test_import.t b/t/aggregate/deprecated_test_import.t new file mode 100644 index 0000000..ee90eea --- /dev/null +++ b/t/aggregate/deprecated_test_import.t @@ -0,0 +1,16 @@ +use strict; +use warnings; + +use Test::More; +use Catalyst::Test (); + +my $warn; +{ + local $SIG{__WARN__} = sub { $warn = shift; }; + Catalyst::Test->import(); +} +ok $warn; +like $warn, qr/deprecated/; + +done_testing; + diff --git a/t/aggregate/unit_core_script_server.t b/t/aggregate/unit_core_script_server.t index d901354..2508452 100644 --- a/t/aggregate/unit_core_script_server.t +++ b/t/aggregate/unit_core_script_server.t @@ -91,6 +91,8 @@ sub testOption { shift @TestAppToTestScripts::RUN_ARGS; my $server = shift @TestAppToTestScripts::RUN_ARGS; like ref($server), qr/^Plack::Server/, 'Is a Plack Server'; + # Mangle argv into the options.. + $resultarray->[-1]->{argv} = $argstring; is_deeply \@TestAppToTestScripts::RUN_ARGS, $resultarray, "is_deeply comparison " . join(' ', @$argstring); } diff --git a/t/aggregate/unit_load_catalyst_test.t b/t/aggregate/unit_load_catalyst_test.t index 00a829d..399b190 100644 --- a/t/aggregate/unit_load_catalyst_test.t +++ b/t/aggregate/unit_load_catalyst_test.t @@ -3,9 +3,7 @@ use strict; use warnings; -use FindBin; -use lib "$FindBin::Bin/../lib"; -use Test::More tests => 61; +use Test::More; use FindBin qw/$Bin/; use lib "$Bin/../lib"; use Catalyst::Utils; @@ -26,7 +24,7 @@ my %Meth = ( ### make sure we're not trying to connect to a remote host -- these are local tests local $ENV{CATALYST_SERVER}; -use_ok( $Class ); +use Catalyst::Test (); ### check available methods { ### turn of redefine warnings, we'll get new subs exported @@ -155,3 +153,4 @@ lives_ok { request(GET('/dummy'), []); } 'array additional param to request method ignored'; +done_testing;