return $class;
}
-=item class2prefix($class);
+=item class2prefix( $class, $case );
Returns the prefix for class.
sub class2prefix {
my $class = shift || '';
+ my $case = shift || 0;
my $prefix;
if ( $class =~ /^.*::([MVC]|Model|View|Controller)?::(.*)$/ ) {
- $prefix = lc $2;
+ $prefix = $case ? $2 : lc $2;
$prefix =~ s/\:\:/\//g;
}
return $prefix;
{
$home = $subdir;
}
+ # clean up relative path:
+ # MyApp/script/.. -> MyApp
+ my ($lastdir) = $home->dir_list( -1, 1 );
+ if ( $lastdir eq '..' ) {
+ $home = dir($home)->parent->parent;
+ }
}
return $home;
}