Data::Fake::CPAN(3pm)

πŸ“¦
version 0.027 Β· 3 versions
, in debian trixie, ubuntu resolute, ubuntu stonking

πŸ’– Data::Fake::CPAN πŸ’–

okay bestie, so this is Data::Fake::CPAN, a Data::Fake plugin for making up CPAN data and distributions out of thin air. It lives in the User Contributed Perl Documentation section of your man pages, and yes it's giving iconic. ✨


✨ VERSION ✨

version 0.027 β€” no cap, that's the one. πŸ’…


🌸 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;

πŸ¦‹ DESCRIPTION πŸ¦‹

So 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. Lowkey just vibes for now. πŸ™ˆ

What's it for? Literally so many things: use it to generate libraries to test your CPAN-related tooling, or to test PAUSE at https://pause.perl.org. Make 10,000 of them 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 the Data::Fake generators, they return subroutines that you must call to get the actual faked data. Fr fr β€” the generator is not the data, you gotta call it. πŸ’€


πŸ’œ PERL VERSION πŸ’œ

This module should work on any version of perl still receiving updates from the Perl 5 Porters. Which 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.) Slay, love that for us. πŸ‘‘

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. So don't come for me about your ancient perl, bestie. 😭


πŸŽ€ 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. It's giving ✨statistically unlikely✨.

🌟 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. A whole little ecosystem, main character energy. 🫢

🌟 fake_license 🌟

This generator will spit out license values for a CPAN::Meta file, like "perl_5" or "openssl" or "unknown". Pick your fighter. πŸ“

🌟 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. So they're all related, it's a family. πŸ‘‘

🌟 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 (yes, the randomness is biased, that's on purpose, it's a vibe check). All package names will be faked with "fake_package_names".


πŸ’… AUTHOR πŸ’…

Ricardo Signes <cpan@semiotic.systems>


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.


and that's the whole page, bestie πŸ₯° mwah. This was Data::Fake::CPAN, version 0.027, rendered from perl v5.38.2, dated 2024-05-28, and it's still one of the three sections of the User Contributed Perl Documentation. Periodt. πŸ’–βœ¨πŸ¦‹

πŸ“¦ where this page comes from