From: Stevan Little Date: Fri, 14 Mar 2008 15:37:01 +0000 (+0000) Subject: some last minute tweaks X-Git-Tag: 0_55~277 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=81c3738fe69c74438ab232da74d9a99d2de6418d;p=gitmo%2FMoose.git some last minute tweaks --- diff --git a/Changes b/Changes index e12764c..9ac5dad 100644 --- a/Changes +++ b/Changes @@ -23,6 +23,8 @@ Revision history for Perl extension Moose - added ->create_anon_class which now supports roles and caching of the results (thanks to jrockway) - added tests for this + - made ->does_role a little more forgiving when it is + checking a Class::MOP era metaclasses. * Moose::Meta::Role::Application::ToInstance - it is now possible to pass extra params to be used when diff --git a/lib/Moose/Meta/Class.pm b/lib/Moose/Meta/Class.pm index 34ff29d..a34ef1d 100644 --- a/lib/Moose/Meta/Class.pm +++ b/lib/Moose/Meta/Class.pm @@ -90,7 +90,7 @@ sub does_role { (defined $role_name) || confess "You must supply a role name to look for"; foreach my $class ($self->class_precedence_list) { - next unless $class->can('meta'); + next unless $class->can('meta') && $class->meta->can('roles'); foreach my $role (@{$class->meta->roles}) { return 1 if $role->does_role($role_name); }