From: Stevan Little Date: Sat, 26 Jan 2008 15:34:40 +0000 (+0000) Subject: 0.36 X-Git-Tag: 0_37~23 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e472c9a52978a503829fe1eb1f762c75315f6d41;p=gitmo%2FMoose.git 0.36 --- diff --git a/Changes b/Changes index 597f44b..f7c38fc 100644 --- a/Changes +++ b/Changes @@ -1,11 +1,12 @@ Revision history for Perl extension Moose -0.36 +0.36 Sat. Jan. 26, 2008 * Moose::Role Moose::Meta::Attribute - role type tests now support when roles are applied to non-Moose classes (found by ash) - added tests for this (thanks to ash) + - couple extra tests to boost code coverage * Moose::Meta::Method::Constructor - improved fix for handling Class::MOP attributes diff --git a/README b/README index ef6a9b7..2a64033 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -Moose version 0.35 +Moose version 0.36 =========================== See the individual module documentation for more information diff --git a/lib/Moose/Meta/Class.pm b/lib/Moose/Meta/Class.pm index 9233d74..928cd18 100644 --- a/lib/Moose/Meta/Class.pm +++ b/lib/Moose/Meta/Class.pm @@ -158,7 +158,11 @@ sub get_method_map { sub add_attribute { my $self = shift; - $self->SUPER::add_attribute($self->_process_attribute(@_)); + $self->SUPER::add_attribute( + (blessed $_[0] && $_[0]->isa('Class::MOP::Attribute') + ? $_[0] + : $self->_process_attribute(@_)) + ); } sub add_override_method_modifier { @@ -278,10 +282,7 @@ sub _apply_all_roles { my %ANON_CLASSES; sub _process_attribute { - my $self = shift; - - return $_[0] if blessed $_[0] && $_[0]->isa('Class::MOP::Attribute'); - + my $self = shift; my $name = shift; my %options = ((scalar @_ == 1 && ref($_[0]) eq 'HASH') ? %{$_[0]} : @_);