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