| 1 | package Dist::Zilla::Plugin::License 6.040; | ||
| 2 | # ABSTRACT: output a LICENSE file | ||
| 3 | |||
| 4 | 9 | ▶ | use Moose; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 9 | with 'Dist::Zilla::Role::FileGatherer'; | |
| 6 | |||
| 7 | 9 | ▶ | use Dist::Zilla::Pragmas; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | |||
| 9 | 9 | ▶ | use namespace::autoclean; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 10 | |||
| 11 | #pod =head1 DESCRIPTION | ||
| 12 | #pod | ||
| 13 | #pod This plugin adds a F<LICENSE> file containing the full text of the | ||
| 14 | #pod distribution's license, as produced by the C<fulltext> method of the | ||
| 15 | #pod dist's L<Software::License> object. | ||
| 16 | #pod | ||
| 17 | #pod =attr filename | ||
| 18 | #pod | ||
| 19 | #pod This attribute can be used to specify a name other than F<LICENSE> to be used. | ||
| 20 | #pod | ||
| 21 | #pod =cut | ||
| 22 | |||
| 23 | 9 | ▶ | use Dist::Zilla::File::InMemory; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 24 | |||
| 25 | 9 | has filename => ( | |
| 26 | is => 'ro', | ||
| 27 | isa => 'Str', | ||
| 28 | default => 'LICENSE', | ||
| 29 | ); | ||
| 30 | |||
| 31 | 9 | ▶ | sub gather_files { |
|
Subroutine
gather_files: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 32 | 9 | my ($self, $arg) = @_; | |
| 33 | |||
| 34 | 9 | my $file = Dist::Zilla::File::InMemory->new({ | |
| 35 | name => $self->filename, | ||
| 36 | content => $self->zilla->license->fulltext, | ||
| 37 | }); | ||
| 38 | |||
| 39 | 9 | $self->add_file($file); | |
| 40 | 9 | return; | |
| 41 | } | ||
| 42 | |||
| 43 | 9 | __PACKAGE__->meta->make_immutable; | |
| 44 | 9 | 1; | |
| 45 | |||
| 46 | #pod =head1 SEE ALSO | ||
| 47 | #pod | ||
| 48 | #pod =over 4 | ||
| 49 | #pod | ||
| 50 | #pod =item * | ||
| 51 | #pod | ||
| 52 | #pod the C<license> attribute of the L<Dist::Zilla> object to select the license | ||
| 53 | #pod to use. | ||
| 54 | #pod | ||
| 55 | #pod =item * | ||
| 56 | #pod | ||
| 57 | #pod Dist::Zilla roles: | ||
| 58 | #pod L<FileGatherer|Dist::Zilla::Role::FileGatherer>. | ||
| 59 | #pod | ||
| 60 | #pod =item * | ||
| 61 | #pod | ||
| 62 | #pod Other modules: | ||
| 63 | #pod L<Software::License>, | ||
| 64 | #pod L<Software::License::Artistic_2_0>. | ||
| 65 | #pod | ||
| 66 | #pod =back | ||
| 67 | #pod | ||
| 68 | #pod =cut | ||
| 69 | |||
| 70 | __END__ | ||