Remote/Connector/STDIO.pm

filter: Statementstmt 0.0% 0 / 8 Branchbran 0.0% 0 / 12 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 1 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 22 CC 7 SCAR 40.3
CC
7
Cov
0%
connect
56.0
CRAP 56.0
↑ Summary Remote/Connector/LocalSudo.pm »
1 package Object::Remote::Connector::STDIO;
2  
3 use File::Spec;
4 use IO::Handle;
5 use Object::Remote::Connection;
6 use Object::Remote::ReadChannel;
7 use Moo;
8  
9 sub connect {
10 0 ▶ open my $stdin, '<&', \*STDIN or die "Duping stdin: $!";
Subroutine connect: not called CC=7 SCAR=40.3
Pod undocumented
Branch: 1 branch
BranchTrueFalseTotal
open my $stdin, "<&", \*STDIN or die "Duping stdin: $!" 0 0 0
11 0 ▶ open my $stdout, '>&', \*STDOUT or die "Duping stdout: $!";
Branch: 1 branch
BranchTrueFalseTotal
open my $stdout, ">&", \*STDOUT or die "Duping stdout: $!" 0 0 0
12 0 $stdout->autoflush(1);
13 # if we don't re-open them then 0 and 1 get re-used - which is not
14 # only potentially bloody confusing but results in warnings like:
15 # "Filehandle STDOUT reopened as STDIN only for input"
16 0 ▶ close STDIN or die "Closing stdin: $!";
Branch: 1 branch
BranchTrueFalseTotal
close STDIN or die "Closing stdin: $!" 0 0 0
17 0 ▶ open STDIN, '<', File::Spec->devnull or die "Re-opening stdin: $!";
Branch: 1 branch
BranchTrueFalseTotal
open STDIN, "<", "File::Spec"->devnull or die "Re-opening stdin: $!" 0 0 0
18 0 ▶ close STDOUT or die "Closing stdout: $!";
Branch: 1 branch
BranchTrueFalseTotal
close STDOUT or die "Closing stdout: $!" 0 0 0
19 0 ▶ open STDOUT, '>', File::Spec->devnull or die "Re-opening stdout: $!";
Branch: 1 branch
BranchTrueFalseTotal
open STDOUT, ">", "File::Spec"->devnull or die "Re-opening stdout: $!" 0 0 0
20 0 return Object::Remote::Connection->new(
21 send_to_fh => $stdout,
22 read_channel => Object::Remote::ReadChannel->new(fh => $stdin)
23 );
24 }
25  
26 1;
↑ Summary Remote/Connector/LocalSudo.pm »