X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMouse.git;a=blobdiff_plain;f=lib%2FMouse%2FMeta%2FClass.pm;h=607de86a1bd0d2a7a202b040a506945586669ae2;hp=45341f59f1dbaafee5de6a69b3cebd4885085b26;hb=3b48bcc824fb6cfa90f907cf4d83e01c224a72dd;hpb=d990f7911dfd6a36d1dcc072e7adb72bf0379349 diff --git a/lib/Mouse/Meta/Class.pm b/lib/Mouse/Meta/Class.pm index 45341f5..607de86 100644 --- a/lib/Mouse/Meta/Class.pm +++ b/lib/Mouse/Meta/Class.pm @@ -6,6 +6,8 @@ use Scalar::Util qw/blessed weaken/; use Mouse::Meta::Module; our @ISA = qw(Mouse::Meta::Module); +our @CARP_NOT = qw(Mouse); # trust Mouse + sub attribute_metaclass; sub method_metaclass; @@ -187,8 +189,9 @@ sub add_attribute { $self->{attributes}{$attr->name} = $attr; $attr->install_accessors(); - if(Mouse::Util::_MOUSE_VERBOSE && !$attr->{associated_methods} && ($attr->{is} || '') ne 'bare'){ - Carp::cluck(qq{Attribute (}.$attr->name.qq{) of class }.$self->name.qq{ has no associated methods (did you mean to provide an "is" argument?)}); + if(!$attr->{associated_methods} && ($attr->{is} || '') ne 'bare'){ + Carp::carp(qq{Attribute ($name) of class }.$self->name + .qq{ has no associated methods (did you mean to provide an "is" argument?)}); } return $attr; } @@ -247,17 +250,15 @@ sub make_immutable { $self->{strict_constructor} = $args{strict_constructor}; if ($args{inline_constructor}) { - my $c = $self->constructor_class; - Mouse::Util::load_class($c); $self->add_method($args{constructor_name} => - $c->_generate_constructor($self, \%args)); + Mouse::Util::load_class($self->constructor_class) + ->_generate_constructor($self, \%args)); } if ($args{inline_destructor}) { - my $c = $self->destructor_class; - Mouse::Util::load_class($c); $self->add_method(DESTROY => - $c->_generate_destructor($self, \%args)); + Mouse::Util::load_class($self->destructor_class) + ->_generate_destructor($self, \%args)); } # Moose's make_immutable returns true allowing calling code to skip setting an explicit true value @@ -463,7 +464,7 @@ Mouse::Meta::Class - The Mouse class metaclass =head1 VERSION -This document describes Mouse version 0.50_02 +This document describes Mouse version 0.50_03 =head1 METHODS