r60817 - in /branches/upstream/libcatalyst-perl/current: ./ inc/Module/ inc/Module/Install/ lib/ lib/Catalyst/ lib/Catalyst/Engine/ lib/Catalyst/Script/ t/ t/aggregate/ t/lib/ t/lib/TestApp/Controller/Moose/

ansgar-guest at users.alioth.debian.org ansgar-guest at users.alioth.debian.org
Thu Jul 29 06:17:54 UTC 2010


Author: ansgar-guest
Date: Thu Jul 29 06:17:17 2010
New Revision: 60817

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=60817
Log:
[svn-upgrade] new version libcatalyst-perl (5.80025)

Added:
    branches/upstream/libcatalyst-perl/current/t/aggregate/unit_core_ctx_attr.t
    branches/upstream/libcatalyst-perl/current/t/lib/TestApp/Controller/Moose/NoAttributes.pm
    branches/upstream/libcatalyst-perl/current/t/unit_core_methodattributes_method_metaclass_on_subclasses.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.pm
    branches/upstream/libcatalyst-perl/current/inc/Module/Install/AutoInstall.pm
    branches/upstream/libcatalyst-perl/current/inc/Module/Install/Base.pm
    branches/upstream/libcatalyst-perl/current/inc/Module/Install/Can.pm
    branches/upstream/libcatalyst-perl/current/inc/Module/Install/Fetch.pm
    branches/upstream/libcatalyst-perl/current/inc/Module/Install/Include.pm
    branches/upstream/libcatalyst-perl/current/inc/Module/Install/Makefile.pm
    branches/upstream/libcatalyst-perl/current/inc/Module/Install/Metadata.pm
    branches/upstream/libcatalyst-perl/current/inc/Module/Install/Scripts.pm
    branches/upstream/libcatalyst-perl/current/inc/Module/Install/Win32.pm
    branches/upstream/libcatalyst-perl/current/inc/Module/Install/WriteAll.pm
    branches/upstream/libcatalyst-perl/current/lib/Catalyst.pm
    branches/upstream/libcatalyst-perl/current/lib/Catalyst/Component.pm
    branches/upstream/libcatalyst-perl/current/lib/Catalyst/Controller.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/Runtime.pm
    branches/upstream/libcatalyst-perl/current/lib/Catalyst/Script/Create.pm
    branches/upstream/libcatalyst-perl/current/lib/Catalyst/Script/Server.pm
    branches/upstream/libcatalyst-perl/current/t/aggregate/unit_core_engine_cgi-prepare_path.t
    branches/upstream/libcatalyst-perl/current/t/lib/TestApp.pm

Modified: branches/upstream/libcatalyst-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcatalyst-perl/current/Changes?rev=60817&op=diff
==============================================================================
--- branches/upstream/libcatalyst-perl/current/Changes (original)
+++ branches/upstream/libcatalyst-perl/current/Changes Thu Jul 29 06:17:17 2010
@@ -1,4 +1,26 @@
 # This file documents the revision history for Perl extension Catalyst.
