File Coverage

blib/lib/Rex/Interface/Connection.pm
Criterion Covered Total %
statement 14 16 87.5
branch 2 4 50.0
condition n/a
subroutine 4 4 100.0
pod 0 1 0.0
total 20 25 80.0


line stmt bran cond sub pod time code
1             #
2             # (c) Jan Gehring
3             #
4              
5             package Rex::Interface::Connection;
6              
7 135     135   1555 use v5.12.5;
  135         419  
8 135     108   995 use warnings;
  108         319  
  108         15419  
9              
10             our $VERSION = '1.14.3'; # VERSION
11              
12             sub create {
13 112     106 0 840 my ( $class, $type ) = @_;
14              
15 106 50       652 unless ($type) {
16 0         0 $type = Rex::Config->get_connection_type();
17             }
18              
19 106         581 my $class_name = "Rex::Interface::Connection::$type";
20 106     67   10513 eval "use $class_name;";
  67         1189  
  67         344  
  67         742  
21 106 50       2300 if ($@) { die("Error loading connection interface $type.\n$@"); }
  0         0  
22              
23 106         702 return $class_name->new;
24             }
25              
26             1;