X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMouse.git;a=blobdiff_plain;f=lib%2FMouse%2FUtil.pm;h=a8196185089a5bff0b319ba0c297fcc53796b42c;hp=cd6297a83f1fe3e6b623848dcc9edb8ec2851b3d;hb=0ffc4183de68b15deeec5d662d9cc1d125dabf26;hpb=637d4f17e6965551c032a3115dcbbb4d8e01fbf5 diff --git a/lib/Mouse/Util.pm b/lib/Mouse/Util.pm index cd6297a..a819618 100644 --- a/lib/Mouse/Util.pm +++ b/lib/Mouse/Util.pm @@ -74,12 +74,16 @@ use constant _MOUSE_VERBOSE => !!$ENV{MOUSE_VERBOSE}; # it must be 'require', not 'use', because Mouse::Meta::Module depends on Mouse::Util require Mouse::Meta::Module; # for the entities of metaclass cache utilities -BEGIN { +# aliases +{ *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; *get_all_metaclass_names = \&Mouse::Meta::Module::_get_all_metaclass_names; + *Mouse::load_class = \&load_class; + *Mouse::is_class_loaded = \&is_class_loaded; + # is-a predicates #generate_isa_predicate_for('Mouse::Meta::TypeConstraint' => 'is_a_type_constraint'); #generate_isa_predicate_for('Mouse::Meta::Class' => 'is_a_metaclass'); @@ -193,17 +197,7 @@ BEGIN { sub get_code_info; sub get_code_package; -# taken from Class/MOP.pm -sub is_valid_class_name { - my $class = shift; - - return 0 if ref($class); - return 0 unless defined($class); - - return 1 if $class =~ /\A \w+ (?: :: \w+ )* \z/xms; - - return 0; -} +sub is_valid_class_name; # taken from Class/MOP.pm sub load_first_existing_class {