From: Matt S Trout Date: Fri, 6 Apr 2012 20:22:30 +0000 (+0000) Subject: auto-moose X-Git-Tag: v0.009_015~7 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8c46a8f67dacfe9f380bc07f392dc4cf21f2a1cb;p=gitmo%2FMoo.git auto-moose --- diff --git a/lib/Moo.pm b/lib/Moo.pm index 92337f2..eeee9e9 100644 --- a/lib/Moo.pm +++ b/lib/Moo.pm @@ -7,6 +7,18 @@ use B 'perlstring'; our $VERSION = '0.009014'; # 0.9.13 $VERSION = eval $VERSION; +sub Moo::HandleMoose::AuthorityHack::DESTROY { + require Moo::HandleMoose; + Moo::HandleMoose->import; +} + +if ($INC{"Moose.pm"}) { + require Moo::HandleMoose; + Moo::HandleMoose->import; +} else { + $Moose::AUTHORITY = bless({}, 'Moo::HandleMoose::AuthorityHack'); +} + our %MAKERS; sub import { diff --git a/xt/handle_moose.t b/xt/handle_moose.t index 34ea480..3f6d39f 100644 --- a/xt/handle_moose.t +++ b/xt/handle_moose.t @@ -3,7 +3,7 @@ use Test::Exception; BEGIN { require "t/moo-accessors.t"; } -use Moo::HandleMoose; +require Moose; my $meta = Class::MOP::get_metaclass_by_name('Foo');