.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Module::Faker 3pm" .TH Module::Faker 3pm 2024-05-12 "perl v5.38.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME Module::Faker \- build fake dists for testing CPAN tools .SH VERSION .IX Header "VERSION" version 0.026 .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 4 \& Module::Faker\->make_fakes({ \& source => \*(Aq./dir\-of\-specs\*(Aq, # ...or a single file \& dest => \*(Aq./will\-contain\-tarballs\*(Aq, \& }); .Ve .SS DESCRIPTION .IX Subsection "DESCRIPTION" Module::Faker is a tool for building fake CPAN modules and, perhaps more importantly, fake CPAN distributions. These are useful for running tools that operate against CPAN distributions without having to use real CPAN distributions. This is much more useful when testing an entire CPAN instance, rather than a single distribution, for which see CPAN::Faker. .SH "PERL VERSION" .IX Header "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.) .PP 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. .SH METHODS .IX Header "METHODS" .SS make_fakes .IX Subsection "make_fakes" .Vb 1 \& Module::Faker\->make_fakes(\e%arg); .Ve .PP This method creates a new Module::Faker and builds archives in its destination directory for every dist-describing file in its source directory. See the "new" method below. .SS new .IX Subsection "new" .Vb 1 \& my $faker = Module::Faker\->new(\e%arg); .Ve .PP This create the new Module::Faker. All arguments may be accessed later by methods of the same name. Valid arguments are: .PP .Vb 2 \& source \- the directory in which to find source files \& dest \- the directory in which to construct dist archives \& \& dist_class \- the class used to fake dists; default: Module::Faker::Dist .Ve .PP The source files are essentially a subset of CPAN::Meta files with some optional extra features. All you really require are the name and abstract. Other bits like requirements can be specified and will be passed through. Out of the box the module will create the main module file based on the module name and a single test file. You can either use the provides section of the CPAN::META file or to specify their contents use the X_Module_Faker append section. .PP The X_Module_Faker also allows you to alter the cpan_author from the default 'LOCAL ' which overrides whatever is in the usual CPAN::Meta file. .PP Here is an example yaml specification from the tests, .PP .Vb 10 \& name: Append \& abstract: nothing to see here \& provides: \& Provides::Inner: \& file: lib/Provides/Inner.pm \& version: 0.001 \& Provides::Inner::Util: \& file: lib/Provides/Inner.pm \& X_Module_Faker: \& cpan_author: SOMEONE \& append: \& \- file: lib/Provides/Inner.pm \& content: "\en=head1 NAME\en\enAppend \- here I am" \& \- file: t/foo.t \& content: | \& use Test::More; \& \- file: t/foo.t \& content: "ok(1);" .Ve .PP If you need to sort the packages within a file you can use an X_Module_Faker:order parameter on the provides class. .PP .Vb 11 \& provides: \& Provides::Inner::Sorted::Charlie: \& file: lib/Provides/Inner/Sorted.pm \& version: 0.008 \& X_Module_Faker: \& order: 2 \& Provides::Inner::Sorted::Alfa: \& file: lib/Provides/Inner/Sorted.pm \& version: 0.001 \& X_Module_Faker: \& order: 1 .Ve .PP The supported keys from CPAN::Meta are, .IP \(bu 4 abstract .IP \(bu 4 license .IP \(bu 4 name .IP \(bu 4 release_status .IP \(bu 4 version .IP \(bu 4 provides .IP \(bu 4 prereqs .IP \(bu 4 x_authority .SH AUTHOR .IX Header "AUTHOR" Ricardo Signes .SH CONTRIBUTORS .IX Header "CONTRIBUTORS" .IP \(bu 4 Colin Newell .IP \(bu 4 David Golden .IP \(bu 4 David Steinbrunner .IP \(bu 4 gregor herrmann .IP \(bu 4 Jeffrey Ryan Thalhammer .IP \(bu 4 Mohammad S Anwar .IP \(bu 4 Moritz Onken .IP \(bu 4 Randy Stauner .IP \(bu 4 Ricardo Signes .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" This software is copyright (c) 2008 by Ricardo Signes. .PP This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.