r48858 - in /branches/upstream/libcatalyst-perl/current: ./ inc/Module/Install/ lib/ lib/Catalyst/ lib/Catalyst/Engine/ lib/Catalyst/Script/ t/aggregate/ t/lib/TestApp/Controller/Action/Chained/ t/lib/TestAppEncoding/Controller/

jawnsy-guest at users.alioth.debian.org jawnsy-guest at users.alioth.debian.org
Wed Dec 16 04:46:11 UTC 2009


Author: jawnsy-guest
Date: Wed Dec 16 04:45:54 2009
New Revision: 48858

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=48858
Log:
[svn-upgrade] Integrating new upstream version, libcatalyst-perl (5.80016)

Added:
    branches/upstream/libcatalyst-perl/current/t/aggregate/unit_core_engine_cgi-prepare_path.t
Modified:
    branches/upstream/libcatalyst-perl/current/Changes
    branches/upstream/libcatalyst-perl/current/MANIFEST
    branches/upstream/libcatalyst-perl/current/META.yml
    branches/upstream/libcatalyst-perl/current/inc/Module/Install/AuthorRequires.pm
    branches/upstream/libcatalyst-perl/current/inc/Module/Install/CheckConflicts.pm
    branches/upstream/libcatalyst-perl/current/lib/Catalyst.pm
    branches/upstream/libcatalyst-perl/current/lib/Catalyst/Engine.pm
    branches/upstream/libcatalyst-perl/current/lib/Catalyst/Engine/CGI.pm
    branches/upstream/libcatalyst-perl/current/lib/Catalyst/Request.pm
    branches/upstream/libcatalyst-perl/current/lib/Catalyst/Runtime.pm
    branches/upstream/libcatalyst-perl/current/lib/Catalyst/Script/Create.pm
    branches/upstream/libcatalyst-perl/current/lib/Catalyst/Script/FastCGI.pm
    branches/upstream/libcatalyst-perl/current/lib/Catalyst/Script/Server.pm
    branches/upstream/libcatalyst-perl/current/t/aggregate/live_component_controller_action_chained.t
    branches/upstream/libcatalyst-perl/current/t/aggregate/unit_core_script_create.t
    branches/upstream/libcatalyst-perl/current/t/aggregate/unit_core_script_fastcgi.t
    branches/upstream/libcatalyst-perl/current/t/aggregate/unit_core_script_server.t
    branches/upstream/libcatalyst-perl/current/t/lib/TestApp/Controller/Action/Chained/CaptureArgs.pm
    branches/upstream/libcatalyst-perl/current/t/lib/TestAppEncoding/Controller/Root.pm

Modified: branches/upstream/libcatalyst-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcatalyst-perl/current/Changes?rev=48858&op=diff
==============================================================================
--- branches/upstream/libcatalyst-perl/current/Changes (original)
+++ branches/upstream/libcatalyst-perl/current/Changes Wed Dec 16 04:45:54 2009
@@ -1,4 +1,36 @@
 # This file documents the revision history for Perl extension Catalyst.
