Last active
December 20, 2015 22:18
-
-
Save jeffa/6203445 to your computer and use it in GitHub Desktop.
Given a list of existing distribution folders, build the boiler plate tests and move them to some final destination. Probably too silly for anyone else's needs ...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl -l | |
use strict; | |
use warnings; | |
use File::Temp qw( tempdir ); | |
# init | |
chomp( my @dists = <DATA> ); | |
my $root = '/Users/jeffa/perl/tmp/'; | |
my $wipe = $root . '*'; | |
`rm -rf $wipe`; | |
`mkdir ${root}{tmp,lib,t}`; | |
# create distributions | |
chdir $root . 'tmp'; | |
my @modules = map { my $s = $_; $s =~ s/-/::/g; $s } @dists; | |
`module-starter --module=$_ --email=null` for @modules; | |
# move the goods | |
chdir $root; | |
for (@dists) { | |
`cp -r tmp/$_/lib/* lib/`; | |
`mv tmp/$_/t t/$_`; | |
} | |
# brag about it | |
`rm t/*/boilerplate.t`; | |
print `prove -lmrQ t/`; | |
# distributions | |
__DATA__ | |
FooBar | |
Foo-Bar | |
Foo-Bar-Baz |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment