File Coverage

lib/Measure/Everything/Adapter.pm
Criterion Covered Total %
statement 9 15 60.0
branch 0 2 0.0
condition n/a
subroutine 3 4 75.0
pod 0 1 0.0
total 12 22 54.5


line stmt bran cond sub pod time code
1             package Measure::Everything::Adapter;
2 1     1   4628 use strict;
  1         2  
  1         22  
3 1     1   3 use warnings;
  1         1  
  1         21  
4 1     1   4 use Module::Runtime qw(use_module);
  1         1  
  1         5  
5              
6             # ABSTRACT: Tell Measure::Everything where to send the stats
7              
8             sub set {
9 0     0 0   my ($self, $adapter, @args) = @_;
10              
11 0           my $module_name;
12 0 0         if ( $adapter =~ s/^\+// ) {
13 0           $module_name = $adapter;
14             } else {
15 0           $module_name = 'Measure::Everything::Adapter::'.$adapter;
16             }
17              
18 0           $Measure::Everything::global_stats = use_module($module_name)->new(@args);
19             }
20              
21             1;
22              
23             __END__