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   1241 use v5.12.5;
  105         366  
8 105     105   603 use warnings;
  105         271  
  105         5100  
9              
10             our $VERSION = '1.14.2.3'; # TRIAL VERSION
11              
12 105     105   27483 use English qw(-no_match_vars);
  105         178738  
  105         867  
13              
14             require File::Spec::Unix;
15             require File::Spec::Win32;
16              
17             sub AUTOLOAD { ## no critic (ProhibitAutoloading)
18 3380     3380   15208 my ( $self, @args ) = @_;
19              
20 3380         40585 ( my $method ) = our $AUTOLOAD =~ /::(\w+)$/msx;
21              
22 3380         12903 my $file_spec_flavor = 'File::Spec::Unix';
23              
24 3380 50 33     17503 if ( $OSNAME eq 'MSWin32' && !Rex::is_ssh() ) {
25 0         0 $file_spec_flavor = 'File::Spec::Win32';
26             }
27              
28 3380         121564 return $file_spec_flavor->$method(@args);
29             }
30              
31             1;