+
+5.80025 2010-07-29 01:50:00
+
+ New features:
+  - An 'action_class' method has been added to Catalyst::Controller to
+    allow controller base classes, roles or traits
+    (e.g. Catalyst::Controller::ActionRole) to more easily override
+    the default action creation.
+
+ Bug fixes:
+  - Fix the --mech and --mechanize options to the myapp_create.pl script
+    to operate correctly by fixing the options passed down into the script.
+  - Fix controllers with no method attributes (where the action definitions
+    are entirely contained in config). RT#58057
+  - Fix running as a CGI under IIS at non-root locations.
+
+ Documentation:
+  - Fix missing - in the docs when describing the --mechanize option at one
+    point.
+  - Explained the common practice how to access the component's config
+    values.
+  - Fixed typo in Catalyst/Script/Server.pm (RT #58474)
 
 5.80024 2010-05-15 11:55:44
 

Modified: branches/upstream/libcatalyst-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcatalyst-perl/current/MANIFEST?rev=60817&op=diff
==============================================================================
--- branches/upstream/libcatalyst-perl/current/MANIFEST (original)
+++ branches/upstream/libcatalyst-perl/current/MANIFEST Thu Jul 29 06:17:17 2010
@@ -137,6 +137,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_ctx_attr.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
@@ -268,6 +269,7 @@
 t/lib/TestApp/Controller/Keyword.pm
 t/lib/TestApp/Controller/Moose.pm
 t/lib/TestApp/Controller/Moose/MethodModifiers.pm
+t/lib/TestApp/Controller/Moose/NoAttributes.pm
 t/lib/TestApp/Controller/Priorities.pm
 t/lib/TestApp/Controller/Priorities/loc_vs_index.pm
 t/lib/TestApp/Controller/Priorities/locre_vs_index.pm
@@ -348,6 +350,7 @@
 t/plugin_new_method_backcompat.t
 t/something/Makefile.PL
 t/something/script/foo/bar/for_dist
+t/unit_core_methodattributes_method_metaclass_on_subclasses.t
 t/unit_stats.t
 t/unit_utils_load_class.t
 t/unit_utils_subdir.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=60817&op=diff
==============================================================================
--- branches/upstream/libcatalyst-perl/current/META.yml (original)
+++ branches/upstream/libcatalyst-perl/current/META.yml Thu Jul 29 06:17:17 2010
@@ -10,7 +10,7 @@
 configure_requires:
   ExtUtils::MakeMaker: 6.42
 distribution_type: module
-generated_by: 'Module::Install version 0.97'
+generated_by: 'Module::Install version 0.99'
 license: perl
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.4.html
@@ -68,4 +68,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.80024
+version: 5.80025

Modified: branches/upstream/libcatalyst-perl/current/inc/Module/Install.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcatalyst-perl/current/inc/Module/Install.pm?rev=60817&op=diff
==============================================================================
--- branches/upstream/libcatalyst-perl/current/inc/Module/Install.pm (original)
+++ branches/upstream/libcatalyst-perl/current/inc/Module/Install.pm Thu Jul 29 06:17:17 2010
@@ -22,7 +22,6 @@
 use Cwd        ();
 use File::Find ();
 use File::Path ();
-use FindBin;
 
 use vars qw{$VERSION $MAIN};
 BEGIN {
@@ -32,7 +31,7 @@
 	# This is not enforced yet, but will be some time in the next few
 	# releases once we can make sure it won't clash with custom
 	# Module::Install extensions.
-	$VERSION = '0.97';
+	$VERSION = '0.99';
 
 	# Storage for the pseudo-singleton
 	$MAIN    = undef;
@@ -231,7 +230,8 @@
 sub new {
 	my ($class, %args) = @_;
 
-	FindBin->again;
+    delete $INC{'FindBin.pm'};
+    require FindBin;
 
 	# ignore the prefix on extension modules built from top level.
 	my $base_path = Cwd::abs_path($FindBin::Bin);

Modified: branches/upstream/libcatalyst-perl/current/inc/Module/Install/AutoInstall.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcatalyst-perl/current/inc/Module/Install/AutoInstall.pm?rev=60817&op=diff
==============================================================================
--- branches/upstream/libcatalyst-perl/current/inc/Module/Install/AutoInstall.pm (original)
+++ branches/upstream/libcatalyst-perl/current/inc/Module/Install/AutoInstall.pm Thu Jul 29 06:17:17 2010
@@ -6,7 +6,7 @@
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.97';
+	$VERSION = '0.99';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }

Modified: branches/upstream/libcatalyst-perl/current/inc/Module/Install/Base.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcatalyst-perl/current/inc/Module/Install/Base.pm?rev=60817&op=diff
==============================================================================
--- branches/upstream/libcatalyst-perl/current/inc/Module/Install/Base.pm (original)
+++ branches/upstream/libcatalyst-perl/current/inc/Module/Install/Base.pm Thu Jul 29 06:17:17 2010
@@ -4,7 +4,7 @@
 use strict 'vars';
 use vars qw{$VERSION};
 BEGIN {
-	$VERSION = '0.97';
+	$VERSION = '0.99';
 }
 
 # Suspend handler for "redefined" warnings

Modified: branches/upstream/libcatalyst-perl/current/inc/Module/Install/Can.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcatalyst-perl/current/inc/Module/Install/Can.pm?rev=60817&op=diff
==============================================================================
--- branches/upstream/libcatalyst-perl/current/inc/Module/Install/Can.pm (original)
+++ branches/upstream/libcatalyst-perl/current/inc/Module/Install/Can.pm Thu Jul 29 06:17:17 2010
@@ -9,7 +9,7 @@
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.97';
+	$VERSION = '0.99';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }

Modified: branches/upstream/libcatalyst-perl/current/inc/Module/Install/Fetch.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcatalyst-perl/current/inc/Module/Install/Fetch.pm?rev=60817&op=diff
==============================================================================
--- branches/upstream/libcatalyst-perl/current/inc/Module/Install/Fetch.pm (original)
+++ branches/upstream/libcatalyst-perl/current/inc/Module/Install/Fetch.pm Thu Jul 29 06:17:17 2010
@@ -6,7 +6,7 @@
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.97';
+	$VERSION = '0.99';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }

