| 1 | 1 | ▶ | use 5.006; # our | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 2 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | |||||||||||
| 5 | package Dist::Zilla::Plugin::Author::KENTNL::CONTRIBUTING; | ||||||||||
| 6 | |||||||||||
| 7 | 1 | our $VERSION = '0.001006'; | |||||||||
| 8 | |||||||||||
| 9 | # ABSTRACT: Generates a CONTRIBUTING file for KENTNL's distributions. | ||||||||||
| 10 | |||||||||||
| 11 | 1 | our $AUTHORITY = 'cpan:KENTNL'; # AUTHORITY | |||||||||
| 12 | |||||||||||
| 13 | # NB: This list is intentionally short, because these are API-versions | ||||||||||
| 14 | # describing which document to fetch, and certain documents will update | ||||||||||
| 15 | # without changing their API version | ||||||||||
| 16 | 1 | my $valid_versions = { map { $_ => 1 } qw( 0.1 ) }; | |||||||||
| 17 | |||||||||||
| 18 | 1 | ▶ | use Moose qw( has around extends ); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 19 | 1 | ▶ | use Moose::Util::TypeConstraints qw( enum ); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 20 | 1 | ▶ | use Dist::Zilla::Plugin::GenerateFile::FromShareDir 0.006; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 21 | |||||||||||
| 22 | 1 | extends 'Dist::Zilla::Plugin::GenerateFile::FromShareDir'; | |||||||||
| 23 | |||||||||||
| 24 | 1 | my $valid_version_enum = enum [ keys %{$valid_versions} ]; | |||||||||
| 25 | |||||||||||
| 26 | 1 | ▶ | no Moose::Util::TypeConstraints; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 27 | |||||||||||
| 28 | |||||||||||
| 29 | |||||||||||
| 30 | |||||||||||
| 31 | |||||||||||
| 32 | |||||||||||
| 33 | |||||||||||
| 34 | |||||||||||
| 35 | |||||||||||
| 36 | |||||||||||
| 37 | |||||||||||
| 38 | 1 | has 'document_version' => ( | |||||||||
| 39 | isa => $valid_version_enum, | ||||||||||
| 40 | is => 'ro', | ||||||||||
| 41 | default => '0.1', | ||||||||||
| 42 | ); | ||||||||||
| 43 | |||||||||||
| 44 | has '+filename' => ( | ||||||||||
| 45 | lazy => 1, | ||||||||||
| 46 | 0 | ▶ | default => sub { 'CONTRIBUTING.pod' }, | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 47 | 1 | ); | |||||||||
| 48 | |||||||||||
| 49 | has '+source_filename' => ( | ||||||||||
| 50 | lazy => 1, | ||||||||||
| 51 | 0 | ▶ | default => sub { 'contributing-' . $_[0]->document_version . '.pod' }, | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 52 | 1 | ); | |||||||||
| 53 | |||||||||||
| 54 | has '+location' => ( | ||||||||||
| 55 | lazy => 1, | ||||||||||
| 56 | 0 | ▶ | default => sub { 'root' }, | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 57 | 1 | ); | |||||||||
| 58 | |||||||||||
| 59 | has '+phase' => ( | ||||||||||
| 60 | lazy => 1, | ||||||||||
| 61 | 0 | ▶ | default => sub { 'build' }, | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 62 | 1 | ); | |||||||||
| 63 | |||||||||||
| 64 | 0 | ▶ | around dump_config => sub { | ||||||||
|
Subroutine
__ANON__: not called CC=2 SCAR=17.9
| |||||||||||
| 65 | 0 | my ( $orig, $self, @args ) = @_; | |||||||||
| 66 | 0 | my $config = $self->$orig(@args); | |||||||||
| 67 | 0 | my $localconf = $config->{ +__PACKAGE__ } = {}; | |||||||||
| 68 | |||||||||||
| 69 | 0 | $localconf->{document_version} = $self->document_version; | |||||||||
| 70 | |||||||||||
| 71 | 0 | ▶ | $localconf->{ q[$] . __PACKAGE__ . '::VERSION' } = $VERSION | ||||||||
|
Branch: 1 branch
| |||||||||||
| 72 | unless __PACKAGE__ eq ref $self; | ||||||||||
| 73 | |||||||||||
| 74 | 0 | return $config; | |||||||||
| 75 | 1 | }; | |||||||||
| 76 | |||||||||||
| 77 | 1 | __PACKAGE__->meta->make_immutable; | |||||||||
| 78 | 1 | ▶ | no Moose; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 79 | |||||||||||
| 80 | 1 | 1; | |||||||||
| 81 | |||||||||||
| 82 | __END__ | ||||||||||