From: Matt S Trout Date: Tue, 5 Feb 2013 23:47:44 +0000 (+0000) Subject: change Mouse handling to avoid dying on old versions X-Git-Tag: v1.000008~12 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMoo.git;a=commitdiff_plain;h=96b09f219131ab88ebcb935e5baef654de7ddb84 change Mouse handling to avoid dying on old versions --- diff --git a/Changes b/Changes index 32aac77..d8b6ec6 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,5 @@ + - Switch to testing for Mouse::Util->can('find_meta') to avoid + exploding on ancient Mouse installs - Fix loading order bug that results in _install_coderef being treated as indirect object notation diff --git a/lib/Moo.pm b/lib/Moo.pm index 9f5246d..8061541 100644 --- a/lib/Moo.pm +++ b/lib/Moo.pm @@ -95,7 +95,7 @@ sub _set_superclasses { no warnings 'once'; # piss off. -- mst $Moo::HandleMoose::MOUSE{$target} = [ grep defined, map Mouse::Util::find_meta($_), @_ - ] if $INC{"Mouse.pm"}; + ] if Mouse::Util->can('find_meta'); } sub _maybe_reset_handlemoose { diff --git a/lib/Moo/Role.pm b/lib/Moo/Role.pm index f823754..0377dd7 100644 --- a/lib/Moo/Role.pm +++ b/lib/Moo/Role.pm @@ -92,7 +92,7 @@ sub _inhale_if_moose { and $meta = Class::MOP::class_of($role) ) or ( - $INC{"Mouse.pm"} + Mouse::Util->can('find_meta') and $meta = Mouse::Util::find_meta($role) ) ) {