Modified: branches/upstream/libcatalyst-perl/current/inc/Module/Install/Include.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcatalyst-perl/current/inc/Module/Install/Include.pm?rev=60817&op=diff
==============================================================================
--- branches/upstream/libcatalyst-perl/current/inc/Module/Install/Include.pm (original)
+++ branches/upstream/libcatalyst-perl/current/inc/Module/Install/Include.pm Thu Jul 29 06:17:17 2010
@@ -6,7 +6,7 @@
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.97';
+	$VERSION = '0.99';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }

Modified: branches/upstream/libcatalyst-perl/current/inc/Module/Install/Makefile.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcatalyst-perl/current/inc/Module/Install/Makefile.pm?rev=60817&op=diff
==============================================================================
--- branches/upstream/libcatalyst-perl/current/inc/Module/Install/Makefile.pm (original)
+++ branches/upstream/libcatalyst-perl/current/inc/Module/Install/Makefile.pm Thu Jul 29 06:17:17 2010
@@ -4,10 +4,11 @@
 use strict 'vars';
 use ExtUtils::MakeMaker   ();
 use Module::Install::Base ();
+use Fcntl qw/:flock :seek/;
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.97';
+	$VERSION = '0.99';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }
@@ -364,9 +365,9 @@
 		. ($self->postamble || '');
 
 	local *MAKEFILE;
-	open MAKEFILE, "< $makefile_name" or die "fix_up_makefile: Couldn't open $makefile_name: $!";
+	open MAKEFILE, "+< $makefile_name" or die "fix_up_makefile: Couldn't open $makefile_name: $!";
+	eval { flock MAKEFILE, LOCK_EX };
 	my $makefile = do { local $/; <MAKEFILE> };
-	close MAKEFILE or die $!;
 
 	$makefile =~ s/\b(test_harness\(\$\(TEST_VERBOSE\), )/$1'inc', /;
 	$makefile =~ s/( -I\$\(INST_ARCHLIB\))/ -Iinc$1/g;
@@ -386,7 +387,8 @@
 	# XXX - This is currently unused; not sure if it breaks other MM-users
 	# $makefile =~ s/^pm_to_blib\s+:\s+/pm_to_blib :: /mg;
 
-	open  MAKEFILE, "> $makefile_name" or die "fix_up_makefile: Couldn't open $makefile_name: $!";
+	seek MAKEFILE, 0, SEEK_SET;
+	truncate MAKEFILE, 0;
 	print MAKEFILE  "$preamble$makefile$postamble" or die $!;
 	close MAKEFILE  or die $!;
 
@@ -410,4 +412,4 @@
 
 __END__
 
-#line 539
+#line 541

Modified: branches/upstream/libcatalyst-perl/current/inc/Module/Install/Metadata.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcatalyst-perl/current/inc/Module/Install/Metadata.pm?rev=60817&op=diff
==============================================================================
--- branches/upstream/libcatalyst-perl/current/inc/Module/Install/Metadata.pm (original)
+++ branches/upstream/libcatalyst-perl/current/inc/Module/Install/Metadata.pm Thu Jul 29 06:17:17 2010
@@ -6,7 +6,7 @@
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.97';
+	$VERSION = '0.99';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }
@@ -616,8 +616,15 @@
 	return $v;
 }
 
