PkgForge
view release on metacpan or search on metacpan
lib/PkgForge/Job.pm view on Meta::CPAN
return;
}
has 'submitter' => (
traits => ['PkgForge::Serialise'],
is => 'rw',
isa => UserName,
required => 1,
coerce => 1,
default => sub { getpwuid($<) },
documentation => 'The name of the person who submitted this job',
);
has 'report' => (
traits => ['PkgForge::Serialise','Getopt','Array'],
is => 'rw',
isa => EmailAddressList,
coerce => 1,
cmd_aliases => 'r',
predicate => 'report_required',
lib/PkgForge/Job.pm view on Meta::CPAN
sub new_from_qentry {
my ( $class, $qentry ) = @_;
my $dir = $qentry->path;
my $obj = $class->new_from_dir($dir);
# Submitter
my $uid = $qentry->owner;
my $owner = getpwuid($uid);
$obj->submitter( $owner || $uid );
# Submission time
$obj->subtime($qentry->timestamp);
return $obj;
}
sub new_from_dir {
my ( $class, $dir ) = @_;
lib/PkgForge/Types.pm view on Meta::CPAN
coerce EmailAddressList, from ArrayRef,
via { [ map { $_->format } map { Email::Address->parse($_) } @{$_} ] };
subtype UserName,
as Str,
where { !/^\d+$/ };
coerce UserName,
from Str,
via { getpwuid($_) };
subtype UID,
as Int,
message { "$_ is not a UID" };
coerce UID,
from Str,
via { getpwnam($_) };
subtype Octal,
lib/PkgForge/Types.pm view on Meta::CPAN
=item EmailAddressList
This list type is based on the Moose ArrayRef type with the
requirement that all elements are of the C<EmailAddress> type.
=item UserName
This is a string type which represents a user name. Anything which is
NOT just a sequence of digits (i.e. looks like a UID) will be
allowed. If a UID is passed in it will be passed through the
C<getpwuid> function to retrieve the associated username.
=item UID
This is an integer type which represents a user ID (UID). Anything
which is not an integer will be passed through the C<getpwnam>
function to retrieve the associated UID.
=item Octal
This is a string type which represents an octal number. It expects the
( run in 0.296 second using v1.01-cache-2.11-cpan-454fe037f31 )