PRT/Collector/FileHandle.pm

filter: Statementstmt 100% 24 / 24 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 0.0% 0 / 2 totaltotal 93.5% 29 / 31 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« PRT/Command/ListFiles.pm ↑ Summary PRT.pm »
1 package App::PRT::Collector::FileHandle;
2 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 3 ▶use File::Temp qw(tempdir tempfile);
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 5 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
Pod undocumented
7 5 my ($class, $input_fh) = @_;
8  
9 5 bless {
10 input_fh => $input_fh,
11 }, $class;
12 }
13  
14 3 ▶sub collect {
Subroutine collect: called CC=1 SCAR=0.0
Pod undocumented
15 3 my ($self) = @_;
16  
17 3 my $input_fh = $self->{input_fh};
18 3 my $content = do { local $/; <$input_fh> };
19  
20 3 my $dir = tempdir( CLEANUP => 1 );
21  
22 3 my ($fh, $file) = tempfile('prt-XXXX', DIR => $dir, SUFFIX => '.pm');
23 3 $self->{dir} = $dir;
24 3 $self->{file} = $file;
25  
26 3 print $fh $content;
27 3 close $fh;
28  
29 3 [ $file ];
30 }
31  
32 3 1;
« PRT/Command/ListFiles.pm ↑ Summary PRT.pm »