-
-
+sub add_metadata {
+    my $self = shift;
+    my %hash = @_;
+    for my $key (keys %hash) {
+        warn "add_metadata: $key is not prefixed with 'x_'.\n" .
+             "Use appopriate function to add non-private metadata.\n" unless $key =~ /^x_/;
+        $self->{values}->{$key} = $hash{$key};
+    }
+}
 
 
 ######################################################################

Modified: branches/upstream/libcatalyst-perl/current/inc/Module/Install/Scripts.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcatalyst-perl/current/inc/Module/Install/Scripts.pm?rev=60817&op=diff
==============================================================================
--- branches/upstream/libcatalyst-perl/current/inc/Module/Install/Scripts.pm (original)
+++ branches/upstream/libcatalyst-perl/current/inc/Module/Install/Scripts.pm Thu Jul 29 06:17:17 2010
@@ -6,7 +6,7 @@
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.97';
+	$VERSION = '0.99';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }

Modified: branches/upstream/libcatalyst-perl/current/inc/Module/Install/Win32.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcatalyst-perl/current/inc/Module/Install/Win32.pm?rev=60817&op=diff
==============================================================================
--- branches/upstream/libcatalyst-perl/current/inc/Module/Install/Win32.pm (original)
+++ branches/upstream/libcatalyst-perl/current/inc/Module/Install/Win32.pm Thu Jul 29 06:17:17 2010
@@ -6,7 +6,7 @@
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.97';
+	$VERSION = '0.99';
 	@ISA     = 'Module::Install::Base';
 	$ISCORE  = 1;
 }

Modified: branches/upstream/libcatalyst-perl/current/inc/Module/Install/WriteAll.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcatalyst-perl/current/inc/Module/Install/WriteAll.pm?rev=60817&op=diff
==============================================================================
--- branches/upstream/libcatalyst-perl/current/inc/Module/Install/WriteAll.pm (original)
+++ branches/upstream/libcatalyst-perl/current/inc/Module/Install/WriteAll.pm Thu Jul 29 06:17:17 2010
@@ -6,7 +6,7 @@
 
 use vars qw{$VERSION @ISA $ISCORE};
 BEGIN {
-	$VERSION = '0.97';;
+	$VERSION = '0.99';
 	@ISA     = qw{Module::Install::Base};
 	$ISCORE  = 1;
 }

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=60817&op=diff
==============================================================================
--- branches/upstream/libcatalyst-perl/current/lib/Catalyst.pm (original)
+++ branches/upstream/libcatalyst-perl/current/lib/Catalyst.pm Thu Jul 29 06:17:17 2010
@@ -79,7 +79,7 @@
 
 # Remember to update this in Catalyst::Runtime as well!
 
-our $VERSION = '5.80024';
+our $VERSION = '5.80025';
 
 sub import {
     my ( $class, @arguments ) = @_;
@@ -892,7 +892,7 @@
 For example:
 
     MyApp->config({ 'Model::Foo' => { bar => 'baz', overrides => 'me' } });
-    MyApp::Model::Foo->config({ quux => 'frob', 'overrides => 'this' });
+    MyApp::Model::Foo->config({ quux => 'frob', overrides => 'this' });
 
 will mean that C<MyApp::Model::Foo> receives the following data when
 constructed:
@@ -902,6 +902,21 @@
         quux => 'frob',
         overrides => 'me',
     });
+
+It's common practice to use a Moose attribute
+on the receiving component to access the config value.
+
+    package MyApp::Model::Foo;
+
+    use Moose;
+
+    # this attr will receive 'baz' at construction time
+    has 'bar' => ( 
+        is  => 'rw',
+        isa => 'Str',
+    );
+
+You can then get the value 'baz' by calling $c->model('Foo')->bar
 
 =cut
 
@@ -2406,10 +2421,6 @@
         # we know M::P::O found a file on disk so this is safe
 
         Catalyst::Utils::ensure_class_loaded( $component, { ignore_loaded => 1 } );
-
-        # Needs to be done as soon as the component is loaded, as loading a sub-component
-        # (next time round the loop) can cause us to get the wrong metaclass..
-        $class->_controller_init_base_classes($component);
     }
 
     for my $component (@comps) {
@@ -2419,7 +2430,6 @@
             : $class->expand_component_module( $component, $config );
         for my $component (@expanded_components) {
             next if $comps{$component};
-            $class->_controller_init_base_classes($component); # Also cover inner packages
             $class->components->{ $component } = $class->setup_component($component);
         }
     }
