From: Dave Rolsky Date: Sun, 5 Apr 2009 21:57:43 +0000 (+0000) Subject: Changes to work with (and require) Moose 0.73_01 X-Git-Tag: 0.08~4 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b64c8efa3a64ace53507a9a2bb96090da56443c1;p=gitmo%2FMooseX-ClassAttribute.git Changes to work with (and require) Moose 0.73_01 --- diff --git a/Build.PL b/Build.PL index 8e85f90..4a885fb 100644 --- a/Build.PL +++ b/Build.PL @@ -6,7 +6,7 @@ use Module::Build; my $builder = Module::Build->new ( module_name => 'MooseX::ClassAttribute', license => 'perl', - requires => { 'Moose' => '0.57', + requires => { 'Moose' => '0.73_01', 'MooseX::AttributeHelpers' => '0.13', }, build_requires => { 'Scalar::Util' => '0', diff --git a/Changes b/Changes index 4eea10f..18867b2 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,11 @@ +0.08 + +- Make this work with Moose 0.73_01+. + +- Deprecated compute_all_applicable_class_attributes. Use + get_all_class_attributes instead. + + 0.07 2008-11-10 - Fixed a bug where class attributes did not honor the diff --git a/lib/MooseX/ClassAttribute.pm b/lib/MooseX/ClassAttribute.pm index e426d86..10fa03a 100644 --- a/lib/MooseX/ClassAttribute.pm +++ b/lib/MooseX/ClassAttribute.pm @@ -6,7 +6,7 @@ use warnings; our $VERSION = '0.07'; our $AUTHORITY = 'cpan:DROLSKY'; -use Moose (); +use Moose 0.73_01 (); use Moose::Exporter; use MooseX::ClassAttribute::Role::Meta::Class; diff --git a/lib/MooseX/ClassAttribute/Meta/Method/Accessor.pm b/lib/MooseX/ClassAttribute/Meta/Method/Accessor.pm index 8538d20..e446ee6 100644 --- a/lib/MooseX/ClassAttribute/Meta/Method/Accessor.pm +++ b/lib/MooseX/ClassAttribute/Meta/Method/Accessor.pm @@ -8,7 +8,7 @@ use Moose; extends 'Moose::Meta::Method::Accessor'; -sub generate_predicate_method_inline +sub _generate_predicate_method_inline { my $attr = (shift)->associated_attribute; @@ -22,7 +22,7 @@ sub generate_predicate_method_inline return $code; } -sub generate_clearer_method_inline +sub _generate_clearer_method_inline { my $attr = (shift)->associated_attribute; my $meta_instance = $attr->associated_class->instance_metaclass; diff --git a/lib/MooseX/ClassAttribute/Role/Meta/Class.pm b/lib/MooseX/ClassAttribute/Role/Meta/Class.pm index efa5d8a..1afe8c7 100644 --- a/lib/MooseX/ClassAttribute/Role/Meta/Class.pm +++ b/lib/MooseX/ClassAttribute/Role/Meta/Class.pm @@ -141,11 +141,6 @@ sub remove_class_attribute sub get_all_class_attributes { - shift->compute_all_applicable_class_attributes(@_); -} - -sub compute_all_applicable_class_attributes -{ my $self = shift; my %attrs = @@ -159,6 +154,14 @@ sub compute_all_applicable_class_attributes return values %attrs; } +sub compute_all_applicable_class_attributes +{ + warn 'The compute_all_applicable_class_attributes method has been deprecated.' + . " Use get_all_class_attributes instead.\n"; + + shift->compute_all_applicable_class_attributes(@_); +} + sub find_class_attribute_by_name { my $self = shift; @@ -292,9 +295,7 @@ along with its accessor methods. =head2 $meta->get_all_class_attributes() -=head2 $meta->compute_all_applicable_class_attributes() - -These methods return a list of attribute objects for the class and all +This method returns a list of attribute objects for the class and all its parent classes. =head2 $meta->find_class_attribute_by_name($name) diff --git a/t/pod-coverage.t b/t/pod-coverage.t index 3ec1bf6..f8acc72 100644 --- a/t/pod-coverage.t +++ b/t/pod-coverage.t @@ -17,6 +17,7 @@ plan tests => scalar @modules; my %trustme = ( 'MooseX::ClassAttribute' => [ 'init_meta', 'class_has' ], + 'MooseX::ClassAttribute::Role::Meta::Class' => [ 'compute_all_applicable_class_attributes' ], 'MooseX::ClassAttribute::Meta::Method::Accessor' => [ '.+' ] );