X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMouse%2FMeta%2FClass.pm;h=ba9d417f7bc2267381cc57d27d81a7ee2b612e59;hb=8d5287a7df12b6fb0bdff2090220684913bdad04;hp=e2eb4bf7b2c1e0d58b2ffa820c3829cea1e80074;hpb=df7e47294bc932e837f0548f61125e84fe56eb94;p=gitmo%2FMouse.git diff --git a/lib/Mouse/Meta/Class.pm b/lib/Mouse/Meta/Class.pm index e2eb4bf..ba9d417 100644 --- a/lib/Mouse/Meta/Class.pm +++ b/lib/Mouse/Meta/Class.pm @@ -223,27 +223,11 @@ sub add_attribute { return $attr; } -sub compute_all_applicable_attributes { # DEPRECATED - Carp::cluck('compute_all_applicable_attributes() has been deprecated. Use get_all_attributes() instead'); - - return shift->get_all_attributes(@_) -} - sub linearized_isa; sub new_object; sub clone_object; - -sub clone_instance { # DEPRECATED - my ($class, $instance, %params) = @_; - - Carp::cluck('clone_instance() has been deprecated. Use clone_object() instead'); - - return $class->clone_object($instance, %params); -} - - sub immutable_options { my ( $self, @args ) = @_; @@ -255,7 +239,6 @@ sub immutable_options { ); } - sub make_immutable { my $self = shift; my %args = $self->immutable_options(@_); @@ -288,12 +271,12 @@ sub make_mutable { sub is_immutable; sub is_mutable { !$_[0]->is_immutable } -sub _install_modifier_pp{ +sub _install_modifier { my( $self, $type, $name, $code ) = @_; my $into = $self->name; my $original = $into->can($name) - or $self->throw_error("The method '$name' is not found in the inheritance hierarchy for class $into"); + or $self->throw_error("The method '$name' was not found in the inheritance hierarchy for $into"); my $modifier_table = $self->{modifiers}{$name}; @@ -354,55 +337,6 @@ sub _install_modifier_pp{ return; } -sub _install_modifier { - my ( $self, $type, $name, $code ) = @_; - - # load Data::Util first - my $no_cmm_fast = do{ - local $@; - eval q{ use Data::Util 0.55 () }; - $@; - }; - - my $impl; - if($no_cmm_fast){ - $impl = \&_install_modifier_pp; - } - else{ - $impl = sub { - my ( $self, $type, $name, $code ) = @_; - my $into = $self->name; - - my $method = Mouse::Util::get_code_ref( $into, $name ); - - if ( !$method || !Data::Util::subroutine_modifier($method) ) { - unless ($method) { - $method = $into->can($name) - or Carp::confess("The method '$name' is not found in the inheritance hierarchy for class $into"); - } - $method = Data::Util::modify_subroutine( $method, - $type => [$code] ); - - $self->add_method($name => $method); - } - else { - Data::Util::subroutine_modifier( $method, $type => $code ); - $self->add_method($name => Mouse::Util::get_code_ref($into, $name)); - } - - return; - }; - } - - # replace this method itself :) - { - no warnings 'redefine'; - *_install_modifier = $impl; - } - - $self->$impl( $type, $name, $code ); -} - sub add_before_method_modifier { my ( $self, $name, $code ) = @_; $self->_install_modifier( 'before', $name, $code ); @@ -490,7 +424,7 @@ Mouse::Meta::Class - The Mouse class metaclass =head1 VERSION -This document describes Mouse version 0.63 +This document describes Mouse version 0.67 =head1 METHODS