@@ -2471,19 +2481,6 @@
 =head2 $c->setup_component
 
 =cut
-
-# FIXME - Ugly, ugly hack to ensure the we force initialize non-moose base classes
-#         nearest to Catalyst::Controller first, no matter what order stuff happens
-#         to be loaded. There are TODO tests in Moose for this, see
-#         f2391d17574eff81d911b97be15ea51080500003
-sub _controller_init_base_classes {
-    my ($app_class, $component) = @_;
-    return unless $component->isa('Catalyst::Controller');
-    foreach my $class ( reverse @{ mro::get_linear_isa($component) } ) {
-        Moose::Meta::Class->initialize( $class )
-            unless find_meta($class);
-    }
-}
 
 sub setup_component {
     my( $class, $component ) = @_;
@@ -3201,6 +3198,8 @@
 
 Yuval Kogman, C<nothingmuch at woobling.org>
 
+rainboxx: Matthias Dietrich, C<perl at rainboxx.de>
+
 =head1 LICENSE
 
 This library is free software. You can redistribute it and/or modify it under

Modified: branches/upstream/libcatalyst-perl/current/lib/Catalyst/Component.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcatalyst-perl/current/lib/Catalyst/Component.pm?rev=60817&op=diff
==============================================================================
--- branches/upstream/libcatalyst-perl/current/lib/Catalyst/Component.pm (original)
+++ branches/upstream/libcatalyst-perl/current/lib/Catalyst/Component.pm Thu Jul 29 06:17:17 2010
@@ -170,7 +170,7 @@
 
 C<< my $component_instance = $component->COMPONENT($app, $arguments); >>
 
-If this method is present (as it is on all Catalyst::Component subclasses,
+If this method is present (as it is on all Catalyst::Component subclasses),
 it is called by Catalyst during setup_components with the application class
 as $app and any config entry on the application for this component (for example,
 in the case of MyApp::Controller::Foo this would be
@@ -185,7 +185,7 @@
 
   sub COMPONENT {
       my ($class, $app, $args) = @_;
-      $args = $self->merge_config_hashes($self->config, $args);
+      $args = $class->merge_config_hashes($class->config, $args);
       return $class->new($app, $args);
   }
 
@@ -199,6 +199,12 @@
 key value pair, or you can specify a hashref. In either case the keys
 will be merged with any existing config settings. Each component in
 a Catalyst application has its own config hash.
+
+The component's config hash is merged with any config entry on the
+application for this component and passed to C<new()> (as mentioned
+above at L</COMPONENT>). The common practice to access the merged
+config is to use a Moose attribute for each config entry on the
+receiving component.
 
 =head2 $c->process()
 

Modified: branches/upstream/libcatalyst-perl/current/lib/Catalyst/Controller.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcatalyst-perl/current/lib/Catalyst/Controller.pm?rev=60817&op=diff
==============================================================================
--- branches/upstream/libcatalyst-perl/current/lib/Catalyst/Controller.pm (original)
+++ branches/upstream/libcatalyst-perl/current/lib/Catalyst/Controller.pm Thu Jul 29 06:17:17 2010
@@ -225,7 +225,9 @@
 
     foreach my $method (@methods) {
         my $name = $method->name;
-        my $attributes = $method->attributes;
+        # Horrible hack! All method metaclasses should have an attributes
+        # method, core Moose bug - see r13354.
+        my $attributes = $method->can('attributes') ? $method->attributes : [];
         my $attrs = $self->_parse_attrs( $c, $name, @{ $attributes } );
         if ( $attrs->{Private} && ( keys %$attrs > 1 ) ) {
             $c->log->debug( 'Bad action definition "'
@@ -248,16 +250,25 @@
     }
 }
 
+sub action_class {
+    my $self = shift;
+    my %args = @_;
+
+    my $class = (exists $args{attributes}{ActionClass}
+        ? $args{attributes}{ActionClass}[0]
+        : $self->_action_class);
+
+    Class::MOP::load_class($class);
+    return $class;
+}
+
 sub create_action {
     my $self = shift;
     my %args = @_;
 
-    my $class = (exists $args{attributes}{ActionClass}
-                    ? $args{attributes}{ActionClass}[0]
-                    : $self->_action_class);
-    Class::MOP::load_class($class);
-
+    my $class = $self->action_class(%args);
     my $action_args = $self->config->{action_args};
+
     my %extra_args = (
         %{ $action_args->{'*'}           || {} },
         %{ $action_args->{ $args{name} } || {} },
@@ -529,6 +540,11 @@
 Creates action objects for a set of action methods using C< create_action >,
 and registers them with the dispatcher.
 
+=head2 $self->action_class(%args)
+
+Used when a controller is creating an action to determine the correct base
+action class to use.
+
 =head2 $self->create_action(%args)
 
 Called with a hash of data to be use for construction of a new

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=60817&op=diff
==============================================================================
--- branches/upstream/libcatalyst-perl/current/lib/Catalyst/Engine.pm (original)
+++ branches/upstream/libcatalyst-perl/current/lib/Catalyst/Engine.pm Thu Jul 29 06:17:17 2010
@@ -10,6 +10,8 @@
 use HTTP::Body;
 use HTTP::Headers;
 use URI::QueryParam;
+use Encode ();
+use utf8;
 
 use namespace::clean -except => 'meta';
 
@@ -131,6 +133,14 @@
 
     $c->res->content_type('text/html; charset=utf-8');
     my $name = ref($c)->config->{name} || join(' ', split('::', ref $c));
+    
+    # Prevent Catalyst::Plugin::Unicode::Encoding from running.
+    # This is a little nasty, but it's the best way to be clean whether or
+    # not the user has an encoding plugin.
+
+    if ($c->can('encoding')) {
+      $c->{encoding} = '';
+    }
 
     my ( $title, $error, $infos );
     if ( $c->debug ) {
@@ -279,10 +289,11 @@
 </body>
 </html>
 
-
     # 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 );
+
+    $c->res->{body} = Encode::encode("UTF-8", $c->res->{body});
 
     # Return 500
     $c->res->status(500);

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=60817&op=diff
==============================================================================
--- branches/upstream/libcatalyst-perl/current/lib/Catalyst/Engine/CGI.pm (original)
+++ branches/upstream/libcatalyst-perl/current/lib/Catalyst/Engine/CGI.pm Thu Jul 29 06:17:17 2010
@@ -154,6 +154,12 @@
     my $scheme = $c->request->secure ? 'https' : 'http';
     my $host      = $ENV{HTTP_HOST}   || $ENV{SERVER_NAME};
     my $port      = $ENV{SERVER_PORT} || 80;
+
+    # fix up for IIS
+    if ($ENV{SERVER_SOFTWARE} && $ENV{SERVER_SOFTWARE} =~ m{IIS/[6-9]\.\d}) {
+        $ENV{PATH_INFO} =~ s/^\Q$ENV{SCRIPT_NAME}\E//;
+    }
+
     my $script_name = $ENV{SCRIPT_NAME};
     $script_name =~ s/([^$URI::uric])/$URI::Escape::escapes{$1}/go if $script_name;
 

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=60817&op=diff
==============================================================================
--- branches/upstream/libcatalyst-perl/current/lib/Catalyst/Runtime.pm (original)
+++ branches/upstream/libcatalyst-perl/current/lib/Catalyst/Runtime.pm Thu Jul 29 06:17:17 2010
@@ -7,7 +7,7 @@
 
 # Remember to update this in Catalyst as well!
 
-our $VERSION = '5.80024';
+our $VERSION = '5.80025';
 
 =head1 NAME
 

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=60817&op=diff
==============================================================================
--- branches/upstream/libcatalyst-perl/current/lib/Catalyst/Script/Create.pm (original)
+++ branches/upstream/libcatalyst-perl/current/lib/Catalyst/Script/Create.pm Thu Jul 29 06:17:17 2010
@@ -46,7 +46,7 @@
     Class::MOP::load_class($helper_class);
     my $helper = $helper_class->new( { '.newfiles' => !$self->force, mech => $self->mechanize } );
 
-    $self->_getopt_full_usage unless $helper->mk_component( $self->application_name, @ARGV );
+    $self->_getopt_full_usage unless $helper->mk_component( $self->application_name, @{$self->extra_argv} );
 
 }
 
@@ -68,7 +68,7 @@
  Examples:
    myapp_create.pl controller My::Controller
    myapp_create.pl controller My::Controller BindLex
-   myapp_create.pl -mechanize controller My::Controller
+   myapp_create.pl --mechanize controller My::Controller
    myapp_create.pl view My::View
    myapp_create.pl view MyView TT
    myapp_create.pl view TT TT

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=60817&op=diff
==============================================================================
--- branches/upstream/libcatalyst-perl/current/lib/Catalyst/Script/Server.pm (original)
+++ branches/upstream/libcatalyst-perl/current/lib/Catalyst/Script/Server.pm Thu Jul 29 06:17:17 2010
@@ -231,7 +231,7 @@
                       a restart when modified
                       (defaults to '\.yml$|\.yaml$|\.conf|\.pm$')
    --rdir --restart_directory  the directory to search for
-                      modified files, can be set mulitple times
+                      modified files, can be set multiple times
                       (defaults to '[SCRIPT_DIR]/..')
    --sym  --follow_symlinks   follow symlinks in search directories
                       (defaults to false. this is a no-op on Win32)

Added: branches/upstream/libcatalyst-perl/current/t/aggregate/unit_core_ctx_attr.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcatalyst-perl/current/t/aggregate/unit_core_ctx_attr.t?rev=60817&op=file
==============================================================================
--- branches/upstream/libcatalyst-perl/current/t/aggregate/unit_core_ctx_attr.t (added)
+++ branches/upstream/libcatalyst-perl/current/t/aggregate/unit_core_ctx_attr.t Thu Jul 29 06:17:17 2010
@@ -1,0 +1,30 @@
+use strict;
+use warnings;
+use FindBin qw/$Bin/;
+use lib "$FindBin::Bin/../lib";
+use Test::More;
+use URI;
+
+use_ok('TestApp');
+
+my $request = Catalyst::Request->new( {
+                base => URI->new('http://127.0.0.1/foo')
+              } );
+my $dispatcher = TestApp->dispatcher;
+my $context = TestApp->new( {
+                request => $request,
+                namespace => 'yada',
+              } );
+
+is(        $context->hello_lazy,    'hello there', '$context->hello_lazy');
+eval { is( $context->hello_notlazy, 'hello there', '$context->hello_notlazy') };
+TODO: {
+   local $TODO = 'we appear to have a lazy bug';
+   if ($@) {
+      fail('$context->hello_notlazy');
+      warn $@;
+   }
+}
+
+done_testing;
+

Modified: 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=60817&op=diff
==============================================================================
--- branches/upstream/libcatalyst-perl/current/t/aggregate/unit_core_engine_cgi-prepare_path.t (original)
+++ branches/upstream/libcatalyst-perl/current/t/aggregate/unit_core_engine_cgi-prepare_path.t Thu Jul 29 06:17:17 2010
@@ -86,8 +86,20 @@
     is ''.$r->base, 'http://www.foo.com/oslobilder/', 'base correct';
 }
 
+# CGI hit on IIS for non / based app
 {
-    local $TODO = 'Another mod_rewrite case';
+    my $r = get_req(0,
+        SERVER_SOFTWARE => 'Microsoft-IIS/6.0',
+        PATH_INFO => '/bobtfish/Gitalist/script/gitalist.cgi/static/css/blueprint/screen.css',
+        SCRIPT_NAME => '/bobtfish/Gitalist/script/gitalist.cgi',
+        PATH_TRANSLATED =>
+'C:\\Inetpub\\vhosts\\foo.com\\httpdocs\\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/';
+}
+
+{
     my $r = get_req (0,
         PATH_INFO => '/auth/login',
         SCRIPT_NAME => '/tx',
@@ -112,7 +124,6 @@
     is $r->path, 'engine/request/uri/Rx(here)', 'URI contains correct path';
     is $r->base, 'http://www.foo.com/', 'Base is correct';
 }
-
 
 # FIXME - Test proxy logic
 #       - Test query string

Modified: branches/upstream/libcatalyst-perl/current/t/lib/TestApp.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcatalyst-perl/current/t/lib/TestApp.pm?rev=60817&op=diff
==============================================================================
--- branches/upstream/libcatalyst-perl/current/t/lib/TestApp.pm (original)
+++ branches/upstream/libcatalyst-perl/current/t/lib/TestApp.pm Thu Jul 29 06:17:17 2010
@@ -16,9 +16,38 @@
 use Moose;
 use namespace::autoclean;
 
+# -----------
+# t/aggregate/unit_core_ctx_attr.t pukes until lazy is true
+package Greeting;
+use Moose;
+sub hello_notlazy { 'hello there' }
+sub hello_lazy    { 'hello there' }
+
+package TestApp;
+has 'my_greeting_obj_notlazy' => (
+   is      => 'ro',
+   isa     => 'Greeting',
+   default => sub { Greeting->new() },
+   handles => [ qw( hello_notlazy ) ],
+   lazy    => 0,
+);
+has 'my_greeting_obj_lazy' => (
+   is      => 'ro',
+   isa     => 'Greeting',
+   default => sub { Greeting->new() },
+   handles => [ qw( hello_lazy ) ],
+   lazy    => 1,
+);
+# -----------
+
 our $VERSION = '0.01';
 
 TestApp->config( name => 'TestApp', root => '/some/dir', use_request_uri_for_path => 1 );
+
+# Test bug found when re-adjusting the metaclass compat code in Moose
+# in 292360. Test added to Moose in 4b760d6, but leave this attribute
+# above ->setup so we have some generated methods to be double sure.
+has an_attribute_before_we_change_base_classes => ( is => 'ro');
 
 if ($::setup_leakchecker && eval { Class::MOP::load_class('CatalystX::LeakChecker'); 1 }) {
     with 'CatalystX::LeakChecker';

Added: branches/upstream/libcatalyst-perl/current/t/lib/TestApp/Controller/Moose/NoAttributes.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcatalyst-perl/current/t/lib/TestApp/Controller/Moose/NoAttributes.pm?rev=60817&op=file
==============================================================================
--- branches/upstream/libcatalyst-perl/current/t/lib/TestApp/Controller/Moose/NoAttributes.pm (added)
+++ branches/upstream/libcatalyst-perl/current/t/lib/TestApp/Controller/Moose/NoAttributes.pm Thu Jul 29 06:17:17 2010
@@ -1,0 +1,16 @@
+package TestApp::Controller::Moose::NoAttributes;
+use Moose;
+extends qw/Catalyst::Controller/;
+
+__PACKAGE__->config(
+   actions => {
+       test => { Local => undef }
+   }
+);
+
+sub test {
+}
+
+no Moose;
+1;
+

Added: branches/upstream/libcatalyst-perl/current/t/unit_core_methodattributes_method_metaclass_on_subclasses.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcatalyst-perl/current/t/unit_core_methodattributes_method_metaclass_on_subclasses.t?rev=60817&op=file
==============================================================================
--- branches/upstream/libcatalyst-perl/current/t/unit_core_methodattributes_method_metaclass_on_subclasses.t (added)
+++ branches/upstream/libcatalyst-perl/current/t/unit_core_methodattributes_method_metaclass_on_subclasses.t Thu Jul 29 06:17:17 2010
@@ -1,0 +1,30 @@
+use strict;
+use Test::More;
+
+{
+    package NoAttributes::CT;
+    use Moose;
+    BEGIN { extends qw/Catalyst::Controller/; };
+
+    sub test {}
+}
+{
+    package NoAttributes::RT;
+    use Moose;
+    extends qw/Catalyst::Controller/;
+
+    sub test {}
+}
+
+foreach my $class (qw/ CT RT /) {
+    my $class_name = 'NoAttributes::' . $class;
+    my $meta = $class_name->meta;
+    my $meth = $meta->find_method_by_name('test');
+    {
+        local $TODO = "Known MX::MethodAttributes issue";
+        ok $meth->can('attributes'), 'method metaclass has ->attributes method for ' . $class;;
+    }
+}
+
+done_testing;
+




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