[Catalyst-commits] r13443 - in
Catalyst-Runtime/5.80/branches/rt58057: . lib lib/Catalyst
lib/Catalyst/Script
t0m at dev.catalyst.perl.org
t0m at dev.catalyst.perl.org
Wed Jul 28 21:54:07 GMT 2010
Author: t0m
Date: 2010-07-28 22:54:07 +0100 (Wed, 28 Jul 2010)
New Revision: 13443
Modified:
Catalyst-Runtime/5.80/branches/rt58057/
Catalyst-Runtime/5.80/branches/rt58057/Changes
Catalyst-Runtime/5.80/branches/rt58057/lib/Catalyst.pm
Catalyst-Runtime/5.80/branches/rt58057/lib/Catalyst/Controller.pm
Catalyst-Runtime/5.80/branches/rt58057/lib/Catalyst/Engine.pm
Catalyst-Runtime/5.80/branches/rt58057/lib/Catalyst/Script/Server.pm
Log:
r15672 at spaceinvaders (orig r13363): jester | 2010-06-22 21:47:45 +0100
Fixed typo
r15674 at spaceinvaders (orig r13365): bricas | 2010-06-24 13:52:20 +0100
add typo fix to Changes
r15689 at spaceinvaders (orig r13380): arcanez | 2010-07-03 01:04:07 +0100
remove extra '
r15716 at spaceinvaders (orig r13407): hobbs | 2010-07-09 10:40:44 +0100
Try harder to make finalize_error encoding-safe.
r15750 at spaceinvaders (orig r13441): t0m | 2010-07-28 22:39:41 +0100
r15666 at spaceinvaders (orig r13357): jnapiorkowski | 2010-06-16 20:12:46 +0100
new branch
r15667 at spaceinvaders (orig r13358): jnapiorkowski | 2010-06-16 20:55:08 +0100
broke out and documented action_class method
r15749 at spaceinvaders (orig r13440): t0m | 2010-07-28 22:39:32 +0100
Changelog
Property changes on: Catalyst-Runtime/5.80/branches/rt58057
___________________________________________________________________
Modified: svk:merge
- 1c72fc7c-9ce4-42af-bf25-3bfe470ff1e8:/local/Catalyst/trunk/Catalyst-Runtime:9763
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.70/branches/compres:7999
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.70/branches/context_go:8001
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.70/trunk:8533
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/Catalyst-Test-Updates:8363
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/add_captures_to_visit:9546
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/aggregate_more:11803
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/better_scripts:12074
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/disable_regex_fallback:11456
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/fix_path_info_decoding:12089
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/fix_request_uri:13262
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/index_default_fuckage:10646
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/moose:7911
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/more_metaclass_compat:13280
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/namespace_handling_refactor:10655
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/param_filtering:13012
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/uri_encode_captures_andor_args_take2:11811
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/uri_for_utf8:12834
4ad37cd2-5fec-0310-835f-b3785c72a374:/branches/Catalyst-ChildOf:4443
4ad37cd2-5fec-0310-835f-b3785c72a374:/branches/Catalyst-Runtime-jrockway:5857
4ad37cd2-5fec-0310-835f-b3785c72a374:/branches/Catalyst-component-setup:4320
4ad37cd2-5fec-0310-835f-b3785c72a374:/branches/Catalyst-docs:4325
4ad37cd2-5fec-0310-835f-b3785c72a374:/branches/current/Catalyst-Runtime:5142
4ad37cd2-5fec-0310-835f-b3785c72a374:/trunk/Catalyst:4483
4ad37cd2-5fec-0310-835f-b3785c72a374:/trunk/Catalyst-Runtime:6165
6d45476b-5895-46b8-b13a-8b969fa34c98:/local/Catalyst-Runtime-better_scripts:11331
6d45476b-5895-46b8-b13a-8b969fa34c98:/local/Catalyst-Runtime-mech_tests:15583
8a9521aa-ff93-41d6-9f87-b05cafcdab40:/local/cat/Catalyst-Runtime/5.80/trunk:8157
d7608cd0-831c-0410-93c0-e5b306c3c028:/local/Catalyst/Catalyst-Runtime:8339
d7608cd0-831c-0410-93c0-e5b306c3c028:/local/Catalyst/Catalyst-Runtime-jrockway:8342
e56d974f-7718-0410-8b1c-b347a71765b2:/local/Catalyst-Runtime:6511
e56d974f-7718-0410-8b1c-b347a71765b2:/local/Catalyst-Runtime-current:10442
+ 1c72fc7c-9ce4-42af-bf25-3bfe470ff1e8:/local/Catalyst/trunk/Catalyst-Runtime:9763
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.70/branches/compres:7999
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.70/branches/context_go:8001
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.70/trunk:8533
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/Catalyst-Test-Updates:8363
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/add_captures_to_visit:9546
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/aggregate_more:11803
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/better_scripts:12074
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/disable_regex_fallback:11456
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/fix_path_info_decoding:12089
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/fix_request_uri:13262
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/index_default_fuckage:10646
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/moose:7911
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/more_metaclass_compat:13280
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/namespace_handling_refactor:10655
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/param_filtering:13012
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/tweak_controller_action_creation:13440
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/uri_encode_captures_andor_args_take2:11811
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/branches/uri_for_utf8:12834
4ad37cd2-5fec-0310-835f-b3785c72a374:/Catalyst-Runtime/5.80/trunk:13441
4ad37cd2-5fec-0310-835f-b3785c72a374:/branches/Catalyst-ChildOf:4443
4ad37cd2-5fec-0310-835f-b3785c72a374:/branches/Catalyst-Runtime-jrockway:5857
4ad37cd2-5fec-0310-835f-b3785c72a374:/branches/Catalyst-component-setup:4320
4ad37cd2-5fec-0310-835f-b3785c72a374:/branches/Catalyst-docs:4325
4ad37cd2-5fec-0310-835f-b3785c72a374:/branches/current/Catalyst-Runtime:5142
4ad37cd2-5fec-0310-835f-b3785c72a374:/trunk/Catalyst:4483
4ad37cd2-5fec-0310-835f-b3785c72a374:/trunk/Catalyst-Runtime:6165
6d45476b-5895-46b8-b13a-8b969fa34c98:/local/Catalyst-Runtime-better_scripts:11331
6d45476b-5895-46b8-b13a-8b969fa34c98:/local/Catalyst-Runtime-mech_tests:15583
8a9521aa-ff93-41d6-9f87-b05cafcdab40:/local/cat/Catalyst-Runtime/5.80/trunk:8157
d7608cd0-831c-0410-93c0-e5b306c3c028:/local/Catalyst/Catalyst-Runtime:8339
d7608cd0-831c-0410-93c0-e5b306c3c028:/local/Catalyst/Catalyst-Runtime-jrockway:8342
e56d974f-7718-0410-8b1c-b347a71765b2:/local/Catalyst-Runtime:6511
e56d974f-7718-0410-8b1c-b347a71765b2:/local/Catalyst-Runtime-current:10442
Modified: Catalyst-Runtime/5.80/branches/rt58057/Changes
===================================================================
--- Catalyst-Runtime/5.80/branches/rt58057/Changes 2010-07-28 21:40:04 UTC (rev 13442)
+++ Catalyst-Runtime/5.80/branches/rt58057/Changes 2010-07-28 21:54:07 UTC (rev 13443)
@@ -1,5 +1,11 @@
# This file documents the revision history for Perl extension Catalyst.
+ 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.
@@ -9,6 +15,7 @@
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: Catalyst-Runtime/5.80/branches/rt58057/lib/Catalyst/Controller.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/rt58057/lib/Catalyst/Controller.pm 2010-07-28 21:40:04 UTC (rev 13442)
+++ Catalyst-Runtime/5.80/branches/rt58057/lib/Catalyst/Controller.pm 2010-07-28 21:54:07 UTC (rev 13443)
@@ -248,16 +248,25 @@
}
}
-sub create_action {
+sub action_class {
my $self = shift;
my %args = @_;
my $class = (exists $args{attributes}{ActionClass}
- ? $args{attributes}{ActionClass}[0]
- : $self->_action_class);
+ ? $args{attributes}{ActionClass}[0]
+ : $self->_action_class);
+
Class::MOP::load_class($class);
+ return $class;
+}
+sub create_action {
+ my $self = shift;
+ my %args = @_;
+
+ my $class = $self->action_class(%args);
my $action_args = $self->config->{action_args};
+
my %extra_args = (
%{ $action_args->{'*'} || {} },
%{ $action_args->{ $args{name} } || {} },
@@ -529,6 +538,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: Catalyst-Runtime/5.80/branches/rt58057/lib/Catalyst/Engine.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/rt58057/lib/Catalyst/Engine.pm 2010-07-28 21:40:04 UTC (rev 13442)
+++ Catalyst-Runtime/5.80/branches/rt58057/lib/Catalyst/Engine.pm 2010-07-28 21:54:07 UTC (rev 13443)
@@ -10,6 +10,8 @@
use HTTP::Body;
use HTTP::Headers;
use URI::QueryParam;
+use Encode ();
+use utf8;
use namespace::clean -except => 'meta';
@@ -131,7 +133,15 @@
$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 ) {
@@ -280,11 +290,12 @@
</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: Catalyst-Runtime/5.80/branches/rt58057/lib/Catalyst/Script/Server.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/rt58057/lib/Catalyst/Script/Server.pm 2010-07-28 21:40:04 UTC (rev 13442)
+++ Catalyst-Runtime/5.80/branches/rt58057/lib/Catalyst/Script/Server.pm 2010-07-28 21:54:07 UTC (rev 13443)
@@ -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)
Modified: Catalyst-Runtime/5.80/branches/rt58057/lib/Catalyst.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/rt58057/lib/Catalyst.pm 2010-07-28 21:40:04 UTC (rev 13442)
+++ Catalyst-Runtime/5.80/branches/rt58057/lib/Catalyst.pm 2010-07-28 21:54:07 UTC (rev 13443)
@@ -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:
More information about the Catalyst-commits
mailing list