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.037;
2             # ABSTRACT: something that provides a license for the dist
3              
4 2     2   14450 use Moose::Role;
  2         4  
  2         19  
5             with 'Dist::Zilla::Role::Plugin';
6              
7 2     2   12238 use Dist::Zilla::Pragmas;
  2         4  
  2         18  
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   17 no Moose::Role;
  2         4  
  2         14  
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.037
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
62             released in the last two to three years. (That is, if the most recently
63             released version is v5.40, then this module should work on both v5.40 and
64             v5.38.)
65              
66             Although it may work on older versions of perl, no guarantee is made that the
67             minimum required version will not be increased. The version may be increased
68             for any reason, and there is no promise that patches will be accepted to
69             lower the minimum required perl.
70              
71             =head1 REQUIRED METHODS
72              
73             =head2 C<< provide_license({ copyright_holder => $holder, copyright_year => $year }) >>
74              
75             Generate license object. Returned object should be an instance of
76             L<Software::License>.
77              
78             Plugins are responsible for injecting C<$copyright_holder> and
79             C<$copyright_year> arguments into the license if these arguments are defined.
80              
81             =head1 AUTHOR
82              
83             Ricardo SIGNES 😏 <cpan@semiotic.systems>
84              
85             =head1 COPYRIGHT AND LICENSE
86              
87             This software is copyright (c) 2026 by Ricardo SIGNES.
88              
89             This is free software; you can redistribute it and/or modify it under
90             the same terms as the Perl 5 programming language system itself.
91              
92             =cut