Class::MOP::load_class, is_class_loaded was deprecated in Moose-2.1100
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Utils.pm
index 440d9e9..76b8262 100644 (file)
@@ -7,7 +7,7 @@ use Path::Class;
 use URI;
 use Carp qw/croak/;
 use Cwd;
-use Class::MOP;
+use Class::Load 'is_class_loaded';
 use String::RewritePrefix;
 
 use namespace::clean;
@@ -161,12 +161,26 @@ Returns home directory for given class.
 =head2 dist_indicator_file_list
 
 Returns a list of files which can be tested to check if you're inside
-a checkout
+a CPAN distribution which is not yet installed.
+
+These are:
+
+=over
+
+=item Makefile.PL
+
+=item Build.PL
+
+=item dist.ini
+
+=item L<cpanfile>
+
+=back
 
 =cut
 
 sub dist_indicator_file_list {
-    qw{Makefile.PL Build.PL dist.ini};
+    qw{Makefile.PL Build.PL dist.ini cpanfile};
 }
 
 sub home {
@@ -283,7 +297,7 @@ sub ensure_class_loaded {
     # if it already has symbol table entries. This is to support things like Schema::Loader, which
     # part-generate classes in memory, but then also load some of their contents from disk.
     return if !$opts->{ ignore_loaded }
-        && Class::MOP::is_class_loaded($class); # if a symbol entry exists we don't load again
+        && is_class_loaded($class); # if a symbol entry exists we don't load again
 
     # this hack is so we don't overwrite $@ if the load did not generate an error
     my $error;
@@ -298,7 +312,7 @@ sub ensure_class_loaded {
     die $error if $error;
 
     warn "require $class was successful but the package is not defined."
-        unless Class::MOP::is_class_loaded($class);
+        unless is_class_loaded($class);
 
     return 1;
 }