File/Slurp/Remote.pm

filter: Statementstmt 68.2% 28 / 41 Branchbran 0.0% 0 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 77.7% 7 / 9 Podpod 0.0% 0 / 2 totaltotal 60.3% 35 / 58 CC 4 SCAR 15.2
CC
4
Cov
60%
write_remote_file
12.0
read_remote_file
6.0
BEGIN
1.0
CRAP 4.6
« File/Slurp/Remote/BrokenDNS.pm ↑ Summary File/Slurp/Remote/CanonicalHostnames.pm »
1 package File::Slurp::Remote;
2  
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 1 ▶use File::Slurp;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 require Exporter;
7 1 ▶use File::Slurp::Remote::BrokenDNS qw($myfqdn %fqdnify);
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶use Tie::Function::Examples qw(%q_shell);
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 ▶use File::Slurp::Remote::SmartOpen;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 1 ▶use File::Temp qw(tempdir);
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 1 our @ISA = qw(Exporter);
13 1 our @EXPORT = (@File::Slurp::EXPORT, qw(write_remote_file read_remote_file));
14  
15 1 our $VERSION = 0.47;
16  
17 1 my $tmpdir = tempdir(CLEANUP => 1);
18  
19 1 our $scp = "scp -q -o StrictHostKeyChecking=no -o BatchMode=yes -o PasswordAuthentication=no";
20  
21 sub write_remote_file
22 0 ▶{
Subroutine write_remote_file: not called CC=3 SCAR=24.8
Pod undocumented
23 0 my $host = shift;
24 0 my $file = shift;
25  
26 0 my $fd;
27 0 smartopen("$host:$file", $fd, "w");
28 0 ▶ (print $fd @_) or die "write to $host:$file: $!";
Branch: 1 branch
BranchTrueFalseTotal
print $fd @_ or die "write to ${host}:${file}: $!" 0 0 0
29 0 ▶ close($fd) or die "close $host:$file: $!";
Branch: 1 branch
BranchTrueFalseTotal
close $fd or die "close ${host}:${file}: $!" 0 0 0
30 }
31  
32 sub read_remote_file
33 0 ▶{
Subroutine read_remote_file: not called CC=2 SCAR=17.9
Pod undocumented
34 0 my $host = shift;
35 0 my $file = shift;
36  
37 0 my $fd;
38 0 smartopen("$host:$file", $fd, "r");
39 0 ▶ if (wantarray) {
Branch: 1 branch
BranchTrueFalseTotal
if (wantarray) { } 0 0 0
40 0 return <$fd>;
41 } else {
42 0 return join('', <$fd>);
43 }
44 }
45  
46 1 1;
47  
48 __END__
« File/Slurp/Remote/BrokenDNS.pm ↑ Summary File/Slurp/Remote/CanonicalHostnames.pm »