X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMoose%2FMeta%2FRole.pm;h=5066f0630f9366bc4124bca62946ed279160dfa7;hb=4fd69d6c1e9ed820d8ea46f9aabf5afc705a4db0;hp=51628acab74cae76c35926f57a4d1c35124d443d;hpb=b805c70c24ed116e5900f563f4aa59f81b862059;p=gitmo%2FMoose.git diff --git a/lib/Moose/Meta/Role.pm b/lib/Moose/Meta/Role.pm index 51628ac..5066f06 100644 --- a/lib/Moose/Meta/Role.pm +++ b/lib/Moose/Meta/Role.pm @@ -149,26 +149,29 @@ sub _clean_up_required_methods { ## methods # FIXME: +# this is an UGLY hack +sub get_method_map { + my $self = shift; + $self->{'%:methods'} ||= {}; + $self->Moose::Meta::Class::get_method_map() +} + +# FIXME: # Yes, this is a really really UGLY hack # but it works, and until I can figure # out a better way, this is gonna be it. sub get_method { (shift)->Moose::Meta::Class::get_method(@_) } -sub find_method_by_name { (shift)->Moose::Meta::Class::find_method_by_name(@_) } sub has_method { (shift)->Moose::Meta::Class::has_method(@_) } sub alias_method { (shift)->Moose::Meta::Class::alias_method(@_) } -sub get_method_list { - my ($self) = @_; - grep { - # NOTE: - # this is a kludge for now,... these functions - # should not be showing up in the list at all, - # but they do, so we need to switch Moose::Role - # and Moose to use Sub::Exporter to prevent this - !/^(meta|has|extends|blessed|confess|augment|inner|override|super|before|after|around|with|requires)$/ - } $self->Moose::Meta::Class::get_method_list; +sub get_method_list { + grep { + !/^meta$/ + } (shift)->Moose::Meta::Class::get_method_list(@_) } +sub find_method_by_name { (shift)->has_method(@_) } + # ... however the items in statis (attributes & method modifiers) # can be removed and added to through this API @@ -376,7 +379,7 @@ sub _apply_methods { # it if it has one already if ($other->has_method($method_name) && # and if they are not the same thing ... - $other->get_method($method_name) != $self->get_method($method_name)) { + $other->get_method($method_name)->body != $self->get_method($method_name)->body) { # see if we are composing into a role if ($other->isa('Moose::Meta::Role')) { # method conflicts between roles result @@ -625,6 +628,8 @@ probably not that much really). =item B +=item B + =back =over 4