lib/Dist/Zilla/Plugin/CSJEWELL/ReleaseStatusFromMetaJSON.pm

filter: Statementstmt 55.5% 15 / 27 Branchbran 0.0% 0 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 80.0% 4 / 5 Podpod 0.0% 0 / 1 totaltotal 48.7% 19 / 39 CC 4 SCAR 23.5
CC
4
Cov
45%
provide_release_status
20.0
BEGIN
1.0
BEGIN
1.0
CRAP 10.5
« lib/Dist/Zilla/PluginBundle/Author/CSJEWELL.pm ↑ Summary lib/Dist/Zilla/MintingProfile/CSJEWELL.pm »
1 package Dist::Zilla::Plugin::CSJEWELL::ReleaseStatusFromMetaJSON;
2  
3 1 our $VERSION = v0.001;
4  
5 1 ▶use v5.10;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use JSON::MaybeXS qw();
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 with 'Dist::Zilla::Role::ReleaseStatusProvider';
9  
10 0 ▶sub provide_release_status {
Subroutine provide_release_status: not called CC=4 SCAR=30.0
Pod undocumented
11 0 my ($self) = @_;
12 0 my ($file) = grep { $_->name eq 'META.json' } @{ $self->zilla->files };
13 0 my $ref = JSON::MaybeXS->new()->utf8->decode($file->encoded_content);
14  
15 0 my $status = $ref->{'release_status'};
16 0 ▶ return $status unless $status;
Branch: 1 branch
BranchTrueFalseTotal
unless $status 0 0 0
17 0 ▶ if ($status eq 'unstable') {
Branch: 2 branches
BranchTrueFalseTotal
if ($status eq 'unstable') { } 0 0 0
elsif ($status eq 'testing') { } 0 0 0
18 0 $self->log(['Releasing an unstable version']);
19 } elsif ($status eq 'testing') {
20 0 $self->log(['Releasing a testing version']);
21 } else {
22 0 $self->log(['Releasing a stable version']);
23 }
24  
25 0 return $status;
26 } ## end sub provide_release_status
27  
28 1 __PACKAGE__->meta->make_immutable;
29 1 ▶no Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
30  
31 1 1;
32  
33 __END__
« lib/Dist/Zilla/PluginBundle/Author/CSJEWELL.pm ↑ Summary lib/Dist/Zilla/MintingProfile/CSJEWELL.pm »