| 1 | 3 | ▶ | use 5.14.0; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 2 | 3 | ▶ | use strict; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 3 | 3 | ▶ | use warnings; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||||||
| 5 | package Dist::Iller::Config::Author::CSSON; | ||||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||
| 7 | # ABSTRACT: Dist::Iller config | ||||||||||||||||||||||||||||||||
| 8 | 3 | our $AUTHORITY = 'cpan:CSSON'; # AUTHORITY | |||||||||||||||||||||||||||||||
| 9 | 3 | our $VERSION = '0.0328'; | |||||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||||||
| 11 | 3 | ▶ | use Moose; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 12 | 3 | ▶ | use namespace::autoclean; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 13 | 3 | ▶ | use Path::Tiny; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 14 | 3 | ▶ | use Types::Path::Tiny qw/Path/; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 15 | 3 | ▶ | use Types::Standard qw/Bool Str Int/; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 16 | 3 | ▶ | use MooseX::AttributeDocumented; | ||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||
| 17 | |||||||||||||||||||||||||||||||||
| 18 | 3 | has filepath => ( | |||||||||||||||||||||||||||||||
| 19 | is => 'ro', | ||||||||||||||||||||||||||||||||
| 20 | isa => Path, | ||||||||||||||||||||||||||||||||
| 21 | default => 'author-csson.yaml', | ||||||||||||||||||||||||||||||||
| 22 | coerce => 1, | ||||||||||||||||||||||||||||||||
| 23 | documentation => q{Path to the plugin configuration file, relative to the installed share dir location.}, | ||||||||||||||||||||||||||||||||
| 24 | ); | ||||||||||||||||||||||||||||||||
| 25 | 3 | has is_task => ( | |||||||||||||||||||||||||||||||
| 26 | is => 'ro', | ||||||||||||||||||||||||||||||||
| 27 | isa => Bool, | ||||||||||||||||||||||||||||||||
| 28 | default => 0, | ||||||||||||||||||||||||||||||||
| 29 | documentation => q{If set to a true value it will include [TaskWeaver] instead of [PodWeaver].}, | ||||||||||||||||||||||||||||||||
| 30 | ); | ||||||||||||||||||||||||||||||||
| 31 | 3 | has installer => ( | |||||||||||||||||||||||||||||||
| 32 | is => 'rw', | ||||||||||||||||||||||||||||||||
| 33 | isa => Str, | ||||||||||||||||||||||||||||||||
| 34 | lazy => 1, | ||||||||||||||||||||||||||||||||
| 35 | default => 'MakeMaker', | ||||||||||||||||||||||||||||||||
| 36 | documentation => q{The installer plugin to be used.}, | ||||||||||||||||||||||||||||||||
| 37 | ); | ||||||||||||||||||||||||||||||||
| 38 | 3 | has is_private => ( | |||||||||||||||||||||||||||||||
| 39 | is => 'rw', | ||||||||||||||||||||||||||||||||
| 40 | isa => Int, | ||||||||||||||||||||||||||||||||
| 41 | lazy => 1, | ||||||||||||||||||||||||||||||||
| 42 | default => 0, | ||||||||||||||||||||||||||||||||
| 43 | documentation_alts => { | ||||||||||||||||||||||||||||||||
| 44 | 0 => q{Include [UploadToCPAN] and [GithubMeta].}, | ||||||||||||||||||||||||||||||||
| 45 | 1 => q{Include [UploadToStratopan].}, | ||||||||||||||||||||||||||||||||
| 46 | } | ||||||||||||||||||||||||||||||||
| 47 | ); | ||||||||||||||||||||||||||||||||
| 48 | has homepage => ( | ||||||||||||||||||||||||||||||||
| 49 | is => 'rw', | ||||||||||||||||||||||||||||||||
| 50 | isa => Str, | ||||||||||||||||||||||||||||||||
| 51 | lazy => 1, | ||||||||||||||||||||||||||||||||
| 52 | 0 | ▶ | default => sub { | ||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: not called CC=5 SCAR=34.0
| |||||||||||||||||||||||||||||||||
| 53 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||
| 54 | 0 | ▶ | my $distribution_name = $self->global && $self->global->has_distribution_name ? $self->global->distribution_name | ||||||||||||||||||||||||||||||
|
Branch: 2 branches
Condition0%0/3
$self->global and $self->global->has_distribution_name
MC/DC0%0/2
$self->global and $self->global->has_distribution_name
$self->global
$self->global->has_distribution_name
Truth table0%0/3
A and B
A= $self->globalB= $self->global->has_distribution_name
| |||||||||||||||||||||||||||||||||
| 55 | : $self->has_distribution_name ? $self->distribution_name | ||||||||||||||||||||||||||||||||
| 56 | : undef | ||||||||||||||||||||||||||||||||
| 57 | ; | ||||||||||||||||||||||||||||||||
| 58 | 0 | ▶ | return $distribution_name ? sprintf 'https://metacpan.org/release/%s', $distribution_name : undef; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 59 | }, | ||||||||||||||||||||||||||||||||
| 60 | 3 | documentation_default => q{https://metacpan.org/release/[distribution_name]}, | |||||||||||||||||||||||||||||||
| 61 | documentation => q{URL to the distribution's homepage.}, | ||||||||||||||||||||||||||||||||
| 62 | ); | ||||||||||||||||||||||||||||||||
| 63 | 3 | has splint => ( | |||||||||||||||||||||||||||||||
| 64 | is => 'rw', | ||||||||||||||||||||||||||||||||
| 65 | isa => Int, | ||||||||||||||||||||||||||||||||
| 66 | default => 0, | ||||||||||||||||||||||||||||||||
| 67 | documentation_alts => { | ||||||||||||||||||||||||||||||||
| 68 | 0 => q{Exclude Pod::Elemental::Transformer::Splint from weaver.ini}, | ||||||||||||||||||||||||||||||||
| 69 | 1 => q{Include Pod::Elemental::Transformer::Splint in weaver.ini}, | ||||||||||||||||||||||||||||||||
| 70 | } | ||||||||||||||||||||||||||||||||
| 71 | ); | ||||||||||||||||||||||||||||||||
| 72 | 3 | has badges => ( | |||||||||||||||||||||||||||||||
| 73 | is => 'ro', | ||||||||||||||||||||||||||||||||
| 74 | isa => Bool, | ||||||||||||||||||||||||||||||||
| 75 | default => 1, | ||||||||||||||||||||||||||||||||
| 76 | documentation => 'Include Badge::Depot badges or not.', | ||||||||||||||||||||||||||||||||
| 77 | ); | ||||||||||||||||||||||||||||||||
| 78 | |||||||||||||||||||||||||||||||||
| 79 | 3 | has travis => ( | |||||||||||||||||||||||||||||||
| 80 | is => 'rw', | ||||||||||||||||||||||||||||||||
| 81 | isa => Int, | ||||||||||||||||||||||||||||||||
| 82 | default => 0, | ||||||||||||||||||||||||||||||||
| 83 | documentation_order => 100, | ||||||||||||||||||||||||||||||||
| 84 | documentation_alts => { | ||||||||||||||||||||||||||||||||
| 85 | 0 => q{Exclude [TravisYML].}, | ||||||||||||||||||||||||||||||||
| 86 | 1 => q{Include [TravisYML].}, | ||||||||||||||||||||||||||||||||
| 87 | }, | ||||||||||||||||||||||||||||||||
| 88 | ); | ||||||||||||||||||||||||||||||||
| 89 | 3 | has travis_perl_min => ( | |||||||||||||||||||||||||||||||
| 90 | is => 'ro', | ||||||||||||||||||||||||||||||||
| 91 | isa => Int, | ||||||||||||||||||||||||||||||||
| 92 | lazy => 1, | ||||||||||||||||||||||||||||||||
| 93 | default => '14', | ||||||||||||||||||||||||||||||||
| 94 | documentation_order => 101, | ||||||||||||||||||||||||||||||||
| 95 | documentation => q{Minimum Perl version to test on Travis. All production releases up to (and including) 'travis_perl_max' are automatically included. Only give the minor version number (eg '14' for Perl 5.14).}, | ||||||||||||||||||||||||||||||||
| 96 | ); | ||||||||||||||||||||||||||||||||
| 97 | 3 | has travis_perl_max => ( | |||||||||||||||||||||||||||||||
| 98 | is => 'ro', | ||||||||||||||||||||||||||||||||
| 99 | isa => Int, | ||||||||||||||||||||||||||||||||
| 100 | lazy => 1, | ||||||||||||||||||||||||||||||||
| 101 | default => '24', | ||||||||||||||||||||||||||||||||
| 102 | documentation_order => 102, | ||||||||||||||||||||||||||||||||
| 103 | documentation => q{Maximum Perl version to test on Travis. See 'travis_perl_min'.} | ||||||||||||||||||||||||||||||||
| 104 | ); | ||||||||||||||||||||||||||||||||
| 105 | |||||||||||||||||||||||||||||||||
| 106 | |||||||||||||||||||||||||||||||||
| 107 | 3 | with 'Dist::Iller::Config'; | |||||||||||||||||||||||||||||||
| 108 | |||||||||||||||||||||||||||||||||
| 109 | 0 | ▶ | sub build_file { | ||||||||||||||||||||||||||||||
|
Subroutine
build_file: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 110 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||
| 111 | 0 | ▶ | return $self->installer =~ m/MakeMaker/ ? 'Makefile.PL' : 'Build.PL'; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 112 | } | ||||||||||||||||||||||||||||||||
| 113 | |||||||||||||||||||||||||||||||||
| 114 | 0 | ▶ | sub is_private_release { | ||||||||||||||||||||||||||||||
|
Subroutine
is_private_release: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 115 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||
| 116 | 0 | ▶ | return !$ENV{'FAKE_RELEASE'} && $self->is_private ? 1 : 0; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
not $ENV{"FAKE_RELEASE"} and $self->is_private
MC/DC0%0/2
not $ENV{"FAKE_RELEASE"} and $self->is_private
not $ENV{"FAKE_RELEASE"}
$self->is_private
Truth table0%0/3
not(A) and B
A= not $ENV{"FAKE_RELEASE"}B= $self->is_private
| |||||||||||||||||||||||||||||||||
| 117 | } | ||||||||||||||||||||||||||||||||
| 118 | 0 | ▶ | sub is_cpan_release { | ||||||||||||||||||||||||||||||
|
Subroutine
is_cpan_release: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 119 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||
| 120 | 0 | ▶ | return $ENV{'FAKE_RELEASE'} || $self->is_private ? 0 : 1; | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$ENV{"FAKE_RELEASE"} or $self->is_private
MC/DC0%0/2
$ENV{"FAKE_RELEASE"} or $self->is_private
$ENV{"FAKE_RELEASE"}
$self->is_private
Truth table0%0/3
A or B
A= $ENV{"FAKE_RELEASE"}B= $self->is_private
| |||||||||||||||||||||||||||||||||
| 121 | } | ||||||||||||||||||||||||||||||||
| 122 | |||||||||||||||||||||||||||||||||
| 123 | 0 | ▶ | sub add_default_github { | ||||||||||||||||||||||||||||||
|
Subroutine
add_default_github: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 124 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||
| 125 | # check git config | ||||||||||||||||||||||||||||||||
| 126 | 0 | my $add_default_github = 0; | |||||||||||||||||||||||||||||||
| 127 | 0 | my $git_config = path('.git/config'); | |||||||||||||||||||||||||||||||
| 128 | 0 | ▶ | if($git_config->exists) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 129 | 0 | my $git_config_contents = $git_config->slurp_utf8; | |||||||||||||||||||||||||||||||
| 130 | 0 | ▶ | if($git_config_contents =~ m{github\.com:([^/]+)/(.+)\.git}) { | ||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||
| 131 | 0 | $add_default_github = 1; | |||||||||||||||||||||||||||||||
| 132 | } | ||||||||||||||||||||||||||||||||
| 133 | else { | ||||||||||||||||||||||||||||||||
| 134 | 0 | say ('[DI/@Author::CSSON] No github url found'); | |||||||||||||||||||||||||||||||
| 135 | } | ||||||||||||||||||||||||||||||||
| 136 | } | ||||||||||||||||||||||||||||||||
| 137 | 0 | return $add_default_github; | |||||||||||||||||||||||||||||||
| 138 | } | ||||||||||||||||||||||||||||||||
| 139 | 0 | ▶ | sub travis_perl { | ||||||||||||||||||||||||||||||
|
Subroutine
travis_perl: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||||||||||||||||||||||
| 140 | 0 | my $self = shift; | |||||||||||||||||||||||||||||||
| 141 | 0 | ▶ | return join ' ' => map { "5.$_" } grep { $_ >= $self->travis_perl_min && $_ <= $self->travis_perl_max } qw/6 8 10 12 14 16 18 20 22 24/; | ||||||||||||||||||||||||||||||
|
Condition0%0/3
$_ >= $self->travis_perl_min && $_ <= $self->travis_perl_max
MC/DC0%0/2
$_ >= $self->travis_perl_min && $_ <= $self->travis_perl_max
$_ >= $self->travis_perl_min
$_ <= $self->travis_perl_max
Truth table0%0/3
A && B
A= $_ >= $self->travis_perl_minB= $_ <= $self->travis_perl_max
| |||||||||||||||||||||||||||||||||
| 142 | } | ||||||||||||||||||||||||||||||||
| 143 | |||||||||||||||||||||||||||||||||
| 144 | 3 | __PACKAGE__->meta->make_immutable; | |||||||||||||||||||||||||||||||
| 145 | |||||||||||||||||||||||||||||||||
| 146 | 3 | 1; | |||||||||||||||||||||||||||||||
| 147 | |||||||||||||||||||||||||||||||||
| 148 | __END__ | ||||||||||||||||||||||||||||||||