Skip to content

Commit

Permalink
mk dist dir
Browse files Browse the repository at this point in the history
  • Loading branch information
jrockway committed Sep 3, 2007
1 parent 94fba02 commit 31b7bf5
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/CatalystX/Starter.pm
Expand Up @@ -18,7 +18,8 @@ sub _module2dist {

sub _make_destination {
my $module = shift;

my $dist = _module2dist($module);
mkdir $dist or die "Failed to create dist directory '$dist': $!";
}


Expand Down
31 changes: 31 additions & 0 deletions t/mkdir.t
@@ -0,0 +1,31 @@
#!/usr/bin/env perl
# Copyright (c) 2007 Jonathan Rockway <jrockway@cpan.org>

use strict;
use warnings;
use File::pushd;
use Directory::Scratch;
use CatalystX::Starter;

use Test::TableDriven (
mk_dist => { 'Foo::Bar' => 'Foo-Bar',
'a::plugin' => 'a-plugin',
},
);

runtests;

sub mk_dist {
my $module = shift;
my $dir = Directory::Scratch->new;
my $push = pushd("$dir");

CatalystX::Starter::_make_destination($module);
my $dist = CatalystX::Starter::_module2dist($module);

if ($dir->exists($dist)) {
return $dist;
}

return [$dir->ls];
}

0 comments on commit 31b7bf5

Please sign in to comment.