Skip to content
Browse files

シンボリックリンク対策

  • Loading branch information...
1 parent d30bf3f commit 3fc84d2b03fcc872a488606ccdb22620ec0fd0a4 @nekokak committed Jul 8, 2010
Showing with 4 additions and 2 deletions.
  1. +4 −2 lib/Kamui/Container.pm
View
6 lib/Kamui/Container.pm
@@ -1,6 +1,7 @@
package Kamui::Container;
use Kamui;
use base 'Class::Singleton';
+use Cwd qw/realpath/;
use UNIVERSAL::require;
use String::CamelCase qw/camelize/;
use Path::Class qw/file dir/;
@@ -53,8 +54,9 @@ sub initialize {
$class = ref $class || $class;
(my $file = "${class}.pm") =~ s!::!/!g;
if (my $path = $INC{$file}) {
- $path =~ s/$file$//;
- $path = dir($path);
+ my $realpath = realpath($path);
+ $realpath =~ s/$file$//;
+ $path = dir($realpath);
if (-d $path) {
$path = $path->absolute;
while ($path->dir_list(-1) =~ /^b?lib$/) {

0 comments on commit 3fc84d2

Please sign in to comment.
Something went wrong with that request. Please try again.