+
+5.80016 2009-12-11 23:23:33
+
+  Bug fixes:
+
+   - Fix slurping a file to work correctly with binary on Win32 in the
+     encoding test controller.
+
+  Bug fixes in the new scripts (for applications which have been upgraded):
+
+   - Allow --restartdirectory as an option for the Server script, for
+     backwards compatibility. (Dave Rolsky)
+   - The --host option for the server script defaulted to localhost, rather
+     than listening on all interfaces, which was the previous default. (Dave
+     Rolsky)
+   - Restore -p option for pid file in the FastCGI server script.
+   - Fix the script environment variables MYAPP_PORT and MYAPP_RELOAD RT#52604
+   - Fix aliasing applications under non-root paths with mod_rewrite in
+     some apache versions where %ENV{SCRIPT_NAME} is set to the real name of
+     the script, by using $ENV{REDIRECT_URL} which contains the non-rewritten
+     URI.
+   - Fix usage display when myapp_create.pl is run with no arguments. RT#52630
+
+  New features:
+
+   - The __MOP__ hash element is suppressed from being dumped fully
+     (and instead stringified) when dumping the error screen to be
+     less packed with information of no use.
+
+  Documentation:
+
+   - Fix Pod nits (RT#52370)
 
 5.80015 2009-12-02 15:13:54
   Bug fixes:

Modified: branches/upstream/libcatalyst-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcatalyst-perl/current/MANIFEST?rev=48858&op=diff
==============================================================================
--- branches/upstream/libcatalyst-perl/current/MANIFEST (original)
+++ branches/upstream/libcatalyst-perl/current/MANIFEST Wed Dec 16 04:45:54 2009
@@ -133,6 +133,7 @@
 t/aggregate/unit_core_component_layers.t
 t/aggregate/unit_core_component_loading.t
 t/aggregate/unit_core_component_mro.t
+t/aggregate/unit_core_engine_cgi-prepare_path.t
 t/aggregate/unit_core_engine_fixenv-iis6.t
 t/aggregate/unit_core_engine_fixenv-lighttpd.t
 t/aggregate/unit_core_log.t

Modified: branches/upstream/libcatalyst-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcatalyst-perl/current/META.yml?rev=48858&op=diff
==============================================================================
--- branches/upstream/libcatalyst-perl/current/META.yml (original)
+++ branches/upstream/libcatalyst-perl/current/META.yml Wed Dec 16 04:45:54 2009
@@ -10,7 +10,7 @@
 configure_requires:
   ExtUtils::MakeMaker: 6.42
 distribution_type: module
-generated_by: 'Module::Install version 0.91'
+generated_by: 'Module::Install version 0.910'
 license: perl
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -64,4 +64,4 @@
   homepage: http://dev.catalyst.perl.org/
   license: http://dev.perl.org/licenses/
   repository: http://dev.catalyst.perl.org/repos/Catalyst/Catalyst-Runtime/
-version: 5.80015
+version: 5.80016

Modified: branches/upstream/libcatalyst-perl/current/inc/Module/Install/AuthorRequires.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcatalyst-perl/current/inc/Module/Install/AuthorRequires.pm?rev=48858&op=diff
==============================================================================
--- branches/upstream/libcatalyst-perl/current/inc/Module/Install/AuthorRequires.pm (original)
+++ branches/upstream/libcatalyst-perl/current/inc/Module/Install/AuthorRequires.pm Wed Dec 16 04:45:54 2009
@@ -4,14 +4,13 @@
 
 package Module::Install::AuthorRequires;
 
+use base 'Module::Install::Base';
+
 # cargo cult
 BEGIN {
-    our $VERSION = '0.01';
+    our $VERSION = '0.02';
     our $ISCORE  = 1;
-#    our @ISA     = qw{Module::Install::Base};
 }
-
-use base qw/Module::Install::Base/;
 
 sub author_requires {
     my $self = shift;
@@ -36,4 +35,4 @@
 
 __END__
 
-#line 93
+#line 92

Modified: branches/upstream/libcatalyst-perl/current/inc/Module/Install/CheckConflicts.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcatalyst-perl/current/inc/Module/Install/CheckConflicts.pm?rev=48858&op=diff
==============================================================================
--- branches/upstream/libcatalyst-perl/current/inc/Module/Install/CheckConflicts.pm (original)
+++ branches/upstream/libcatalyst-perl/current/inc/Module/Install/CheckConflicts.pm Wed Dec 16 04:45:54 2009
@@ -12,8 +12,10 @@
 }
 
 sub check_conflicts {
-    my ($self, %conflicts) = @_;
-
+    my $self = shift;
+    # Deal with the fact that prompt_script calls us with just the script
+    # name by totally ignoring it. HACK!
+    my %conflicts = @_ unless scalar(@_) == 1;
     my %conflicts_found;
     for my $mod (sort keys %conflicts) {
         next unless $self->can_use($mod);
@@ -62,4 +64,4 @@
 
 __END__
 
-#line 122
+#line 124

Modified: branches/upstream/libcatalyst-perl/current/lib/Catalyst.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcatalyst-perl/current/lib/Catalyst.pm?rev=48858&op=diff
==============================================================================
--- branches/upstream/libcatalyst-perl/current/lib/Catalyst.pm (original)
+++ branches/upstream/libcatalyst-perl/current/lib/Catalyst.pm Wed Dec 16 04:45:54 2009
@@ -78,7 +78,7 @@
 
 # Remember to update this in Catalyst::Runtime as well!
 
-our $VERSION = '5.80015';
+our $VERSION = '5.80016';
 
 {
     my $dev_version = $VERSION =~ /_\d{2}$/;
@@ -2686,12 +2686,11 @@
 
 =item *
 
-C<default_model> - The default model picked if you say C<< $c->model >>. See L</$c->model($name)>.
+C<default_model> - The default model picked if you say C<< $c->model >>. See L<< /$c->model($name) >>.
 
 =item *
 
-C<default_view> - The default view to be rendered or returned when C<< $c->view >>. See L</$c->view($name)>.
-is called.
+C<default_view> - The default view to be rendered or returned when C<< $c->view >> is called. See L<< /$c->view($name) >>.
 
 =item *
 

Modified: branches/upstream/libcatalyst-perl/current/lib/Catalyst/Engine.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcatalyst-perl/current/lib/Catalyst/Engine.pm?rev=48858&op=diff
==============================================================================
--- branches/upstream/libcatalyst-perl/current/lib/Catalyst/Engine.pm (original)
+++ branches/upstream/libcatalyst-perl/current/lib/Catalyst/Engine.pm Wed Dec 16 04:45:54 2009
@@ -108,6 +108,24 @@
 
 =cut
 
+sub _dump_error_page_element {
+    my ($self, $i, $element) = @_;
+    my ($name, $val)  = @{ $element };
+
+    # This is fugly, but the metaclass is _HUGE_ and demands waaay too much
+    # scrolling. Suggestions for more pleasant ways to do this welcome.
+    local $val->{'__MOP__'} = "Stringified: "
+        . $val->{'__MOP__'} if exists $val->{'__MOP__'};
+
+    my $text = encode_entities( dump( $val ));
+    sprintf <<"EOF", $name, $text;
+<h2><a href="#" onclick="toggleDump('dump_$i'); return false">%s</a></h2>
+<div id="dump_$i">
+    <pre wrap="">%s</pre>
+</div>
+EOF
+}
+
 sub finalize_error {
     my ( $self, $c ) = @_;
 
@@ -138,14 +156,7 @@
         my @infos;
         my $i = 0;
         for my $dump ( $c->dump_these ) {
-            my $name  = $dump->[0];
-            my $value = encode_entities( dump( $dump->[1] ));
-            push @infos, sprintf <<"EOF", $name, $value;
-<h2><a href="#" onclick="toggleDump('dump_$i'); return false">%s</a></h2>
-<div id="dump_$i">
-    <pre wrap="">%s</pre>
-</div>
-EOF
+            push @infos, $self->_dump_error_page_element($i, $dump);
             $i++;
         }
         $infos = join "\n", @infos;

Modified: branches/upstream/libcatalyst-perl/current/lib/Catalyst/Engine/CGI.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcatalyst-perl/current/lib/Catalyst/Engine/CGI.pm?rev=48858&op=diff
==============================================================================
--- branches/upstream/libcatalyst-perl/current/lib/Catalyst/Engine/CGI.pm (original)
+++ branches/upstream/libcatalyst-perl/current/lib/Catalyst/Engine/CGI.pm Wed Dec 16 04:45:54 2009
@@ -108,6 +108,8 @@
 
 =cut
 
+# Please don't touch this method without adding tests in
+# t/aggregate/unit_core_engine_cgi-prepare_path.t
 sub prepare_path {
     my ( $self, $c ) = @_;
     local (*ENV) = $self->env || \%ENV;
@@ -153,9 +155,7 @@
     # Here we try to resurrect the original encoded URI from REQUEST_URI.
     my $path_info   = $ENV{PATH_INFO};
     if (my $req_uri = $ENV{REQUEST_URI}) {
-        if (defined $script_name) {
-            $req_uri =~ s/^\Q$script_name\E//;
-        }
+        $req_uri =~ s/^\Q$base_path\E//;
         $req_uri =~ s/\?.*$//;
         $path_info = $req_uri if $req_uri;
     }

Modified: branches/upstream/libcatalyst-perl/current/lib/Catalyst/Request.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcatalyst-perl/current/lib/Catalyst/Request.pm?rev=48858&op=diff
==============================================================================
--- branches/upstream/libcatalyst-perl/current/lib/Catalyst/Request.pm (original)
+++ branches/upstream/libcatalyst-perl/current/lib/Catalyst/Request.pm Wed Dec 16 04:45:54 2009
@@ -673,14 +673,6 @@
     return $uri;
 }
 
-=head2 $req->user
-
-Returns the currently logged in user. B<Highly deprecated>, do not call,
-this will be removed in version 5.81. To retrieve the currently authenticated
-user, see C<< $c->user >> and C<< $c->user_exists >> in
-L<Catalyst::Plugin::Authentication>. For the C<REMOTE_USER> provided by the
-webserver, see C<< $req->remote_user >> below.
-
 =head2 $req->remote_user
 
 Returns the value of the C<REMOTE_USER> environment variable.

Modified: branches/upstream/libcatalyst-perl/current/lib/Catalyst/Runtime.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcatalyst-perl/current/lib/Catalyst/Runtime.pm?rev=48858&op=diff
==============================================================================
--- branches/upstream/libcatalyst-perl/current/lib/Catalyst/Runtime.pm (original)
+++ branches/upstream/libcatalyst-perl/current/lib/Catalyst/Runtime.pm Wed Dec 16 04:45:54 2009
@@ -7,7 +7,7 @@
 
 # Remember to update this in Catalyst as well!
 
-our $VERSION='5.80015';
+our $VERSION='5.80016';
 
 $VERSION = eval $VERSION;
 

Modified: branches/upstream/libcatalyst-perl/current/lib/Catalyst/Script/Create.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcatalyst-perl/current/lib/Catalyst/Script/Create.pm?rev=48858&op=diff
==============================================================================
--- branches/upstream/libcatalyst-perl/current/lib/Catalyst/Script/Create.pm (original)
+++ branches/upstream/libcatalyst-perl/current/lib/Catalyst/Script/Create.pm Wed Dec 16 04:45:54 2009
@@ -40,13 +40,13 @@
 sub run {
     my ($self) = @_;
 
-    $self->_exit_with_usage if !$self->ARGV->[0];
+    $self->_getopt_full_usage if !$self->ARGV->[0];
 
     my $helper_class = $self->helper_class;
     Class::MOP::load_class($helper_class);
     my $helper = $helper_class->new( { '.newfiles' => !$self->force, mech => $self->mechanize } );
 
-    $self->_exit_with_usage unless $helper->mk_component( $self->application_name, @ARGV );
+    $self->_getopt_full_usage unless $helper->mk_component( $self->application_name, @ARGV );
 
 }
 

Modified: branches/upstream/libcatalyst-perl/current/lib/Catalyst/Script/FastCGI.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcatalyst-perl/current/lib/Catalyst/Script/FastCGI.pm?rev=48858&op=diff
==============================================================================
--- branches/upstream/libcatalyst-perl/current/lib/Catalyst/Script/FastCGI.pm (original)
+++ branches/upstream/libcatalyst-perl/current/lib/Catalyst/Script/FastCGI.pm Wed Dec 16 04:45:54 2009
@@ -17,7 +17,7 @@
 
 has pidfile => (
     traits        => [qw(Getopt)],
-    cmd_aliases   => 'pid',
+    cmd_aliases   => [qw/pid p/],
     isa           => Str,
     is            => 'ro',
     documentation => 'Specify a pidfile',

Modified: branches/upstream/libcatalyst-perl/current/lib/Catalyst/Script/Server.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcatalyst-perl/current/lib/Catalyst/Script/Server.pm?rev=48858&op=diff
==============================================================================
--- branches/upstream/libcatalyst-perl/current/lib/Catalyst/Script/Server.pm (original)
+++ branches/upstream/libcatalyst-perl/current/lib/Catalyst/Script/Server.pm Wed Dec 16 04:45:54 2009
@@ -8,6 +8,7 @@
 use Moose;
 use MooseX::Types::Common::Numeric qw/PositiveInt/;
 use MooseX::Types::Moose qw/ArrayRef Str Bool Int RegexpRef/;
+use Catalyst::Utils;
 use namespace::autoclean;
 
 with 'Catalyst::ScriptRole';
@@ -27,8 +28,8 @@
     cmd_aliases   => 'h',
     isa           => Str,
     is            => 'ro',
-    default       => 'localhost',
-    documentation => 'Specify an IP on this host for the server to bind to',
+    # N.B. undef (the default) means we bind on all interfaces on the host.
+    documentation => 'Specify a hostname or IP on this host for the server to bind to',
 );
 
 has fork => (
@@ -45,7 +46,9 @@
     cmd_aliases   => 'p',
     isa           => PositiveInt,
     is            => 'ro',
-    default       => 3000,
+    default       => sub {
+        Catalyst::Utils::env_value(shift->application_name, 'port') || 3000
+    },
     documentation => 'Specify a different listening port (to the default port 3000)',
 );
 
@@ -80,13 +83,15 @@
     cmd_aliases   => 'r',
     isa           => Bool,
     is            => 'ro',
-    default       => 0,
+    default       => sub {
+        Catalyst::Utils::env_value(shift->application_name, 'reload') || 0;
+    },
     documentation => 'use Catalyst::Restarter to detect code changes and restart the application',
 );
 
 has restart_directory => (
     traits        => [qw(Getopt)],
-    cmd_aliases   => 'rdir',
+    cmd_aliases   => [ 'rdir', 'restartdirectory' ],
     isa           => ArrayRef[Str],
     is            => 'ro',
     documentation => 'Restarter directory to watch',
@@ -219,12 +224,12 @@
    -k     --keepalive      enable keep-alive connections
    -r     --restart        restart when files get modified
                        (defaults to false)
-   --rd   --restartdelay  delay between file checks
+   --rd   --restart_delay  delay between file checks
                       (ignored if you have Linux::Inotify2 installed)
-   --rr   --restartregex  regex match files that trigger
+   --rr   --restart_regex  regex match files that trigger
                       a restart when modified
                       (defaults to '\.yml$|\.yaml$|\.conf|\.pm$')
-   --rdir --restartdirectory  the directory to search for
+   --rdir --restart_directory  the directory to search for
                       modified files, can be set mulitple times
                       (defaults to '[SCRIPT_DIR]/..')
    --sym  --follow_symlinks   follow symlinks in search directories

Modified: branches/upstream/libcatalyst-perl/current/t/aggregate/live_component_controller_action_chained.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcatalyst-perl/current/t/aggregate/live_component_controller_action_chained.t?rev=48858&op=diff
==============================================================================
--- branches/upstream/libcatalyst-perl/current/t/aggregate/live_component_controller_action_chained.t (original)
+++ branches/upstream/libcatalyst-perl/current/t/aggregate/live_component_controller_action_chained.t Wed Dec 16 04:45:54 2009
@@ -928,6 +928,28 @@
         is( $response->header('X-Catalyst-Executed'),
             $expected, 'Executed actions' );
         is( $response->content, 'base; one_arg; edit_one_arg', 'Content OK' );
+        }
+    }
+
+    #  PathPart('...') Args(1) should win over CaptureArgs(2) PathPart('')
+    {
+        my @expected = qw[
+          TestApp::Controller::Action::Chained->begin
+          TestApp::Controller::Action::Chained::CaptureArgs->base
+          TestApp::Controller::Action::Chained::CaptureArgs->test_one_arg
+          TestApp::Controller::Action::Chained::CaptureArgs->end
+        ];
+
+        my $expected = join( ", ", @expected );
+
+        # should dispatch to /base/test_one_arg
+        ok( my $response = request('http://localhost/captureargs/test/one'),
+            'Correct pathpart/arg ran' );
+        TODO: {
+        local $TODO = 'Known bug';
+        is( $response->header('X-Catalyst-Executed'),
+            $expected, 'Executed actions' );
+        is( $response->content, 'base; test_plus_arg; one;', 'Content OK' );
         }
     }
 

Added: branches/upstream/libcatalyst-perl/current/t/aggregate/unit_core_engine_cgi-prepare_path.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcatalyst-perl/current/t/aggregate/unit_core_engine_cgi-prepare_path.t?rev=48858&op=file
==============================================================================
--- branches/upstream/libcatalyst-perl/current/t/aggregate/unit_core_engine_cgi-prepare_path.t (added)
+++ branches/upstream/libcatalyst-perl/current/t/aggregate/unit_core_engine_cgi-prepare_path.t Wed Dec 16 04:45:54 2009
@@ -1,0 +1,74 @@
+use strict;
+use warnings;
+use Test::More;
+use FindBin qw/$Bin/;
+use lib "$Bin/../lib";
+use TestApp;
+use Catalyst::Engine::CGI;
+
+# mod_rewrite to app root for non / based app
+{
+    my $r = get_req (
+        REDIRECT_URL => '/comics/',
+        SCRIPT_NAME => '/comics/dispatch.cgi',
+        REQUEST_URI => '/comics/',
+    );
+    is ''.$r->uri, 'http://www.foo.com/comics/';
+    is ''.$r->base, 'http://www.foo.com/comics/';
+}
+
+# mod_rewrite to sub path under app root for non / based app
+{
+    my $r = get_req (
+        PATH_INFO  => '/foo/bar.gif',
+        REDIRECT_URL => '/comics/foo/bar.gif',
+        SCRIPT_NAME => '/comics/dispatch.cgi',
+        REQUEST_URI => '/comics/foo/bar.gif',
+    );
+    is ''.$r->uri, 'http://www.foo.com/comics/foo/bar.gif';
+    is ''.$r->base, 'http://www.foo.com/comics/';
+}
+
+# Standard CGI hit for non / based app
+{
+    my $r = get_req (
+        PATH_INFO => '/static/css/blueprint/screen.css',
+        SCRIPT_NAME => '/~bobtfish/Gitalist/script/gitalist.cgi',
+        REQUEST_URI => '/~bobtfish/Gitalist/script/gitalist.cgi/static/css/blueprint/screen.css',
+    );
+    is ''.$r->uri, 'http://www.foo.com/~bobtfish/Gitalist/script/gitalist.cgi/static/css/blueprint/screen.css';
+    is ''.$r->base, 'http://www.foo.com/~bobtfish/Gitalist/script/gitalist.cgi/';
+}
+# / %2F %252F escaping case.
+{
+    my $r = get_req (
+        PATH_INFO => '/%2F/%2F',
+        SCRIPT_NAME => '/~bobtfish/Gitalist/script/gitalist.cgi',
+        REQUEST_URI => '/~bobtfish/Gitalist/script/gitalist.cgi/%252F/%252F',
+    );
+    is ''.$r->uri, 'http://www.foo.com/~bobtfish/Gitalist/script/gitalist.cgi/%252F/%252F';
+    is ''.$r->base, 'http://www.foo.com/~bobtfish/Gitalist/script/gitalist.cgi/';
+}
+
+# FIXME - Test proxy logic
+#       - Test query string
+#       - Test non standard port numbers
+#       - Test // in PATH_INFO
+#       - Test scheme (secure request on port 80)
+
+sub get_req {
+    my %template = (
+        HTTP_HOST => 'www.foo.com',
+        PATH_INFO => '/',
+    );
+
+    local %ENV = (%template, @_);
+
+    my $i = TestApp->new;
+    $i->engine(Catalyst::Engine::CGI->new);
+    $i->engine->prepare_path($i);
+    return $i->req;
+}
+
+done_testing;
+

Modified: branches/upstream/libcatalyst-perl/current/t/aggregate/unit_core_script_create.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcatalyst-perl/current/t/aggregate/unit_core_script_create.t?rev=48858&op=diff
==============================================================================
--- branches/upstream/libcatalyst-perl/current/t/aggregate/unit_core_script_create.t (original)
+++ branches/upstream/libcatalyst-perl/current/t/aggregate/unit_core_script_create.t Wed Dec 16 04:45:54 2009
@@ -12,7 +12,7 @@
     use Moose;
     extends 'Catalyst::Script::Create';
     our $help;
-    sub _exit_with_usage { $help++ }
+    sub _getopt_full_usage { $help++ }
 }
 
 {

Modified: branches/upstream/libcatalyst-perl/current/t/aggregate/unit_core_script_fastcgi.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcatalyst-perl/current/t/aggregate/unit_core_script_fastcgi.t?rev=48858&op=diff
==============================================================================
--- branches/upstream/libcatalyst-perl/current/t/aggregate/unit_core_script_fastcgi.t (original)
+++ branches/upstream/libcatalyst-perl/current/t/aggregate/unit_core_script_fastcgi.t Wed Dec 16 04:45:54 2009
@@ -22,9 +22,10 @@
 testOption( [ qw/-d/ ], [undef, opthash()] );
 testOption( [ qw/--daemon/ ], [undef, opthash()] );
 
-# pidfile        -pidfile                  --pid --pidfile
+# pidfile        -pidfile -p                 --pid --pidfile
 testOption( [ qw/--pidfile cat.pid/ ], [undef, opthash(pidfile => 'cat.pid')] );
 testOption( [ qw/--pid cat.pid/ ], [undef, opthash(pidfile => 'cat.pid')] );
+testOption( [ qw/-p cat.pid/ ], [undef, opthash(pidfile => 'cat.pid')] );
 
 # manager
 testOption( [ qw/--manager foo::bar/ ], [undef, opthash(manager => 'foo::bar')] );

Modified: branches/upstream/libcatalyst-perl/current/t/aggregate/unit_core_script_server.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcatalyst-perl/current/t/aggregate/unit_core_script_server.t?rev=48858&op=diff
==============================================================================
--- branches/upstream/libcatalyst-perl/current/t/aggregate/unit_core_script_server.t (original)
+++ branches/upstream/libcatalyst-perl/current/t/aggregate/unit_core_script_server.t Wed Dec 16 04:45:54 2009
@@ -12,7 +12,8 @@
 my $testopts;
 
 # Test default (no opts/args behaviour)
-testOption( [ qw// ], ['3000', 'localhost', opthash()] );
+# Note undef for host means we bind to all interfaces.
+testOption( [ qw// ], ['3000', undef, opthash()] );
 
 # Old version supports long format opts with either one or two dashes.  New version only supports two.
 #                Old                       New
@@ -23,31 +24,48 @@
 testOption( [ qw/-h testhost/ ], ['3000', 'testhost', opthash()] );
 
 # port           -p -port --port           -l --listen
-testOption( [ qw/-p 3001/ ], ['3001', 'localhost', opthash()] );
-testOption( [ qw/--port 3001/ ], ['3001', 'localhost', opthash()] );
+testOption( [ qw/-p 3001/ ], ['3001', undef, opthash()] );
+testOption( [ qw/--port 3001/ ], ['3001', undef, opthash()] );
+{
+    local $ENV{TESTAPPTOTESTSCRIPTS_PORT} = 5000;
+    testOption( [ qw// ], [5000, undef, opthash()] );
+}
+{
+    local $ENV{CATALYST_PORT} = 5000;
+    testOption( [ qw// ], [5000, undef, opthash()] );
+}
 
 # fork           -f -fork --fork           -f --fork
-testOption( [ qw/--fork/ ], ['3000', 'localhost', opthash(fork => 1)] );
-testOption( [ qw/-f/ ], ['3000', 'localhost', opthash(fork => 1)] );
+testOption( [ qw/--fork/ ], ['3000', undef, opthash(fork => 1)] );
+testOption( [ qw/-f/ ], ['3000', undef, opthash(fork => 1)] );
 
 # pidfile        -pidfile                  --pid --pidfile
-testOption( [ qw/--pidfile cat.pid/ ], ['3000', 'localhost', opthash(pidfile => "cat.pid")] );
-testOption( [ qw/--pid cat.pid/ ], ['3000', 'localhost', opthash(pidfile => "cat.pid")] );
+testOption( [ qw/--pidfile cat.pid/ ], ['3000', undef, opthash(pidfile => "cat.pid")] );
+testOption( [ qw/--pid cat.pid/ ], ['3000', undef, opthash(pidfile => "cat.pid")] );
 
 # keepalive      -k -keepalive --keepalive -k --keepalive
-testOption( [ qw/-k/ ], ['3000', 'localhost', opthash(keepalive => 1)] );
-testOption( [ qw/--keepalive/ ], ['3000', 'localhost', opthash(keepalive => 1)] );
+testOption( [ qw/-k/ ], ['3000', undef, opthash(keepalive => 1)] );
+testOption( [ qw/--keepalive/ ], ['3000', undef, opthash(keepalive => 1)] );
 
 # symlinks       -follow_symlinks          --sym --follow_symlinks
-testOption( [ qw/--follow_symlinks/ ], ['3000', 'localhost', opthash(follow_symlinks => 1)] );
-testOption( [ qw/--sym/ ], ['3000', 'localhost', opthash(follow_symlinks => 1)] );
+testOption( [ qw/--follow_symlinks/ ], ['3000', undef, opthash(follow_symlinks => 1)] );
+testOption( [ qw/--sym/ ], ['3000', undef, opthash(follow_symlinks => 1)] );
 
 # background     -background               --bg --background
-testOption( [ qw/--background/ ], ['3000', 'localhost', opthash(background => 1)] );
-testOption( [ qw/--bg/ ], ['3000', 'localhost', opthash(background => 1)] );
+testOption( [ qw/--background/ ], ['3000', undef, opthash(background => 1)] );
+testOption( [ qw/--bg/ ], ['3000', undef, opthash(background => 1)] );
 
 # restart        -r -restart --restart     -R --restart
 testRestart( ['-r'], restartopthash() );
+{
+    local $ENV{TESTAPPTOTESTSCRIPTS_RELOAD} = 1;
+    testRestart( [], restartopthash() );
+}
+{
+    local $ENV{CATALYST_RELOAD} = 1;
+    testRestart( [], restartopthash() );
+}
+
 # restart dly    -rd -restartdelay         --rd --restart_delay
 testRestart( ['-r', '--rd', 30], restartopthash(sleep_interval => 30) );
 testRestart( ['-r', '--restart_delay', 30], restartopthash(sleep_interval => 30) );
@@ -77,6 +95,7 @@
 sub testRestart {
     my ($argstring, $resultarray) = @_;
     my $app = _build_testapp($argstring);
+    ok $app->restart, 'App is in restart mode';
     my $args = {$app->_restarter_args};
     is_deeply delete $args->{argv}, $argstring, 'argv is arg string';
     is ref(delete $args->{start_sub}), 'CODE', 'Closure to start app present';

Modified: branches/upstream/libcatalyst-perl/current/t/lib/TestApp/Controller/Action/Chained/CaptureArgs.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcatalyst-perl/current/t/lib/TestApp/Controller/Action/Chained/CaptureArgs.pm?rev=48858&op=diff
==============================================================================
--- branches/upstream/libcatalyst-perl/current/t/lib/TestApp/Controller/Action/Chained/CaptureArgs.pm (original)
+++ branches/upstream/libcatalyst-perl/current/t/lib/TestApp/Controller/Action/Chained/CaptureArgs.pm Wed Dec 16 04:45:54 2009
@@ -5,15 +5,16 @@
 use base qw( Catalyst::Controller );
 
 #
-#   This controller builds two patterns of URI:
+#   This controller build the following patterns of URI:
 #      /captureargs/*/*
 #      /captureargs/*/*/edit
 #      /captureargs/*
 #      /captureargs/*/edit
+#      /captureargs/test/*
 #   It will output the arguments they got passed to @_ after the
 #   context object. 
-#   /captureargs/one/edit should not dispatch to
-#   /captureargs/*/*
+#   /captureargs/one/edit should not dispatch to /captureargs/*/*
+#   /captureargs/test/one should not dispatch to /captureargs/*/*
 
 sub base  :Chained('/') PathPart('captureargs') CaptureArgs(0) {
     my ( $self, $c, $arg ) = @_;
@@ -50,6 +51,11 @@
     push @{ $c->stash->{ passed_args } }, 'view_one_arg';
 }
 
+sub test_plus_arg :Chained('base') PathPart('test') Args(1) {
+    my ( $self, $c, $arg ) = @_;
+    push @{ $c->stash->{ passed_args } }, 'test_plus_arg', $arg;
+}
+
 
 sub end : Private {
     my ( $self, $c ) = @_;

Modified: branches/upstream/libcatalyst-perl/current/t/lib/TestAppEncoding/Controller/Root.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcatalyst-perl/current/t/lib/TestAppEncoding/Controller/Root.pm?rev=48858&op=diff
==============================================================================
--- branches/upstream/libcatalyst-perl/current/t/lib/TestAppEncoding/Controller/Root.pm (original)
+++ branches/upstream/libcatalyst-perl/current/t/lib/TestAppEncoding/Controller/Root.pm Wed Dec 16 04:45:54 2009
@@ -8,7 +8,7 @@
 
 sub binary : Local {
     my ($self, $c) = @_;
-    $c->res->body(do { open(my $fh, '<', $c->path_to('..', '..', 'catalyst_130pix.gif')) or die $!; local $/ = undef; <$fh>; });
+    $c->res->body(do { open(my $fh, '<', $c->path_to('..', '..', 'catalyst_130pix.gif')) or die $!; binmode($fh); local $/ = undef; <$fh>; });
 }
 
 sub binary_utf8 : Local {




More information about the Pkg-perl-cvs-commits mailing list