File Coverage

blib/lib/ORDB/CPANTS.pm
Criterion Covered Total %
statement 18 24 75.0
branch 0 2 0.0
condition 0 6 0.0
subroutine 6 7 85.7
pod n/a
total 24 39 61.5


line stmt bran cond sub pod time code
1             package ORDB::CPANTS;
2              
3 1     1   2438 use 5.008005;
  1         4  
  1         37  
4 1     1   7 use strict;
  1         1  
  1         35  
5 1     1   17 use warnings;
  1         2  
  1         33  
6 1     1   1148 use Params::Util 0.38 ();
  1         3837  
  1         27  
7 1     1   1020 use ORLite 1.52 ();
  1         39966  
  1         33  
8 1     1   957 use ORLite::Mirror 1.22 ();
  1         106232  
  1         134  
9              
10             our $VERSION = '0.05';
11              
12             sub import {
13 0     0     my $class = shift;
14 0   0       my $params = Params::Util::_HASH(shift) || {};
15              
16             # Pass through any params from above
17             #$params->{url} ||= 'http://cpants.perl.org/static/cpants_all.db.gz';
18 0   0       $params->{url} ||= 'http://cpants.charsbar.org/static/cpants_all.db.gz';
19 0   0       $params->{maxage} ||= 7 * 24 * 60 * 60; # One week
20              
21             # Prevent double-initialisation
22 0 0         $class->can('orlite') or
23             ORLite::Mirror->import( $params );
24              
25 0           return 1;
26             }
27              
28             1;
29              
30             __END__