File: module-blaster

package info (click to toggle)
libmodule-faker-perl 0.027-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 340 kB
  • sloc: perl: 1,231; makefile: 2
file content (25 lines) | stat: -rwxr-xr-x 711 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!perl
use v5.20.0;
use warnings;
# PODNAME: module-blaster
# ABSTRACT: create a random CPAN distribution

# This goofy little program spits out one or more faked up CPAN distributions.
# They should be valid, but will have no useful code in them.

use lib 'lib';

use Data::Fake qw(CPAN);
use Getopt::Long::Descriptive;

my ($opt, $usage) = describe_options(
  '%c %o',
  [ 'number|n=i', 'how many dists to blast out', { default => 1 } ],
);

for my $n (1 .. $opt->number) {
  my $dist = fake_cpan_distribution()->();
  my $archive = $dist->make_archive({ dir => '.' });
  say "Produced archive as $archive (cpan author: " . $dist->cpan_author . ")";
  say "- $_" for sort map {; $_->name } $dist->packages;
}