File Coverage

blib/lib/Dist/Zilla/Role/LicenseProvider.pm
Criterion Covered Total %
statement 9 9 100.0
branch n/a
condition n/a
subroutine 3 3 100.0
pod n/a
total 12 12 100.0


line stmt bran cond sub pod time code
1             # ABSTRACT: something that provides a license for the dist
2              
3             use Moose::Role;
4 2     2   14020 with 'Dist::Zilla::Role::Plugin';
  2         6  
  2         24  
5              
6             use Dist::Zilla::Pragmas;
7 2     2   11023  
  2         7  
  2         19  
8             #pod =head1 DESCRIPTION
9             #pod
10             #pod Plugins implementing this role must provide a C<provide_license> method that
11             #pod will be called when setting the dist's license.
12             #pod
13             #pod If a LicenseProvider offers a license but one has already been set, an
14             #pod exception will be raised. If C<provides_license> returns undef, it will be
15             #pod ignored.
16             #pod
17             #pod =head1 REQUIRED METHODS
18             #pod
19             #pod =head2 C<< provide_license({ copyright_holder => $holder, copyright_year => $year }) >>
20             #pod
21             #pod Generate license object. Returned object should be an instance of
22             #pod L<Software::License>.
23             #pod
24             #pod Plugins are responsible for injecting C<$copyright_holder> and
25             #pod C<$copyright_year> arguments into the license if these arguments are defined.
26             #pod
27             #pod =cut
28              
29             requires 'provide_license';
30              
31             no Moose::Role;
32 2     2   14 1;
  2         5  
  2         11  
33              
34              
35             =pod
36              
37             =encoding UTF-8
38              
39             =head1 NAME
40              
41             Dist::Zilla::Role::LicenseProvider - something that provides a license for the dist
42              
43             =head1 VERSION
44              
45             version 6.028
46              
47             =head1 DESCRIPTION
48              
49             Plugins implementing this role must provide a C<provide_license> method that
50             will be called when setting the dist's license.
51              
52             If a LicenseProvider offers a license but one has already been set, an
53             exception will be raised. If C<provides_license> returns undef, it will be
54             ignored.
55              
56             =head1 PERL VERSION
57              
58             This module should work on any version of perl still receiving updates from
59             the Perl 5 Porters. This means it should work on any version of perl released
60             in the last two to three years. (That is, if the most recently released
61             version is v5.40, then this module should work on both v5.40 and v5.38.)
62              
63             Although it may work on older versions of perl, no guarantee is made that the
64             minimum required version will not be increased. The version may be increased
65             for any reason, and there is no promise that patches will be accepted to lower
66             the minimum required perl.
67              
68             =head1 REQUIRED METHODS
69              
70             =head2 C<< provide_license({ copyright_holder => $holder, copyright_year => $year }) >>
71              
72             Generate license object. Returned object should be an instance of
73             L<Software::License>.
74              
75             Plugins are responsible for injecting C<$copyright_holder> and
76             C<$copyright_year> arguments into the license if these arguments are defined.
77              
78             =head1 AUTHOR
79              
80             Ricardo SIGNES 😏 <cpan@semiotic.systems>
81              
82             =head1 COPYRIGHT AND LICENSE
83              
84             This software is copyright (c) 2022 by Ricardo SIGNES.
85              
86             This is free software; you can redistribute it and/or modify it under
87             the same terms as the Perl 5 programming language system itself.
88              
89             =cut