[Bast-commits] r4015 - in DBIx-Class-Fixtures/1.000/trunk: .
lib/DBIx/Class lib/DBIx/Class/Fixtures
captainL at dev.catalyst.perl.org
captainL at dev.catalyst.perl.org
Sat Feb 2 00:07:48 GMT 2008
Author: captainL
Date: 2008-02-02 00:07:48 +0000 (Sat, 02 Feb 2008)
New Revision: 4015
Modified:
DBIx-Class-Fixtures/1.000/trunk/Makefile.PL
DBIx-Class-Fixtures/1.000/trunk/lib/DBIx/Class/Fixtures.pm
DBIx-Class-Fixtures/1.000/trunk/lib/DBIx/Class/Fixtures/Versioned.pm
Log:
ported all system commands to perl for portability
Modified: DBIx-Class-Fixtures/1.000/trunk/Makefile.PL
===================================================================
--- DBIx-Class-Fixtures/1.000/trunk/Makefile.PL 2008-02-01 23:01:26 UTC (rev 4014)
+++ DBIx-Class-Fixtures/1.000/trunk/Makefile.PL 2008-02-02 00:07:48 UTC (rev 4015)
@@ -12,9 +12,8 @@
'DBIx::Class' => 0,
'Class::Accessor' => 0,
'Path::Class' => 0,
- 'Config::Any' => 0,
+ 'Config::Any::JSON' => 0,
'Data::Dump::Streamer' => 0,
- 'File::Slurp' => 0,
'Hash::Merge' => 0,
},
dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
Modified: DBIx-Class-Fixtures/1.000/trunk/lib/DBIx/Class/Fixtures/Versioned.pm
===================================================================
--- DBIx-Class-Fixtures/1.000/trunk/lib/DBIx/Class/Fixtures/Versioned.pm 2008-02-01 23:01:26 UTC (rev 4014)
+++ DBIx-Class-Fixtures/1.000/trunk/lib/DBIx/Class/Fixtures/Versioned.pm 2008-02-02 00:07:48 UTC (rev 4015)
@@ -4,6 +4,7 @@
use warnings;
use base qw/DBIx::Class::Fixtures/;
+use DBIx::Class::Fixtures::SchemaVersioned;
use Class::C3;
=head1 VERSION
Modified: DBIx-Class-Fixtures/1.000/trunk/lib/DBIx/Class/Fixtures.pm
===================================================================
--- DBIx-Class-Fixtures/1.000/trunk/lib/DBIx/Class/Fixtures.pm 2008-02-01 23:01:26 UTC (rev 4014)
+++ DBIx-Class-Fixtures/1.000/trunk/lib/DBIx/Class/Fixtures.pm 2008-02-02 00:07:48 UTC (rev 4015)
@@ -6,12 +6,13 @@
use DBIx::Class::Exception;
use Class::Accessor;
use Path::Class qw(dir file);
+use File::Slurp;
use Config::Any::JSON;
use Data::Dump::Streamer;
use Data::Visitor::Callback;
-use File::Slurp;
use File::Path;
use File::Copy::Recursive qw/dircopy/;
+use File::Copy qw/move/;
use Hash::Merge qw( merge );
use Data::Dumper;
@@ -55,6 +56,8 @@
=head1 AUTHOR
+Luke Saunders <luke at shadowcatsystems.co.uk>
+
=head1 CONTRIBUTORS
=head1 METHODS
@@ -129,14 +132,12 @@
$self->msg("generating fixtures");
my $tmp_output_dir = dir($output_dir, '-~dump~-');
- unless (-e $tmp_output_dir) {
- $self->msg("- creating $tmp_output_dir");
- mkdir($tmp_output_dir, 0777);
- }else {
+ if (-e $tmp_output_dir) {
$self->msg("- clearing existing $tmp_output_dir");
- # delete existing fixture set
- system("rm -rf $tmp_output_dir/*");
+ $tmp_output_dir->rmtree;
}
+ $self->msg("- creating $tmp_output_dir");
+ $tmp_output_dir->mkpath;
# write version file (for the potential benefit of populate)
my $version_file = file($tmp_output_dir, '_dumper_version');
@@ -189,7 +190,7 @@
}
$self->msg("- moving temp dir to $output_dir");
- system("mv $tmp_output_dir/* $output_dir/");
+ move($_, dir($output_dir, $_->relative($_->parent)->stringify)) for $tmp_output_dir->children;
if (-e $output_dir) {
$self->msg("- clearing tmp dir $tmp_output_dir");
# delete existing fixture set
More information about the Bast-commits
mailing list