From: Dave Rolsky Date: Sun, 26 Sep 2010 14:57:07 +0000 (-0500) Subject: Changes for next release of Moose X-Git-Tag: v0.18~10 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMooseX-ClassAttribute.git;a=commitdiff_plain;h=935982fc4f73317bea99646f46a22408111dd6ad Changes for next release of Moose --- diff --git a/Changes b/Changes index bb2b42b..f317721 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,8 @@ +0.17 2010-09-26 + +- Changes to work with (and require) Moose 1.09. + + 0.16 2010-07-15 - More warnings fixes for next Moose release. diff --git a/dist.ini b/dist.ini index 31a3faf..9af445a 100644 --- a/dist.ini +++ b/dist.ini @@ -28,7 +28,7 @@ repository.type = git [CheckChangeLog] [Prereqs] -Moose = 0.98 +Moose = 1.09 namespace::autoclean = 0 [Prereqs / TestRequires] diff --git a/lib/MooseX/ClassAttribute.pm b/lib/MooseX/ClassAttribute.pm index a142d0b..404b809 100644 --- a/lib/MooseX/ClassAttribute.pm +++ b/lib/MooseX/ClassAttribute.pm @@ -3,7 +3,7 @@ package MooseX::ClassAttribute; use strict; use warnings; -use Moose 0.98 (); +use Moose 1.09 (); use Moose::Exporter; use MooseX::ClassAttribute::Trait::Class; use MooseX::ClassAttribute::Trait::Role; diff --git a/lib/MooseX/ClassAttribute/Trait/Attribute.pm b/lib/MooseX/ClassAttribute/Trait/Attribute.pm index 7fe6a89..064e5c5 100644 --- a/lib/MooseX/ClassAttribute/Trait/Attribute.pm +++ b/lib/MooseX/ClassAttribute/Trait/Attribute.pm @@ -12,10 +12,6 @@ use Moose::Role; # because it overrides a lot of behavior. However, as a subclass it # won't cooperate with _other_ subclasses. -around 'accessor_metaclass' => sub { - return 'MooseX::ClassAttribute::Meta::Method::Accessor'; -}; - around '_process_options' => sub { my $orig = shift; my $class = shift; @@ -125,6 +121,48 @@ around 'clear_value' => sub { ->clear_class_attribute_value( $self->name() ); }; +around 'inline_get' => sub { + shift; + my $self = shift; + + return $self->associated_class() + ->inline_get_class_slot_value( $self->slots() ); +}; + +around 'inline_set' => sub { + shift; + my $self = shift; + shift; + my $value = shift; + + my $meta = $self->associated_class(); + + my $code + = $meta->inline_set_class_slot_value( $self->slots(), $value ) . ";"; + $code + .= $meta->inline_weaken_class_slot_value( $self->slots(), $value ) + . " if ref $value;" + if $self->is_weak_ref(); + + return $code; +}; + +around 'inline_has' => sub { + shift; + my $self = shift; + + return $self->associated_class() + ->inline_is_class_slot_initialized( $self->slots() ); +}; + +around 'inline_clear' => sub { + shift; + my $self = shift; + + return $self->associated_class() + ->inline_deinitialize_class_slot( $self->slots() ); +}; + 1; # ABSTRACT: A trait for class attributes