File Coverage

blib/lib/Rex/Helper/File/Spec.pm
Criterion Covered Total %
statement 13 14 92.8
branch 1 2 50.0
condition 1 3 33.3
subroutine 4 4 100.0
pod n/a
total 19 23 82.6


line stmt bran cond sub pod time code
1             #
2             # (c) Jan Gehring
3             #
4              
5             package Rex::Helper::File::Spec;
6              
7 105     105   1256 use v5.12.5;
  105         364  
8 105     105   569 use warnings;
  105         293  
  105         5447  
9              
10             our $VERSION = '1.14.2.2'; # TRIAL VERSION
11              
12 105     105   28218 use English qw(-no_match_vars);
  105         184601  
  105         903  
13              
14             require File::Spec::Unix;
15             require File::Spec::Win32;
16              
17             sub AUTOLOAD { ## no critic (ProhibitAutoloading)
18 3383     3383   17107 my ( $self, @args ) = @_;
19              
20 3383         43535 ( my $method ) = our $AUTOLOAD =~ /::(\w+)$/msx;
21              
22 3383         13220 my $file_spec_flavor = 'File::Spec::Unix';
23              
24 3383 50 33     19494 if ( $OSNAME eq 'MSWin32' && !Rex::is_ssh() ) {
25 0         0 $file_spec_flavor = 'File::Spec::Win32';
26             }
27              
28 3383         128574 return $file_spec_flavor->$method(@args);
29             }
30              
31             1;