[Catalyst-commits] r8720 - in Catalyst-Runtime/5.80/trunk: .
lib/Catalyst lib/Catalyst/Engine/HTTP/Restarter
lib/Catalyst/Request t
t0m at dev.catalyst.perl.org
t0m at dev.catalyst.perl.org
Thu Dec 4 21:28:55 GMT 2008
Author: t0m
Date: 2008-12-04 21:28:55 +0000 (Thu, 04 Dec 2008)
New Revision: 8720
Removed:
Catalyst-Runtime/5.80/trunk/t/custom_request.t
Modified:
Catalyst-Runtime/5.80/trunk/Changes
Catalyst-Runtime/5.80/trunk/lib/Catalyst/ActionContainer.pm
Catalyst-Runtime/5.80/trunk/lib/Catalyst/DispatchType.pm
Catalyst-Runtime/5.80/trunk/lib/Catalyst/Dispatcher.pm
Catalyst-Runtime/5.80/trunk/lib/Catalyst/Engine/HTTP/Restarter/Watcher.pm
Catalyst-Runtime/5.80/trunk/lib/Catalyst/Log.pm
Catalyst-Runtime/5.80/trunk/lib/Catalyst/Request/Upload.pm
Catalyst-Runtime/5.80/trunk/lib/Catalyst/Response.pm
Catalyst-Runtime/5.80/trunk/t/caf_backcompat.t
Log:
Make everything which used to inherit CAF use the MX::Emulate::CAF role + test
Modified: Catalyst-Runtime/5.80/trunk/Changes
===================================================================
--- Catalyst-Runtime/5.80/trunk/Changes 2008-12-04 21:25:30 UTC (rev 8719)
+++ Catalyst-Runtime/5.80/trunk/Changes 2008-12-04 21:28:55 UTC (rev 8720)
@@ -1,11 +1,12 @@
# This file documents the revision history for Perl extension Catalyst.
5.8000_04
- - Add MooseX::Emulate::Class::Accessor::Fast to Catalyst::Action,
- needed by Catalyst::Controller::HTML::FormFu (zamolxes)
- - Test for this (zamolxes)
- - Add MooseX::Emulate::Class::Accessor::Fast to Catalyst::Request,
- needed by Catalyst::Request::REST (t0m)
+ - Compose the MooseX::Emulate::Class::Accessor::Fast role to
+ Catalyst::Action, Catalyst::Request, and all other modules which
+ inherit from Class::Accessor::Fast in 5.70.
+ This fixes:
+ - Catalyst::Controller::HTML::FormFu (zamolxes)
+ - Catalyst::Request::REST (t0m)
- Test for this (t0m)
- Make hostname resolution lazy (Marc Mims)
- Support mocking virtualhosts in test suite (Jason Gottshall)
@@ -17,8 +18,8 @@
- Fix list address in documentation (zarquon)
- Fix ACCEPT_CONTEXT on MyApp, called as a class method (marcus)
- Test for this (marcus)
- - Bump MX::Emulate::CAF version requirement to get more back
- compatibility (t0m)
+ - Bump MooseX::Emulate::Class::Accessor::Fast version requirement to
+ get more back compatibility (t0m)
- Improve documentation for $req->captures (caelum)
- Fix a bug in Catalyst::Stats, stopping garbage being inserted into
the stats if a user calls begin => but no end => (jhannah)
Modified: Catalyst-Runtime/5.80/trunk/lib/Catalyst/ActionContainer.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/lib/Catalyst/ActionContainer.pm 2008-12-04 21:25:30 UTC (rev 8719)
+++ Catalyst-Runtime/5.80/trunk/lib/Catalyst/ActionContainer.pm 2008-12-04 21:28:55 UTC (rev 8720)
@@ -16,6 +16,7 @@
=cut
use Moose;
+with 'MooseX::Emulate::Class::Accessor::Fast';
has part => (is => 'rw', required => 1);
has actions => (is => 'rw', required => 1, lazy => 1, default => sub { {} });
Modified: Catalyst-Runtime/5.80/trunk/lib/Catalyst/DispatchType.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/lib/Catalyst/DispatchType.pm 2008-12-04 21:25:30 UTC (rev 8719)
+++ Catalyst-Runtime/5.80/trunk/lib/Catalyst/DispatchType.pm 2008-12-04 21:28:55 UTC (rev 8720)
@@ -1,6 +1,7 @@
package Catalyst::DispatchType;
-use Moose; # using it to add Moose::Object to @ISA ...
+use Moose;
+with 'MooseX::Emulate::Class::Accessor::Fast';
no Moose;
=head1 NAME
Modified: Catalyst-Runtime/5.80/trunk/lib/Catalyst/Dispatcher.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/lib/Catalyst/Dispatcher.pm 2008-12-04 21:25:30 UTC (rev 8719)
+++ Catalyst-Runtime/5.80/trunk/lib/Catalyst/Dispatcher.pm 2008-12-04 21:28:55 UTC (rev 8720)
@@ -2,6 +2,7 @@
use Moose;
use Class::MOP;
+with 'MooseX::Emulate::Class::Accessor::Fast';
use Catalyst::Exception;
use Catalyst::Utils;
Modified: Catalyst-Runtime/5.80/trunk/lib/Catalyst/Engine/HTTP/Restarter/Watcher.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/lib/Catalyst/Engine/HTTP/Restarter/Watcher.pm 2008-12-04 21:25:30 UTC (rev 8719)
+++ Catalyst-Runtime/5.80/trunk/lib/Catalyst/Engine/HTTP/Restarter/Watcher.pm 2008-12-04 21:28:55 UTC (rev 8720)
@@ -1,6 +1,8 @@
package Catalyst::Engine::HTTP::Restarter::Watcher;
use Moose;
+with 'MooseX::Emulate::Class::Accessor::Fast';
+
use File::Find;
use File::Modified;
use File::Spec;
Modified: Catalyst-Runtime/5.80/trunk/lib/Catalyst/Log.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/lib/Catalyst/Log.pm 2008-12-04 21:25:30 UTC (rev 8719)
+++ Catalyst-Runtime/5.80/trunk/lib/Catalyst/Log.pm 2008-12-04 21:28:55 UTC (rev 8720)
@@ -1,6 +1,8 @@
package Catalyst::Log;
use Moose;
+with 'MooseX::Emulate::Class::Accessor::Fast';
+
use Data::Dump;
our %LEVELS = ();
Modified: Catalyst-Runtime/5.80/trunk/lib/Catalyst/Request/Upload.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/lib/Catalyst/Request/Upload.pm 2008-12-04 21:25:30 UTC (rev 8719)
+++ Catalyst-Runtime/5.80/trunk/lib/Catalyst/Request/Upload.pm 2008-12-04 21:28:55 UTC (rev 8720)
@@ -1,6 +1,7 @@
package Catalyst::Request::Upload;
use Moose;
+with 'MooseX::Emulate::Class::Accessor::Fast';
use Catalyst::Exception;
use File::Copy ();
Modified: Catalyst-Runtime/5.80/trunk/lib/Catalyst/Response.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/lib/Catalyst/Response.pm 2008-12-04 21:25:30 UTC (rev 8719)
+++ Catalyst-Runtime/5.80/trunk/lib/Catalyst/Response.pm 2008-12-04 21:28:55 UTC (rev 8720)
@@ -3,6 +3,8 @@
use Moose;
use HTTP::Headers;
+with 'MooseX::Emulate::Class::Accessor::Fast';
+
has cookies => (is => 'rw', default => sub { {} });
has body => (is => 'rw', default => '');
has location => (is => 'rw');
Modified: Catalyst-Runtime/5.80/trunk/t/caf_backcompat.t
===================================================================
--- Catalyst-Runtime/5.80/trunk/t/caf_backcompat.t 2008-12-04 21:25:30 UTC (rev 8719)
+++ Catalyst-Runtime/5.80/trunk/t/caf_backcompat.t 2008-12-04 21:28:55 UTC (rev 8720)
@@ -1,9 +1,29 @@
use strict;
use warnings;
-use Test::More tests => 1;
+use Test::More;
use Test::Exception;
-use Catalyst::Action;
+use Class::MOP ();
+use Moose::Util ();
-my $action=Catalyst::Action->new({foo=>'bar'});
+# List of everything which used Class::Accessor::Fast in 5.70.
+my @modules = qw/
+ Catalyst::Action
+ Catalyst::ActionContainer
+ Catalyst::Component
+ Catalyst::Dispatcher
+ Catalyst::DispatchType
+ Catalyst::Engine::HTTP::Restarter::Watcher
+ Catalyst::Engine
+ Catalyst::Log
+ Catalyst::Request::Upload
+ Catalyst::Request
+ Catalyst::Response
+/;
-is $action->{foo}, 'bar', 'custom Action attribute';
+plan tests => scalar @modules;
+
+foreach my $module (@modules) {
+ Class::MOP::load_class($module);
+ ok Moose::Util::does_role($module => 'MooseX::Emulate::Class::Accessor::Fast'),
+ "$module has Class::Accessor::Fast back-compat";
+}
Deleted: Catalyst-Runtime/5.80/trunk/t/custom_request.t
===================================================================
--- Catalyst-Runtime/5.80/trunk/t/custom_request.t 2008-12-04 21:25:30 UTC (rev 8719)
+++ Catalyst-Runtime/5.80/trunk/t/custom_request.t 2008-12-04 21:28:55 UTC (rev 8720)
@@ -1,16 +0,0 @@
-use strict;
-use warnings;
-use Test::More tests => 1;
-use Test::Exception;
-
-lives_ok {
- package TestApp::TestCustomRequest;
- use strict;
- use warnings;
- use base qw/Catalyst::Request/;
-
- # Catalyst::Request::REST uses this, so test it in core..
- __PACKAGE__->mk_accessors(qw( custom_accessor ));
-} 'Can make a custom request class';
-
-
More information about the Catalyst-commits
mailing list