[Catalyst-commits] r8952 - in Catalyst-Runtime/5.80/trunk: .
lib/Catalyst t/aggregate t/lib t/lib/TestApp
t/lib/TestApp/DispatchType t/lib/TestApp/Plugin
t0m at dev.catalyst.perl.org
t0m at dev.catalyst.perl.org
Sat Dec 27 15:31:25 GMT 2008
Author: t0m
Date: 2008-12-27 15:31:25 +0000 (Sat, 27 Dec 2008)
New Revision: 8952
Added:
Catalyst-Runtime/5.80/trunk/t/lib/TestApp/DispatchType/
Catalyst-Runtime/5.80/trunk/t/lib/TestApp/DispatchType/CustomPostLoad.pm
Catalyst-Runtime/5.80/trunk/t/lib/TestApp/DispatchType/CustomPreLoad.pm
Catalyst-Runtime/5.80/trunk/t/lib/TestApp/Plugin/AddDispatchTypes.pm
Modified:
Catalyst-Runtime/5.80/trunk/Changes
Catalyst-Runtime/5.80/trunk/TODO
Catalyst-Runtime/5.80/trunk/lib/Catalyst/Dispatcher.pm
Catalyst-Runtime/5.80/trunk/t/aggregate/live_plugin_loaded.t
Catalyst-Runtime/5.80/trunk/t/lib/TestApp.pm
Log:
Fix the way Catalyst::Plugin::Server adds custom dispatch types
Modified: Catalyst-Runtime/5.80/trunk/Changes
===================================================================
--- Catalyst-Runtime/5.80/trunk/Changes 2008-12-27 11:16:35 UTC (rev 8951)
+++ Catalyst-Runtime/5.80/trunk/Changes 2008-12-27 15:31:25 UTC (rev 8952)
@@ -1,5 +1,9 @@
# This file documents the revision history for Perl extension Catalyst.
+ - Fix assignment to Catalyst::Dispatcher's preload_dispatch_types and
+ postload_dispatch_types attributes - assigning a list should later
+ return a listref. Fixes Catalyst::Plugin::Server. (t0m)
+ - Tests for this (t0m)
- Change streaming test to serve itself rather than 01use.t, making test
sync for engines easier (t0m)
- Refactor capturing of $app from Catalyst::Controller into
Modified: Catalyst-Runtime/5.80/trunk/TODO
===================================================================
--- Catalyst-Runtime/5.80/trunk/TODO 2008-12-27 11:16:35 UTC (rev 8951)
+++ Catalyst-Runtime/5.80/trunk/TODO 2008-12-27 15:31:25 UTC (rev 8952)
@@ -1,6 +1,12 @@
Pending patches:
- meta test for MX::Emulate::CAF needed by Catalyst::Plugin::Cache::Curried
-
+
+ - Class::Accessor::Chained::Fast test for MX::Emulate::CAF, to fix
+ HTML::Widget
+
+ - Re-opening packages with MX::Emulate::CAF (for
+ Catalyst::Plugin::HashedCookies)
+
Back-compat investigation / known issues:
- Common engine test failures, look into and get tests into core.
@@ -12,9 +18,6 @@
- Run another round of repository smokes against latest 5.80 trunk, manually
go through all the things which are broken (t0m).
- - Catalyst-Plugin-Server dies due to "package is not defined" error
- which was reduced to a warning, retest.
-
- Catalyst-Plugin-Cache dies due to mk_accessors('meta')
- Catalyst-Action-REST appears to have real issues, investigate
@@ -33,10 +36,6 @@
- Catalyst-Plugin-Setenv
- Catalyst-Plugin-RequireSSL - Bullshit 'cannot locate' errors
Bug in smoke test rig.
-
- - Catalyst::Plugin::HTML::Widget - Undefined subroutine
- &HTML::Widget::Result::attributes called at
- lib/perl5/HTML/Widget/Result.pm line 68.
- Issues with TWMC not being loaded when it used to be in 5.70
(Bill Moseley)
Modified: Catalyst-Runtime/5.80/trunk/lib/Catalyst/Dispatcher.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/lib/Catalyst/Dispatcher.pm 2008-12-27 11:16:35 UTC (rev 8951)
+++ Catalyst-Runtime/5.80/trunk/lib/Catalyst/Dispatcher.pm 2008-12-27 15:31:25 UTC (rev 8952)
@@ -33,6 +33,14 @@
has _action_hash => (is => 'rw', required => 1, lazy => 1, default => sub { {} });
has _container_hash => (is => 'rw', required => 1, lazy => 1, default => sub { {} });
+# Wrap accessors so you can assign a list and it will capture a list ref.
+around qw/preload_dispatch_types postload_dispatch_types/ => sub {
+ my $orig = shift;
+ my $self = shift;
+ return $self->$orig([@_]) if (scalar @_ && ref $_[0] ne 'ARRAY');
+ return $self->$orig(@_);
+};
+
no Moose;
=head1 NAME
Modified: Catalyst-Runtime/5.80/trunk/t/aggregate/live_plugin_loaded.t
===================================================================
--- Catalyst-Runtime/5.80/trunk/t/aggregate/live_plugin_loaded.t 2008-12-27 11:16:35 UTC (rev 8951)
+++ Catalyst-Runtime/5.80/trunk/t/aggregate/live_plugin_loaded.t 2008-12-27 15:31:25 UTC (rev 8952)
@@ -14,6 +14,7 @@
Catalyst::Plugin::Test::Headers
Catalyst::Plugin::Test::Inline
Catalyst::Plugin::Test::Plugin
+ TestApp::Plugin::AddDispatchTypes
TestApp::Plugin::FullyQualified
];
Added: Catalyst-Runtime/5.80/trunk/t/lib/TestApp/DispatchType/CustomPostLoad.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/t/lib/TestApp/DispatchType/CustomPostLoad.pm (rev 0)
+++ Catalyst-Runtime/5.80/trunk/t/lib/TestApp/DispatchType/CustomPostLoad.pm 2008-12-27 15:31:25 UTC (rev 8952)
@@ -0,0 +1,10 @@
+package TestApp::DispatchType::CustomPostLoad;
+use strict;
+use warnings;
+use base qw/Catalyst::DispatchType::Path/;
+
+# Never match anything..
+sub match { }
+
+1;
+
Added: Catalyst-Runtime/5.80/trunk/t/lib/TestApp/DispatchType/CustomPreLoad.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/t/lib/TestApp/DispatchType/CustomPreLoad.pm (rev 0)
+++ Catalyst-Runtime/5.80/trunk/t/lib/TestApp/DispatchType/CustomPreLoad.pm 2008-12-27 15:31:25 UTC (rev 8952)
@@ -0,0 +1,10 @@
+package TestApp::DispatchType::CustomPreLoad;
+use strict;
+use warnings;
+use base qw/Catalyst::DispatchType::Path/;
+
+# Never match anything..
+sub match { }
+
+1;
+
Added: Catalyst-Runtime/5.80/trunk/t/lib/TestApp/Plugin/AddDispatchTypes.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/t/lib/TestApp/Plugin/AddDispatchTypes.pm (rev 0)
+++ Catalyst-Runtime/5.80/trunk/t/lib/TestApp/Plugin/AddDispatchTypes.pm 2008-12-27 15:31:25 UTC (rev 8952)
@@ -0,0 +1,24 @@
+package TestApp::Plugin::AddDispatchTypes;
+use strict;
+use warnings;
+use Class::C3;
+
+sub setup_dispatcher {
+ my $class = shift;
+
+ ### Load custom DispatchTypes, as done by Catalyst::Plugin::Server
+ $class->next::method( @_ );
+ $class->dispatcher->preload_dispatch_types(
+ @{$class->dispatcher->preload_dispatch_types},
+ qw/ +TestApp::DispatchType::CustomPreLoad /
+ );
+ $class->dispatcher->postload_dispatch_types(
+ @{$class->dispatcher->postload_dispatch_types},
+ qw/ +TestApp::DispatchType::CustomPostLoad /
+ );
+
+ return $class;
+}
+
+1;
+
Modified: Catalyst-Runtime/5.80/trunk/t/lib/TestApp.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/t/lib/TestApp.pm 2008-12-27 11:16:35 UTC (rev 8951)
+++ Catalyst-Runtime/5.80/trunk/t/lib/TestApp.pm 2008-12-27 15:31:25 UTC (rev 8952)
@@ -7,6 +7,7 @@
Test::Plugin
Test::Inline
+TestApp::Plugin::FullyQualified
+ +TestApp::Plugin::AddDispatchTypes
/;
use Catalyst::Utils;
More information about the Catalyst-commits
mailing list