blib/lib/Dist/Zilla/PluginBundle/CHGOVUK.pm

filter: Statementstmt 35.2% 6 / 17 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 50.0% 2 / 4 Podpod n/a totaltotal 32.0% 8 / 25 CC 3 SCAR 14.7
CC
3
Cov
29%
build_file
6.0
configure
6.0
BEGIN
1.0
CRAP 4.3
↑ Summary
1 package Dist::Zilla::PluginBundle::CHGOVUK;
2  
3 our $VERSION = '0.07';
4  
5 1 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 with 'Dist::Zilla::Role::PluginBundle::Easy',
7 'Dist::Zilla::Role::PluginBundle::Config::Slicer';
8  
9 1 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 has installer => (
12 is => 'ro',
13 isa => 'Str',
14 lazy => 1,
15 default => sub { $_[0]->payload->{installer} || 'ModuleBuild' },
16 );
17  
18 has prereqs => (
19 is => 'ro',
20 isa => 'Str',
21 lazy => 1,
22 default => sub { $_[0]->payload->{prereqs} || 'Prereqs::FromCPANfile' },
23 );
24  
25 0 ▶sub build_file {
Subroutine build_file: not called CC=2 SCAR=17.9
26 0 my $self = shift;
27 0 ▶ $self->installer =~ /MakeMaker/ ? 'Makefile.PL' : 'Build.PL';
Branch: 1 branch
BranchTrueFalseTotal
$self->installer =~ /MakeMaker/ ? : 0 0 0
28 }
29  
30 0 ▶sub configure {
Subroutine configure: not called CC=2 SCAR=17.9
31 0 my $self = shift;
32  
33 0 my @accepts = qw( MakeMaker MakeMaker::IncShareDir ModuleBuild ModuleBuildTiny );
34 0 my %accepts = map { $_ => 1 } @accepts;
35  
36 0 ▶ unless ($accepts{$self->installer}) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($accepts{$self->installer}) 0 0 0
37 0 die sprintf("Unknown installer: '%s'. " .
38 "Acceptable values are MakeMaker, ModuleBuild and ModuleBuildTiny\n",
39 $self->installer);
40 }
41  
42 0 my @dirty_files = ('dist.ini', 'Changes', 'META.json', 'README.md', $self->build_file);
43 0 my @exclude_release = ('README.md');
44  
45 0 $self->add_plugins(
46 [ 'NameFromDirectory' ],
47  
48 # Make the git repo installable
49 [ 'Git::GatherDir', { exclude_filename => [ $self->build_file, 'META.json', 'LICENSE', @exclude_release ] } ],
50 [ 'CopyFilesFromBuild', { copy => [ 'LICENSE' ] } ],
51  
52 # should be after GatherDir
53 # Equivalent to Module::Install's version_from, license_from and author_from
54 [ 'VersionFromModule' ],
55 #[ 'LicenseFromModule', { override_author => 1 } ],
56  
57 # after ReversionOnRelease for munge_files, before Git::Commit for after_release
58 [ 'NextRelease', { format => '%-v %{yyyy-MM-dd}d' } ],
59  
60 [ 'Git::Check', { allow_dirty => \@dirty_files } ],
61  
62 # Make Github center and front
63 [ 'GithubMeta', { issues => 1 } ],
64 [ 'ReadmeAnyFromPod', { type => 'markdown', filename => 'README.md', location => 'root' } ],
65  
66 # Set no_index to sensible directories
67 [ 'MetaNoIndex', { directory => [ qw( t xt inc share eg examples ) ] } ],
68  
69 [ $self->prereqs ],
70 [ $self->installer ],
71 [ 'MetaJSON' ],
72  
73 # standard stuff
74 [ 'PodSyntaxTests' ],
75 [ 'MetaYAML' ],
76 [ 'License' ],
77 [ 'ReadmeFromPod' ],
78 [ 'ExtraTests' ],
79 [ 'ExecDir', { dir => 'script' } ],
80 [ 'ShareDir' ],
81 [ 'Manifest' ],
82 [ 'ManifestSkip' ],
83  
84 [ 'CheckChangesHasContent' ],
85 [ 'TestRelease' ],
86 [ 'FakeRelease' ],
87  
88 [ 'Git::Commit', {
89 commit_msg => '%v',
90 allow_dirty => \@dirty_files,
91 allow_dirty_match => '\.pm$', # .pm files copied back from Release
92 } ],
93 [ 'Git::CommitBuild', { release_branch => 'releases', release_message => '%v %h' } ],
94 [ 'Git::Tag', { tag_format => '%v', tag_message => '' } ],
95 [ 'Git::Push', { remotes_must_exist => 0 } ],
96  
97 );
98 }
99  
100 __PACKAGE__->meta->make_immutable;
101 1;
102  
103 __END__
↑ Summary