license => 'perl',
module_name => 'DBIx::Class::Schema::Loader',
requires => {
- 'Cwd' => 0,
+ 'File::Spec' => 0,
'Scalar::Util' => 0,
'Data::Dump' => 1.06,
'UNIVERSAL::require' => 0.10,
'Test::More' => 0.32,
'DBI' => 1.50,
'DBD::SQLite' => 1.12,
+ 'File::Path' => 0,
},
create_makefile_pl => 'passthrough',
create_readme => 1,
use DBIx::Class::Schema::Loader::RelBuilder;
use Data::Dump qw/ dump /;
use POSIX qw//;
-use Cwd qw//;
+use File::Spec qw//;
require DBIx::Class;
__PACKAGE__->mk_ro_accessors(qw/
my $abs_dump_dir;
- $abs_dump_dir = Cwd::abs_path($self->dump_directory)
+ $abs_dump_dir = File::Spec->rel2abs($self->dump_directory)
if $self->dump_directory;
foreach my $table_class (values %{$self->classes}) {
my $class_path = $table_class;
$class_path =~ s{::}{/}g;
$class_path .= '.pm';
- my $filename = Cwd::abs_path($INC{$class_path});
+ my $filename = File::Spec->rel2abs($INC{$class_path});
croak 'Failed to locate actual external module file for '
. "'$table_class'"
if !$filename;
my ($self, $class) = (@_);
my @name_parts = split(/::/, $class);
- pop @name_parts;
+ pop @name_parts; # we don't care about the very last element,
+ # which is a filename
+
my $dir = $self->dump_directory;
foreach (@name_parts) {
- $dir .= q{/} . $_;
+ $dir = File::Spec->catdir($dir,$_);
if(! -d $dir) {
mkdir($dir) or croak "mkdir('$dir') failed: $!";
}