blib/lib/Code/TidyAll/Role/GenericExecutable.pm

filter: Statementstmt 100% 35 / 35 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 9 / 9 Podpod n/a totaltotal 97.8% 45 / 46 CC 2 SCAR 1.8
CC
2
Cov
97%
_run_generic_executable_or_die
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.2
« blib/lib/Code/TidyAll/Util.pm ↑ Summary lib/Code/TidyAll/Role/HasIgnore.pm »
1 package Code::TidyAll::Role::GenericExecutable;
2  
3 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 2 ▶use IPC::Run3 qw(run3);
Subroutine BEGIN: called CC=1 SCAR=0.0
7 2 ▶use Specio::Library::Builtins;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 2 ▶use Specio::Library::String;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 2 ▶use Text::ParseWords qw(shellwords);
Subroutine BEGIN: called CC=1 SCAR=0.0
10 2 ▶use Try::Tiny;
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 2 ▶use Moo::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 2 with 'Code::TidyAll::Role::RunsCommand';
15  
16 2 our $VERSION = '0.85';
17  
18 2 has 'cmd' => (
19 is => 'ro',
20 required => 1,
21 );
22  
23 2 has file_flag => (
24 is => 'ro',
25 isa => t('NonEmptyStr'),
26 predicate => '_has_file_flag',
27 );
28  
29 9 ▶sub _run_generic_executable_or_die {
Subroutine _run_generic_executable_or_die: called CC=2 SCAR=7.0
30 9 my $self = shift;
31 9 my $file = shift;
32  
33 9 my @argv;
34 9 ▶ push @argv, $self->file_flag if $self->_has_file_flag;
Branch: 1 branch
BranchTrueFalseTotal
if $self->_has_file_flag 0 9 9
35 9 push @argv, $file;
36  
37 9 return $self->_run_or_die(@argv);
38 }
39  
40 2 1;
41  
42 # ABSTRACT: A role for plugins which allow you to use any executable as a transformer or validator
43  
44 __END__
« blib/lib/Code/TidyAll/Util.pm ↑ Summary lib/Code/TidyAll/Role/HasIgnore.pm »