| 1 | 3 | ▶ | use 5.006; # our | ||||||||||||||||||||||||||
|
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::Zilla::Plugin::if::not::ENV; | ||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||
| 7 | 3 | our $VERSION = '0.001001'; | |||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||
| 9 | # ABSTRACT: Load a plugin when an ENV key is NOT true. | ||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||
| 11 | 3 | our $AUTHORITY = 'cpan:KENTNL'; # AUTHORITY | |||||||||||||||||||||||||||
| 12 | |||||||||||||||||||||||||||||
| 13 | 3 | ▶ | use Moose qw( has around with ); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 14 | 3 | ▶ | use Dist::Zilla::Util qw(); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 15 | 3 | with 'Dist::Zilla::Role::PluginLoader::Configurable'; | |||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||
| 17 | 3 | has key => ( is => ro =>, required => 1 ); | |||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||
| 19 | 2 | ▶ | around dump_config => sub { | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=7.0
| |||||||||||||||||||||||||||||
| 20 | 2 | my ( $orig, $self, @args ) = @_; | |||||||||||||||||||||||||||
| 21 | 2 | my $config = $self->$orig(@args); | |||||||||||||||||||||||||||
| 22 | 2 | my $localconf = $config->{ +__PACKAGE__ } = {}; | |||||||||||||||||||||||||||
| 23 | |||||||||||||||||||||||||||||
| 24 | 2 | $localconf->{key} = $self->key; | |||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||
| 26 | 2 | ▶ | $localconf->{ q[$] . __PACKAGE__ . '::VERSION' } = $VERSION | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 27 | unless __PACKAGE__ eq ref $self; | ||||||||||||||||||||||||||||
| 28 | |||||||||||||||||||||||||||||
| 29 | 2 | return $config; | |||||||||||||||||||||||||||
| 30 | 3 | }; | |||||||||||||||||||||||||||
| 31 | |||||||||||||||||||||||||||||
| 32 | 2 | ▶ | around load_plugins => sub { | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=3 SCAR=11.0
| |||||||||||||||||||||||||||||
| 33 | 2 | my ( $orig, $self, $loader ) = @_; | |||||||||||||||||||||||||||
| 34 | 2 | my $key = $self->key; | |||||||||||||||||||||||||||
| 35 | 2 | ▶ | return if exists $ENV{$key} and $ENV{$key}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
exists $ENV{$key} and $ENV{$key}
MC/DC50%1/2
exists $ENV{$key} and $ENV{$key}
exists $ENV{$key}
$ENV{$key}
Truth table66%2/3
A and B
A= exists $ENV{$key}B= $ENV{$key}
| |||||||||||||||||||||||||||||
| 36 | 1 | return $self->$orig($loader); | |||||||||||||||||||||||||||
| 37 | 3 | }; | |||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||
| 39 | 3 | __PACKAGE__->meta->make_immutable; | |||||||||||||||||||||||||||
| 40 | 3 | ▶ | no Moose; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 41 | |||||||||||||||||||||||||||||
| 42 | 3 | 1; | |||||||||||||||||||||||||||
| 43 | |||||||||||||||||||||||||||||
| 44 | __END__ | ||||||||||||||||||||||||||||