From: gfx Date: Thu, 1 Oct 2009 06:19:46 +0000 (+0900) Subject: Fix some code for new APIs X-Git-Tag: 0.37_01~5 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7727a2f03f4837d7b043d011bf9f7d48215b9948;p=gitmo%2FMouse.git Fix some code for new APIs --- diff --git a/lib/Mouse/Util.pm b/lib/Mouse/Util.pm index 123d5ff..deee325 100644 --- a/lib/Mouse/Util.pm +++ b/lib/Mouse/Util.pm @@ -37,7 +37,10 @@ our %EXPORT_TAGS = ( # aliases as public APIs -BEGIN{ +# it must be 'require', because Mouse::Meta::Module depends on Mouse::Util +require Mouse::Meta::Module; # for the entities of metaclass cache utilities + +BEGIN { *class_of = \&Mouse::Meta::Module::class_of; *get_metaclass_by_name = \&Mouse::Meta::Module::get_metaclass_by_name; *get_all_metaclass_instances = \&Mouse::Meta::Module::get_all_metaclass_instances; diff --git a/lib/Mouse/Util/TypeConstraints.pm b/lib/Mouse/Util/TypeConstraints.pm index 61205a0..5b3130a 100644 --- a/lib/Mouse/Util/TypeConstraints.pm +++ b/lib/Mouse/Util/TypeConstraints.pm @@ -8,7 +8,6 @@ use Carp qw(confess); use Scalar::Util qw/blessed looks_like_number openhandle/; use Mouse::Util qw(does_role not_supported); -use Mouse::Meta::Module; # get_metaclass_by_name() use Mouse::Meta::TypeConstraint; our @ISA = qw(Exporter); @@ -221,7 +220,7 @@ sub _find_or_create_regular_type{ return $TYPE{$spec} if exists $TYPE{$spec}; - my $meta = Mouse::Meta::Module::get_metaclass_by_name($spec); + my $meta = Mouse::Util::get_metaclass_by_name($spec); if(!$meta){ return;