NAME

Data::Fake::CPAN - a Data::Fake plugin for CPAN data and distributions

VERSION

version 0.027

SYNOPSIS

use Data::Fake qw(CPAN);

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;

This is a Data::Fake plugin for generating CPAN distributions. Right now, it can't be configured in any way, but future revisions might add some options. You can use this to generate libraries to test your CPAN-related tooling, to test PAUSE. Make 10,000 and host your own competing CPAN. The possibilities are endless.

All the fake_... functions exported by Data::Fake::CPAN are exported by default, and you're meant to use them via use Data::Fake. Like the rest of Data::Fake generators, they return subroutines that you must call to get the actual faked data.

PERL VERSION

This module should work on any version of perl still receiving updates from the Perl 5 Porters. This means it should work on any version of perl released in the last two to three years. (That is, if the most recently released version is v5.40, then this module should work on both v5.40 and v5.38.)

Although it may work on older versions of perl, no guarantee is made that the minimum required version will not be increased. The version may be increased for any reason, and there is no promise that patches will be accepted to lower the minimum required perl.

FUNCTIONS

fake_cpan_author

This generator generates objects representing CPAN authors. These methods are provided

  • given_name - a first name from Data::Fake::Names

  • surname - a surname from Data::Fake::Names

  • full_name - given name, space, surname

  • pauseid - an all caps PAUSE user id

  • email_address - an email address

  • name_and_email - a string in the form "full_name <email_address>"

If you call this generator many times, you might get duplicated data, but the odds are not high.

fake_cpan_distribution

This creates an entire CPAN distribution, as a Module::Faker::Dist object. It will contain at least one package, and possibly several.

fake_license

This generator will spit out license values for a CPAN::Meta file, like perl_5 or openssl or unknown.

fake_package_names

my $generator = fake_package_names($n);

The constructed generator will return n package names. The first package name will be a prefix of all the rest of the package names.

fake_prereqs

This generator will produce a reference to a hash that can be used as the prereqs entry in a CPAN::Meta file. Various type and phase combinations will be produced with unevenly distributed probabilities. All package names will be faked with fake_package_names.

AUTHOR

Ricardo Signes <cpan@semiotic.systems>

COPYRIGHT AND LICENSE

This software is copyright (c) 2008 by Ricardo Signes.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.