[Catalyst-commits] r9609 - in Catalyst-Runtime/5.80/trunk: .
lib/Catalyst
rafl at dev.catalyst.perl.org
rafl at dev.catalyst.perl.org
Sun Mar 29 19:58:04 BST 2009
Author: rafl
Date: 2009-03-29 19:58:04 +0100 (Sun, 29 Mar 2009)
New Revision: 9609
Modified:
Catalyst-Runtime/5.80/trunk/Makefile.PL
Catalyst-Runtime/5.80/trunk/lib/Catalyst/ClassData.pm
Log:
Adopt Catalyst::ClassData to latest Class::MOP::Class changes.
Also depend on the latest Class::MOP.
Modified: Catalyst-Runtime/5.80/trunk/Makefile.PL
===================================================================
--- Catalyst-Runtime/5.80/trunk/Makefile.PL 2009-03-29 18:49:09 UTC (rev 9608)
+++ Catalyst-Runtime/5.80/trunk/Makefile.PL 2009-03-29 18:58:04 UTC (rev 9609)
@@ -11,7 +11,7 @@
requires 'Moose' => '0.70';
requires 'Carp';
requires 'Class::C3::Adopt::NEXT' => '0.07';
-requires 'Class::MOP';
+requires 'Class::MOP' => '0.79';
requires 'CGI::Simple::Cookie';
requires 'Data::Dump';
requires 'File::Modified';
Modified: Catalyst-Runtime/5.80/trunk/lib/Catalyst/ClassData.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/lib/Catalyst/ClassData.pm 2009-03-29 18:49:09 UTC (rev 9608)
+++ Catalyst-Runtime/5.80/trunk/lib/Catalyst/ClassData.pm 2009-03-29 18:58:04 UTC (rev 9609)
@@ -46,17 +46,16 @@
my $meta = $class->Class::MOP::Object::meta();
confess "${class}'s metaclass is not a Class::MOP::Class"
unless $meta->isa('Class::MOP::Class');
- my $immutable_options;
- if( $meta->is_immutable ){
- $immutable_options = $meta->get_immutable_options;
- $meta->make_mutable;
- }
+
+ my $was_immutable = $meta->is_immutable;
+ $meta->make_mutable if $was_immutable;
+
my $alias = "_${attribute}_accessor";
$meta->add_method($alias, $accessor);
$meta->add_method($attribute, $accessor);
- if(defined $immutable_options){
- $meta->make_immutable(%{ $immutable_options });
- }
+
+ $meta->make_immutable if $was_immutable;
+
$class->$attribute($_[2]) if(@_ > 2);
return $accessor;
}
More information about the Catalyst-commits
mailing list