Module-Faker

 view release on metacpan or  search on metacpan

lib/Module/Faker/Dist.pm  view on Meta::CPAN


#pod =attr name
#pod
#pod This is the name of the dist.  It will usually look like C<Foo-Bar>.
#pod
#pod =attr version
#pod
#pod This is the version of the dist, usually some kind of versiony string like
#pod C<1.234> or maybe C<1.2.3>.
#pod
#pod =attr abstract
#pod
#pod The abstract!  This is a short, pithy description of the distribution, usually
#pod less than a sentence.
#pod
#pod =attr release_status
#pod
#pod This is the dist's release status.  (See L<CPAN::Meta::Spec>.)  It defaults to
#pod C<stable> but C<unstable> and C<testing> are valid values.
#pod
#pod =cut

my $DEFAULT_VERSION;

# required by CPAN::Meta::Spec
has name           => (is => 'ro', isa => 'Str', required => $DEFAULT_VERSION);
has version        => (is => 'ro', isa => 'Maybe[Str]', default => '0.01');
has abstract       => (is => 'ro', isa => 'Str', default => 'a great new dist');
has release_status => (is => 'ro', isa => 'Str', default => 'stable');

#pod =attr cpan_author
#pod
#pod This is the PAUSE id of the author, like C<RJBS>.
#pod
#pod =attr archive_ext
#pod
#pod This is the extension of the archive to build, when you build an archive.  This
#pod defaults to C<tar.gz>.  C<zip> works.  Other things might.  Try it and find
#pod out.
#pod
#pod =attr append
#pod
#pod This is an arrayref of hashrefs, each of which looks like:
#pod
#pod   { file => $filename, content => $character_string }
#pod
#pod The content will be UTF-8 encoded and put into a file with the given name.
#pod
#pod This feature is a bit weird.  Maybe it will go away eventually.
#pod
#pod =attr mtime
#pod
#pod If given, this is the epoch seconds to which to set the mtime of the generated
#pod file.  This is useful in rare occasions.
#pod
#pod =cut

# Module::Faker options
has cpan_author  => (is => 'ro', isa => 'Maybe[Str]', default => 'LOCAL');
has archive_ext  => (is => 'ro', isa => 'Str', default => 'tar.gz');
has append       => (is => 'ro', isa => 'ArrayRef[HashRef]', default => sub {[]});
has mtime        => (is => 'ro', isa => 'Int', predicate => 'has_mtime');

#pod =attr x_authority
#pod
#pod This is the C<X_Authority> header that gets put into the META files.
#pod
#pod =cut

has x_authority => (is => 'ro', isa => 'Str');

#pod =attr license
#pod
#pod This is the meta spec license string for the distribution.  It defaults to
#pod C<perl_5>.
#pod
#pod =cut

has license => (
  is      => 'ro',
  isa     => 'ArrayRef[Str]',
  default => sub { [ 'perl_5' ] },
);

#pod =attr authors
#pod
#pod This is an array of strings who are used as the authors in the dist metadata.
#pod The default is:
#pod
#pod   [ "AUTHOR <AUTHOR@cpan.local>" ]
#pod
#pod ...where C<AUTHOR> is the C<cpan_author> of the dist.
#pod
#pod =cut

has authors => (
  isa  => 'ArrayRef[Str]',
  lazy => 1,
  traits  => [ 'Array' ],
  handles => { authors => 'elements' },
  default => sub {
    my ($self) = @_;
    return [ sprintf '%s <%s@cpan.local>', ($self->cpan_author) x 2 ];
  },
);

#pod =attr include_provides_in_meta
#pod
#pod This is a bool.  If true, the produced META files will include a C<provides>
#pod key based on the packages in the dist.  It defaults to false, to match the
#pod most common behavior of dists in the wild.
#pod
#pod =cut

has include_provides_in_meta => (
  is  => 'ro',
  isa => 'Bool',
  default => 0,
);

#pod =attr provides



( run in 0.415 second using v1.01-cache-2.11-cpan-4ab04211f4c )