File Coverage

blib/lib/Footprintless/CommandRunner/IPCRun3.pm
Criterion Covered Total %
statement 26 26 100.0
branch n/a
condition n/a
subroutine 8 8 100.0
pod n/a
total 34 34 100.0


line stmt bran cond sub pod time code
1 1     1   602 use strict;
  1         2  
  1         25  
2 1     1   4 use warnings;
  1         2  
  1         38  
3              
4             package Footprintless::CommandRunner::IPCRun3;
5             $Footprintless::CommandRunner::IPCRun3::VERSION = '1.29';
6             # ABSTRACT: An implementation of Footprintless::CommandRunner using IPC::Run3
7             # PODNAME: Footprintless::CommandRunner::IPCRun3
8              
9 1     1   350 use parent qw(Footprintless::CommandRunner);
  1         256  
  1         5  
10              
11 1     1   42 use Carp;
  1         2  
  1         46  
12 1     1   485 use IPC::Run3;
  1         46271  
  1         68  
13 1     1   10 use Log::Any;
  1         2  
  1         7  
14              
15             my $logger = Log::Any->get_logger();
16              
17             sub _run3_options {
18 3     3   8 my ( $self, $runner_options ) = @_;
19              
20 3         8 my $in = \undef;
21 3         8 my $out = \$self->{last_call}{stdout};
22 3         6 my $err = \$self->{last_call}{stderr};
23              
24 3         15 return ( $in, $out, $err );
25             }
26              
27             sub _run {
28 3     3   7 my ( $self, $command, $runner_options ) = @_;
29 3         17 run3( $command, $self->_run3_options($runner_options) );
30 3         17914 return $? >> 8;
31             }
32              
33             1;
34              
35             __END__