blib/lib/OPP/Proc/Exec.pm

filter: Statementstmt 54.5% 12 / 22 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 75.0% 3 / 4 Podpod 0.0% 0 / 1 totaltotal 51.7% 15 / 29 CC 2 SCAR 11.0
CC
2
Cov
50%
process
6.0
BEGIN
1.0
BEGIN
1.0
CRAP 3.0
« Build ↑ Summary blib/lib/OPP/State.pm »
1 #
2 # $Id: Exec.pm,v 17cc8d9dc427 2023/03/07 06:24:43 gomor $
3 #
4 package OPP::Proc::Exec;
5 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 1 ▶use base qw(OPP::Proc);
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 __PACKAGE__->cgBuildIndices;
10  
11 1 our $VERSION = '1.00';
12  
13 #
14 # Note: script.sh will take the input doc from an input file as only argument
15 #
16 # | exec script.sh
17 #
18 sub process {
19 0 ▶ my $self = shift;
Subroutine process: not called CC=2 SCAR=17.9
Pod undocumented
20 0 my ($input) = @_;
21  
22 0 my $command = $self->options->{0};
23  
24 0 ▶ my $unflatten = $self->unflatten($input) or return;
Branch: 1 branch
BranchTrueFalseTotal
my $unflatten = $self->unflatten($input) or return 0 0 0
25 0 my $json = $self->to_json($unflatten->[0]);
26 0 $json =~ s{(?<!\\)'}{\\'}g;
27  
28 0 my $new = {};
29 0 $new->{data} = `echo '$json' | $command`;
30 0 $self->output->add($new);
31  
32 0 return 1;
33 }
34  
35 1 1;
36  
37 __END__
« Build ↑ Summary blib/lib/OPP/State.pm »