- Sybase ASE driver now uses SET ROWCOUNT where possible, and
Generic Subquery otherwise for limit support instead of always
using software limit emulation
+ - create_ddl_dir (and derivatives) now attempt to create the given
+ $ddl_dir if it does not already exist
* Fixes
- Fix nasty potentially data-eating bug when deleting/updating
use Data::Dumper::Concise 'Dumper';
use Sub::Name 'subname';
use Try::Tiny;
-use File::Path 'mkpath';
+use File::Path 'make_path';
use namespace::clean;
__PACKAGE__->mk_group_accessors('simple' => qw/
carp "No directory given, using ./\n";
$dir = './';
} else {
- -d $dir or mkpath $dir
- or $self->throw_exception("create_ddl_dir: $! creating dir '$dir'");
+ -d $dir
+ or
+ make_path ("$dir") # make_path does not like objects (i.e. Path::Class::Dir)
+ or
+ $self->throw_exception(
+ "Failed to create '$dir': " . ($! || $@ || 'error unknow')
+ );
}
$self->throw_exception ("Directory '$dir' does not exist\n") unless(-d $dir);
}
use File::Spec;
-use File::Path qw/ mkpath rmtree /;
-
+use Path::Class qw/dir/;
+use File::Path qw/make_path remove_tree/;
my $schema = DBICTest->init_schema();
-my $var = File::Spec->catfile(qw| t var create_ddl_dir |);
+my $var = dir (qw| t var create_ddl_dir |);
-d $var
- or mkpath($var)
- or die "can't create $var";
+ or make_path( "$var" )
+ or die "can't create $var: $!";
-my $test_dir_1 = File::Spec->catdir( $var, 'test1', 'foo', 'bar' );
-rmtree( $test_dir_1 ) if -d $test_dir_1;
+my $test_dir_1 = $var->subdir ('test1', 'foo', 'bar' );
+remove_tree( "$test_dir_1" ) if -d $test_dir_1;
$schema->create_ddl_dir( undef, undef, $test_dir_1 );
-ok( -d $test_dir_1, 'create_ddl_dir did a mkpath on its target dir' );
+ok( -d $test_dir_1, 'create_ddl_dir did a make_path on its target dir' );
ok( scalar( glob $test_dir_1.'/*.sql' ), 'there are sql files in there' );
TODO: {