Merge branch 'master' into gsoc_breadboard gsoc_breadboard
André Walker [Sat, 20 Oct 2012 05:25:28 +0000 (02:25 -0300)]
Changes
lib/Catalyst.pm
lib/Catalyst/Controller.pm
lib/Catalyst/Runtime.pm

diff --git a/Changes b/Changes
index 9f23ad3..ad6d304 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,5 +1,22 @@
 # This file documents the revision history for Perl extension Catalyst.
 
+5.90017 - 2012-10-19 22:33:00
+  - Change Catalsyt _parse_attrs so that when sub attr handlers:
+
+    1) Can return multiple pairs of new attributes.
+    2) Get their returned attributes passed through the correct attribute handler.
+
+    e.g sub _parse_Whatever_attr { return Chained => 'foo', PathPart => 'bar' }
+
+    Will now work because both new attributes are respected, and the Chained
+    attribute is passed to _parse_Chained_attr and fixed up correctly by that.
+
+  - In Catalyst::Test, don't mangle headers of non-HTML responses. RT#79043
+
+  - Refactor request and response class construction to add methods
+    that roles can hook to feed extra parameters into the constructor
+    of request or response classes.
+
 5.90016 - 2012-08-16 15:35:00
   - prepare_parameters is no longer an attribute builder.  It is now a method
     that calls the correct underlying functionality (Bill Moseley++)
index 6dbd0a1..9c7dec2 100644 (file)
@@ -51,20 +51,30 @@ has request => (
     is => 'rw',
     default => sub {
         my $self = shift;
-        my %p = ( _log => $self->log );
-        $p{_uploadtmp} = $self->_uploadtmp if $self->_has_uploadtmp;
-        $self->request_class->new(\%p);
+        $self->request_class->new($self->_build_request_constructor_args);
     },
     lazy => 1,
 );
+sub _build_request_constructor_args {
+    my $self = shift;
+    my %p = ( _log => $self->log );
+    $p{_uploadtmp} = $self->_uploadtmp if $self->_has_uploadtmp;
+    \%p;
+}
+
 has response => (
     is => 'rw',
     default => sub {
         my $self = shift;
-        $self->response_class->new({ _log => $self->log });
+        $self->response_class->new($self->_build_response_constructor_args);
     },
     lazy => 1,
 );
+sub _build_response_constructor_args {
+    my $self = shift;
+    { _log => $self->log };
+}
+
 has namespace => (is => 'rw');
 
 sub depth { scalar @{ shift->stack || [] }; }
@@ -101,7 +111,7 @@ __PACKAGE__->stats_class('Catalyst::Stats');
 
 # Remember to update this in Catalyst::Runtime as well!
 
-our $VERSION = '5.90016';
+our $VERSION = '5.90017';
 
 sub import {
     my ( $class, @arguments ) = @_;
index 44ce7db..1bc8e2a 100644 (file)
@@ -281,7 +281,7 @@ sub register_action_methods {
         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 "'
+            $c->log->warn( 'Bad action definition "'
                   . join( ' ', @{ $attributes } )
                   . qq/" for "$class->$name"/ )
               if $c->debug;
index 03680b1..291dcc4 100644 (file)
@@ -7,7 +7,7 @@ BEGIN { require 5.008003; }
 
 # Remember to update this in Catalyst as well!
 
-our $VERSION = '5.90016';
+our $VERSION = '5.90017';
 
 =head1 NAME