Skip to content

Instantly share code, notes, and snippets.

@jeffa
Last active December 20, 2015 22:18
Show Gist options
  • Save jeffa/6203445 to your computer and use it in GitHub Desktop.
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 ...
#!/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