diff Lib/IMPL/Code/Loader.pm @ 274:8d36073411b1

+Added AutoDispose class *code cleanups
author cin
date Wed, 30 Jan 2013 03:30:28 +0400
parents 6d8092d8ce1b
children 4ddb27ff4a0b
line wrap: on
line diff
--- a/Lib/IMPL/Code/Loader.pm	Tue Jan 29 17:19:10 2013 +0400
+++ b/Lib/IMPL/Code/Loader.pm	Wed Jan 30 03:30:28 2013 +0400
@@ -3,7 +3,7 @@
 use warnings;
 
 use IMPL::Const qw(:prop);
-
+use File::Spec;
 use IMPL::declare {
 	require => {
 		Exception => 'IMPL::Exception',
@@ -53,6 +53,16 @@
     return $package;
 }
 
+sub ModuleExists {
+    my ($this,$package) = @_;
+    
+    my $file = join('/', split(/::/,$this->GetFullName($package))) . ".pm";
+    
+    -f File::Spec->catfile($_,$file) and return 1 foreach @INC;
+    
+    return 0;
+}
+
 sub GetFullName {
     my ($this,$package) = @_;