File Coverage

blib/lib/POSIX/Run/Capture.pm
Criterion Covered Total %
statement 20 21 95.2
branch n/a
condition n/a
subroutine 7 8 87.5
pod 3 3 100.0
total 30 32 93.7


line stmt bran cond sub pod time code
1             package POSIX::Run::Capture;
2              
3 12     12   636236 use 5.016001;
  12         50  
4 12     12   74 use strict;
  12         21  
  12         522  
5 12     12   65 use warnings;
  12         22  
  12         2720  
6              
7             require Exporter;
8              
9             our @ISA = qw(Exporter);
10              
11             # Items to export into callers namespace by default. Note: do not export
12             # names by default without a very good reason. Use EXPORT_OK instead.
13             # Do not simply export all your public functions/methods/constants.
14              
15             # This allows declaration use POSIX::Run::Capture ':all';
16             # If you do not need this, moving things directly into @EXPORT or @EXPORT_OK
17             # will save memory.
18             our %EXPORT_TAGS = ( 'all' => [ qw(
19             SD_STDOUT
20             SD_STDERR
21             ) ],
22             'std' => [ qw(
23             SD_STDOUT
24             SD_STDERR
25             ) ] );
26              
27             our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
28              
29             #our @EXPORT = qw();
30              
31             our $VERSION = '1.05';
32              
33             require XSLoader;
34             XSLoader::load('POSIX::Run::Capture', $VERSION);
35              
36             use constant {
37 12         4035 SD_STDOUT => 1,
38             SD_STDERR => 2
39 12     12   98 };
  12     0   38  
40              
41             # Preloaded methods go here.
42             sub get_lines {
43 0     6 1 0 my ($self, $fd) = @_;
44 6         1300683 my @lines;
45              
46 6         46 $self->rewind($fd);
47 6         77 while (my $s = $self->next_line($fd)) {
48 6         206 push @lines, $s;
49             }
50 233         1984 return \@lines;
51             }
52              
53             sub set_argv {
54 6     3 1 75 my $self = shift;
55 3         405139 $self->set_argv_ref([@_]);
56             }
57              
58             sub set_env {
59 3     2 1 23 my $self = shift;
60 2         385435 $self->set_env_ref([@_]);
61             }
62              
63             1;
64             __END__