File Coverage

blib/lib/App/SmokeBrew/Plugin.pm
Criterion Covered Total %
statement 24 24 100.0
branch n/a
condition n/a
subroutine 8 8 100.0
pod n/a
total 32 32 100.0


line stmt bran cond sub pod time code
1             $App::SmokeBrew::Plugin::VERSION = '1.04';
2             #ABSTRACT: A Moose role for smokebrew plugins
3              
4             use strict;
5 2     2   1159 use warnings;
  2         4  
  2         64  
6 2     2   10  
  2         5  
  2         57  
7             use Moose::Role;
8 2     2   9 use Moose::Util::TypeConstraints;
  2         4  
  2         13  
9 2     2   9468 use MooseX::Types::Path::Class qw[Dir File];
  2         5  
  2         16  
10 2     2   3724 use MooseX::Types::Email qw[EmailAddress];
  2         3  
  2         20  
11 2     2   3454 use App::SmokeBrew::Types qw[ArrayRefUri];
  2         375009  
  2         32  
12 2     2   3772  
  2         6  
  2         19  
13             requires 'configure';
14              
15             has 'builddir' => (
16             is => 'ro',
17             isa => Dir,
18             required => 1,
19             coerce => 1,
20             );
21              
22             has 'prefix' => (
23             is => 'ro',
24             isa => Dir,
25             required => 1,
26             coerce => 1,
27             );
28              
29             has 'perl_exe' => (
30             is => 'ro',
31             isa => File,
32             required => 1,
33             coerce => 1,
34             );
35              
36             has 'mirrors' => (
37             is => 'ro',
38             isa => 'ArrayRefUri',
39             auto_deref => 1,
40             required => 1,
41             coerce => 1,
42             );
43              
44             has 'email' => (
45             is => 'ro',
46             isa => EmailAddress,
47             required => 1,
48             );
49              
50             has 'mx' => (
51             is => 'ro',
52             isa => 'Str',
53             );
54              
55             has 'noclean' => (
56             is => 'ro',
57             isa => 'Bool',
58             default => 0,
59             );
60              
61             has 'verbose' => (
62             is => 'ro',
63             isa => 'Bool',
64             default => 0,
65             );
66              
67             no Moose::Role;
68 2     2   1968  
  2         8  
  2         43  
69             qq[Smokin'];
70              
71              
72             =pod
73              
74             =encoding UTF-8
75              
76             =head1 NAME
77              
78             App::SmokeBrew::Plugin - A Moose role for smokebrew plugins
79              
80             =head1 VERSION
81              
82             version 1.04
83              
84             =head1 SYNOPSIS
85              
86             package App::SmokeBrew::Plugin::Some::Plugin;
87              
88             use Moose;
89              
90             with 'App::SmokeBrew::Plugin';
91              
92             =head1 DESCRIPTION
93              
94             App::SmokeBrew::Plugin is a L<Moose> role that L<smokebrew> plugins must consume.
95              
96             =head1 ATTRIBUTES
97              
98             These are the attributes provided by the role and are expected by L<smokebrew>:
99              
100             =over
101              
102             =item C<email>
103              
104             A required attribute, this must be a valid email address as constrained by L<MooseX::Types::Email>
105              
106             =item C<builddir>
107              
108             A required attribute, this is the working directory where builds can take place. It will be coerced
109             into a L<Path::Class::Dir> object by L<MooseX::Types::Path::Class>.
110              
111             =item C<prefix>
112              
113             A required attribute, this is the prefix of the location where perl installs will be made, it will be coerced
114             into a L<Path::Class::Dir> object by L<MooseX::Types::Path::Class>.
115              
116             example:
117              
118             prefix = /home/cpan/pit/rel
119             perls will be installed as /home/cpan/pit/perl-5.12.0, /home/cpan/pit/perl-5.10.1, etc.
120              
121             =item C<perl_exe>
122              
123             A required attribute, this is the path to the perl executable that the plugin will configure, it will be
124             coerced to a L<Path::Class::File> object by L<MooseX::Types::Path::Class>.
125              
126             =item C<mirrors>
127              
128             A required attribute, this is an arrayref of L<URI> objects representing CPAN Mirrors to use. It uses
129             type C<ArrayRefUri> from L<App::SmokeBrew::Types>, so will coerce L<URI> objects from ordinary strings and
130             from an arrayref of strings. It is set to C<auto_deref>.
131              
132             =item C<mx>
133              
134             Optional attribute, which has no default value, this is the address or IP address of a mail exchanger to use
135             for sending test reports.
136              
137             =item C<verbose>
138              
139             Optional boolean attribute, which defaults to 0, indicates whether the plugin should produce verbose output.
140              
141             =item C<noclean>
142              
143             Optional boolean attribute, which defaults to 0, indicates whether the plugin should cleanup files that it
144             produces under the C<builddir> or not.
145              
146             =back
147              
148             =head1 METHODS
149              
150             Consumer classes as required to implement the following methods:
151              
152             =over
153              
154             =item C<configure>
155              
156             Called by L<smokebrew> to configure the given perl for CPAN Testing.
157              
158             =back
159              
160             =head1 PLUGIN OPTIONS
161              
162             L<App::SmokeBrew> will pass any options it finds in a named section of the configuration file for a
163             plugin when it a new plugin instance. See L<smokebrew> for details. You are expected to document any options
164             that may be passed to your plugin in this manner.
165              
166             =head1 SEE ALSO
167              
168             L<smokebrew>
169              
170             L<Moose::Role>
171              
172             L<MooseX::Types::Email>
173              
174             L<MooseX::Types::Path::Class>
175              
176             =head1 AUTHOR
177              
178             Chris Williams <chris@bingosnet.co.uk>
179              
180             =head1 COPYRIGHT AND LICENSE
181              
182             This software is copyright (c) 2022 by Chris Williams.
183              
184             This is free software; you can redistribute it and/or modify it under
185             the same terms as the Perl 5 programming language system itself.
186              
187             =cut