blib/lib/Module/Starter/TOSHIOITO.pm

filter: Statementstmt 23.4% 22 / 94 Branchbran 0.0% 0 / 12 Conditioncond 0.0% 0 / 11 MC/DCmcdc 0.0% 0 / 6 Subroutinesub 36.8% 7 / 19 Podpod 100% 8 / 8 totaltotal 24.6% 37 / 150 CC 14 SCAR 27.9
CC
14
Cov
19%
create_distro
56.0
_github_repo_name
12.0
create_t
12.0
CRAP 16.2
↑ Summary
1 package Module::Starter::TOSHIOITO;
2 1 ▶use 5.10.0;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use base "Module::Starter::Simple";
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶use File::Spec;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶use ExtUtils::Command qw(mkpath);
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 1 our $VERSION = '0.09';
11  
12 0 ▶sub create_distro {
Subroutine create_distro: not called CC=7 SCAR=40.3
Pod documented
13 0 my $either = shift;
14 0 ▶ $either = $either->new(@_) if !ref($either);
Branch: 1 branch
BranchTrueFalseTotal
unless ref $either 0 0 0
15 0 my $self = $either;
16 0 ▶ $self->{ignores_type} = [qw(git manifest)] if !$self->{ignores_type} || !@{$self->{ignores_type}};
Branch: 1 branch
BranchTrueFalseTotal
unless $self->{"ignores_type"} and @{$self->{"ignores_type"};} 0 0 0
Condition0%0/3
$self->{"ignores_type"} and @{$self->{"ignores_type"};}
!ll&&!rl&&r
000
MC/DC0%0/2
$self->{"ignores_type"} and @{$self->{"ignores_type"};}
$self->{"ignores_type"} @{$self->{"ignores_type"};}
Truth table0%0/3
A and B
A= $self->{"ignores_type"}B= @{$self->{"ignores_type"};}
ABresult
0X0
100
111
17 0 ▶ $self->{verbose} //= 1;
Condition0%0/2
$self->{"verbose"} //= 1
l!l
00
MC/DC0%0/1
$self->{"verbose"} //= 1
$self->{"verbose"}
Truth table0%0/2
A
A= $self->{"verbose"}
Aresult
11
00
18 0 ▶ $self->{license} //= "perl";
Condition0%0/2
$self->{"license"} //= "perl"
l!l
00
MC/DC0%0/1
$self->{"license"} //= "perl"
$self->{"license"}
Truth table0%0/2
A
A= $self->{"license"}
Aresult
11
00
19 0 ▶ if(!$self->{github_user_name}) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->{"github_user_name"}) 0 0 0
20 0 croak "github_user_name config parameter is mandatory";
21 }
22 0 return $self->SUPER::create_distro();
23 }
24  
25 0 ▶sub _github_repo_name {
Subroutine _github_repo_name: not called CC=3 SCAR=24.8
26 0 my ($self) = @_;
27 0 ▶ my $prefix = $self->{github_repo_prefix} || "";
Condition0%0/2
$self->{'github_repo_prefix'} || ''
l!l
00
MC/DC0%0/1
$self->{'github_repo_prefix'} || ''
$self->{'github_repo_prefix'}
Truth table0%0/2
A
A= $self->{'github_repo_prefix'}
Aresult
11
00
28 0 ▶ my $postfix = $self->{github_repo_postfix} || "";
Condition0%0/2
$self->{'github_repo_postfix'} || ''
l!l
00
MC/DC0%0/1
$self->{'github_repo_postfix'} || ''
$self->{'github_repo_postfix'}
Truth table0%0/2
A
A= $self->{'github_repo_postfix'}
Aresult
11
00
29 0 return "$prefix$self->{distro}$postfix";
30 }
31  
32 0 ▶sub Build_PL_guts {
Subroutine Build_PL_guts: not called CC=1 SCAR=6.9
Pod documented
33 0 my ($self, $main_module, $main_pm_file) = @_;
34 0 my $author = "$self->{author} <$self->{email}>";
35
36 0 my $slname = $self->{license};
37 0 my $reponame = $self->_github_repo_name;
38
39 0 return <<"HERE";
40 use $self->{minperl};
41 use strict;
42 use warnings;
43 use Module::Build;
44 use Module::Build::Prereqs::FromCPANfile;
45
46 Module::Build->new(
47 module_name => '$main_module',
48 license => '$slname',
49 dist_author => q{$author},
50 dist_version_from => '$main_pm_file',
51 release_status => 'stable',
52 add_to_cleanup => [ '$self->{distro}-*' ],
53 recursive_test_files => 1,
54 dynamic_config => 1,
55 (-d "share") ? (share_dir => "share") : (),
56
57 mb_prereqs_from_cpanfile(),
58
59 no_index => {
60 directory => ["t", "xt", "eg", "inc", "share"],
61 file => ['README.pod', 'README.md'],
62 },
63 meta_add => {
64 'meta-spec' => {
65 version => 2,
66 url => 'https://metacpan.org/pod/CPAN::Meta::Spec',
67 },
68 resources => {
69 bugtracker => {
70 web => 'https://github.com/$self->{github_user_name}/$reponame/issues',
71 },
72 repository => {
73 url => 'git://github.com/$self->{github_user_name}/$reponame.git',
74 web => 'https://github.com/$self->{github_user_name}/$reponame',
75 },
76 }
77 }
78 )->create_build_script();
79 HERE
80 }
81  
82 0 ▶sub create_Build_PL {
Subroutine create_Build_PL: not called CC=1 SCAR=6.9
Pod documented
83 0 my ($self, $main_module) = @_;
84 0 my $result = $self->SUPER::create_Build_PL($main_module);
85 0 $self->_create_file_relative("cpanfile", <<'HERE');
86  
87 on 'test' => sub {
88 requires 'Test::More' => "0";
89 };
90  
91 on 'configure' => sub {
92 requires 'Module::Build', '0.42';
93 requires 'Module::Build::Prereqs::FromCPANfile', "0.02";
94 };
95 HERE
96 0 $self->_create_file_relative(".travis.yml", <<'HERE');
97 language: perl
98 perl:
99 - "5.10"
100 - "5.12"
101 - "5.14"
102 - "5.16"
103 - "5.18"
104 - "5.20"
105 before_install: "cpanm Module::Build::Prereqs::FromCPANfile"
106 HERE
107 0 return $result;
108 }
109  
110 0 ▶sub module_guts {
Subroutine module_guts: not called CC=1 SCAR=6.9
Pod documented
111 0 my ($self, $module, $rtname) = @_;
112 0 my $reponame = $self->_github_repo_name;
113 0 my $username = $self->{github_user_name};
114 0 my $license = $self->_module_license($module, $rtname);
115 0 my $bug_email = "bug-$self->{distro} at rt.cpan.org";
116 return <<"HERE"
117 package $module;
118 use strict;
119 use warnings;
120  
121 our \$VERSION = "0.01";
122  
123 1;
124 __END__
↑ Summary