From: Dave Rolsky Date: Sun, 5 Apr 2009 21:06:37 +0000 (-0500) Subject: account for latest deprecations in CMOP X-Git-Tag: 0.73_01~5^2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b2df9268ec9fe2dafce9522eefc8d1dcd456fdd1;p=gitmo%2FMoose.git account for latest deprecations in CMOP --- diff --git a/lib/Moose/Manual/Concepts.pod b/lib/Moose/Manual/Concepts.pod index 70cac00..384e6ab 100644 --- a/lib/Moose/Manual/Concepts.pod +++ b/lib/Moose/Manual/Concepts.pod @@ -312,7 +312,7 @@ class it represents. my $meta = User->meta(); - for my $attribute ( $meta->compute_all_applicable_attributes ) { + for my $attribute ( $meta->get_all_attributes ) { print $attribute->name(), "\n"; if ( $attribute->has_type_constraint ) { @@ -320,7 +320,7 @@ class it represents. } } - for my $method ( $meta->compute_all_applicable_methods ) { + for my $method ( $meta->get_all_methods ) { print $method->name, "\n"; } diff --git a/lib/Moose/Meta/Attribute.pm b/lib/Moose/Meta/Attribute.pm index 824c4df..51099d4 100644 --- a/lib/Moose/Meta/Attribute.pm +++ b/lib/Moose/Meta/Attribute.pm @@ -248,7 +248,7 @@ sub clone { my ( @init, @non_init ); - foreach my $attr ( grep { $_->has_value($self) } $self->meta->compute_all_applicable_attributes ) { + foreach my $attr ( grep { $_->has_value($self) } $self->meta->get_all_attributes ) { push @{ $attr->has_init_arg ? \@init : \@non_init }, $attr; } diff --git a/lib/Moose/Meta/Class.pm b/lib/Moose/Meta/Class.pm index 9da65d7..768ebfc 100644 --- a/lib/Moose/Meta/Class.pm +++ b/lib/Moose/Meta/Class.pm @@ -156,7 +156,7 @@ sub new_object { my $params = @_ == 1 ? $_[0] : {@_}; my $self = $class->SUPER::new_object($params); - foreach my $attr ( $class->compute_all_applicable_attributes() ) { + foreach my $attr ( $class->get_all_attributes() ) { next unless $attr->can('has_trigger') && $attr->has_trigger; @@ -180,7 +180,7 @@ sub new_object { return $self; } -sub construct_instance { +sub _construct_instance { my $class = shift; my $params = @_ == 1 ? $_[0] : {@_}; my $meta_instance = $class->get_meta_instance; @@ -189,7 +189,7 @@ sub construct_instance { # but this is foreign inheritance, so we might # have to kludge it in the end. my $instance = $params->{'__INSTANCE__'} || $meta_instance->create_instance(); - foreach my $attr ($class->compute_all_applicable_attributes()) { + foreach my $attr ($class->get_all_attributes()) { $attr->initialize_instance_slot($meta_instance, $instance, $params); } return $instance; diff --git a/lib/Moose/Meta/Method/Constructor.pm b/lib/Moose/Meta/Method/Constructor.pm index ed7ec3b..34ef580 100644 --- a/lib/Moose/Meta/Method/Constructor.pm +++ b/lib/Moose/Meta/Method/Constructor.pm @@ -32,7 +32,7 @@ sub new { # specific to this subclass 'options' => $options{options}, 'meta_instance' => $meta->get_meta_instance, - 'attributes' => [ $meta->compute_all_applicable_attributes ], + 'attributes' => [ $meta->get_all_attributes ], # ... 'associated_metaclass' => $meta, } => $class; diff --git a/lib/Moose/Util.pm b/lib/Moose/Util.pm index 3637df1..70c193b 100644 --- a/lib/Moose/Util.pm +++ b/lib/Moose/Util.pm @@ -113,7 +113,7 @@ sub get_all_attribute_values { return +{ map { $_->name => $_->get_value($instance) } grep { $_->has_value($instance) } - $class->compute_all_applicable_attributes + $class->get_all_attributes }; } @@ -123,7 +123,7 @@ sub get_all_init_args { map { $_->init_arg => $_->get_value($instance) } grep { $_->has_value($instance) } grep { defined($_->init_arg) } - $class->compute_all_applicable_attributes + $class->get_all_attributes }; } diff --git a/t/200_examples/002_example_Moose_POOP.t b/t/200_examples/002_example_Moose_POOP.t index 143a46e..79c864c 100644 --- a/t/200_examples/002_example_Moose_POOP.t +++ b/t/200_examples/002_example_Moose_POOP.t @@ -137,7 +137,7 @@ BEGIN { extends 'Moose::Meta::Class'; - override 'construct_instance' => sub { + override '_construct_instance' => sub { my $class = shift; my $params = @_ == 1 ? $_[0] : {@_}; return $class->get_meta_instance->find_instance($params->{oid})