File Coverage

blib/lib/Apache/Voodoo/Table/Probe.pm
Criterion Covered Total %
statement 9 19 47.3
branch 0 2 0.0
condition n/a
subroutine 3 4 75.0
pod 0 1 0.0
total 12 26 46.1


line stmt bran cond sub pod time code
1             package Apache::Voodoo::Table::Probe;
2              
3             $VERSION = "3.0200";
4              
5 2     2   3137 use strict;
  2         6  
  2         85  
6 2     2   10 use warnings;
  2         4  
  2         64  
7              
8 2     2   14 use DBI;
  2         4  
  2         388  
9              
10             sub new {
11 0     0 0   my $class = shift;
12 0           my $dbh = shift;
13              
14             # From the DBI docs. This will give use the database server name
15 0           my $db_type = $dbh->get_info(17);
16              
17 0           my $obj = "Apache::Voodoo::Table::Probe::$db_type";
18 0           my $file = "Apache/Voodoo/Table/Probe/$db_type.pm";
19              
20 0           eval {
21 0           require $file;
22             };
23 0 0         if ($@) {
24 0           die "$db_type isn't supported\n$@\n";
25             }
26              
27 0           return $obj->new($dbh);
28             }
29              
30             1;
31              
32             ################################################################################
33             # Copyright (c) 2005-2010 Steven Edwards (maverick@smurfbane.org).
34             # All rights reserved.
35             #
36             # You may use and distribute Apache::Voodoo under the terms described in the
37             # LICENSE file include in this package. The summary is it's a legalese version
38             # of the Artistic License :)
39             #
40             ################################################################################