Dist/Zilla/PluginBundle/Author/Celogeek.pm

filter: Statementstmt 44.7% 17 / 38 Branchbran 0.0% 0 / 10 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 66.6% 4 / 6 Podpod 100% 2 / 2 totaltotal 41.0% 23 / 56 CC 6 SCAR 31.6
CC
6
Cov
35%
before_build
42.0
configure
2.0
BEGIN
1.0
CRAP 23.5
↑ Summary Pod/Weaver/PluginBundle/Celogeek.pm »
1 #
2 # This file is part of Dist-Zilla-PluginBundle-Author-Celogeek
3 #
4 # This software is copyright (c) 2014 by celogeek <me@celogeek.com>.
5 #
6 # This is free software; you can redistribute it and/or modify it under
7 # the same terms as the Perl 5 programming language system itself.
8 #
9 package Dist::Zilla::PluginBundle::Author::Celogeek;
10  
11 # ABSTRACT: Dist::Zilla like Celogeek
12  
13 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
15  
16 1 our $VERSION = '1.1'; # VERSION
17  
18 1 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
19 1 ▶use Class::MOP;
Subroutine BEGIN: called CC=1 SCAR=0.0
20 1 with 'Dist::Zilla::Role::PluginBundle::Easy',
21 'Dist::Zilla::Role::PluginBundle::PluginRemover';
22  
23 1 my $PERLTIDY_SAMPLE = <<'EOF'
24 #Perl Best Practice Conf
25 -l=78
26 -i=4
27 -ci=4
28 #-st
29 -se
30 -vt=2
31 -cti=0
32 -pt=1
33 -bt=1
34 -sbt=1
35 -bbt=1
36 -nsfs
37 -nolq
38 -wbb="% + - * / x != == >= <= =~ !~ < > | & >= < = **= += *= &= <<= &&= -= /= |= >>= ||= .= %= ^= x="
39 EOF
40 ;
41 1 my $PERLCRITIC_SAMPLE = <<'EOF'
42 severity = 3
43 verbose = 6
44 top = 50
45 theme = pbp || core || bugs || security || maintenance
46 criticism-fatal = 1
47 color = 1
48 allow-unsafe = 1
49 EOF
50 ;
51  
52 0 ▶sub before_build {
Subroutine before_build: not called CC=6 SCAR=37.4
Pod documented
53 0 my $self = shift;
54 0 ▶ unless ( -d 'xt' ) {
Branch: 1 branch
BranchTrueFalseTotal
unless (-d "xt") 0 0 0
55 0 mkdir('xt');
56 }
57 0 ▶ unless ( -e 'xt/perltidy.rc' ) {
Branch: 1 branch
BranchTrueFalseTotal
unless (-e "xt/perltidy.rc") 0 0 0
58 0 ▶ if ( open my $f, '>', 'xt/perltidy.rc' ) {
Branch: 1 branch
BranchTrueFalseTotal
if (open my $f, ">", "xt/perltidy.rc") 0 0 0
59 0 print $f $PERLTIDY_SAMPLE;
60 0 close $f;
61 }
62 }
63 0 ▶ unless ( -e 'xt/perlcritic.rc' ) {
Branch: 1 branch
BranchTrueFalseTotal
unless (-e "xt/perlcritic.rc") 0 0 0
64 0 ▶ if ( open my $f, '>', 'xt/perlcritic.rc' ) {
Branch: 1 branch
BranchTrueFalseTotal
if (open my $f, ">", "xt/perlcritic.rc") 0 0 0
65 0 print $f $PERLCRITIC_SAMPLE;
66 0 close $f;
67 }
68 }
69 0 return;
70 }
71  
72 0 ▶sub configure {
Subroutine configure: not called CC=1 SCAR=6.9
Pod documented
73 0 my $self = shift;
74  
75 #init some file like perltidy and perlcritic rc files
76 0 $self->before_build;
77  
78 #git files
79 0 my @git_files = qw/Changes dist.ini README.mkdn/;
80  
81 0 $self->add_plugins(
82 [ 'Git::NextVersion' => { first_version => '0.01' } ] );
83 0 $self->add_plugins('NextRelease');
84 0 $self->add_bundle( 'Git' =>
85 { 'allow_dirty' => \@git_files, 'add_files_in' => \@git_files } );
86 0 $self->add_bundle( 'Filter',
87 { bundle => '@Basic', remove => ['MakeMaker'] } );
88 0 $self->add_plugins(
89 'ModuleBuild',
90 'ReportVersions',
91 'OurPkgVersion',
92 [ 'Prepender' => { copyright => 1 } ],
93 'AutoPrereqs',
94 'Prereqs',
95 'MinimumPerl',
96 'Test::Compile',
97 'CheckChangeLog',
98 'Test::UnusedVars',
99 'PodCoverageTests',
100 'PruneFiles',
101 'ReadmeMarkdownFromPod',
102 'MetaJSON',
103 [ 'MetaResourcesFromGit' =>
104 { 'bugtracker.web' => 'https://github.com/%a/%r/issues' }
105 ],
106 'MetaConfig',
107 [ 'PodWeaver' => { 'config_plugin' => '@Celogeek' } ],
108 [ 'Run::BeforeRelease' => { run => 'cp %d%pREADME.mkdn .' } ],
109 [ 'PerlTidy' => { 'perltidyrc' => 'xt/perltidy.rc' } ],
110 [ 'Test::Perl::Critic' => { 'critic_config' => 'xt/perlcritic.rc' } ],
111 );
112  
113 0 return;
114 }
115  
116 1 1;
117  
118 __END__
↑ Summary Pod/Weaver/PluginBundle/Celogeek.pm »