File Coverage

blib/lib/Metabase/Resource/cpan.pm
Criterion Covered Total %
statement 18 18 100.0
branch 1 2 50.0
condition 1 3 33.3
subroutine 6 6 100.0
pod n/a
total 26 29 89.6


line stmt bran cond sub pod time code
1 6     6   82 use 5.006;
  6         15  
2 6     6   20 use strict;
  6         6  
  6         100  
3 6     6   18 use warnings;
  6         7  
  6         208  
4              
5             package Metabase::Resource::cpan;
6              
7             our $VERSION = '0.025';
8              
9 6     6   21 use Carp ();
  6         6  
  6         76  
10              
11 6     6   17 use Metabase::Resource;
  6         9  
  6         674  
12             our @ISA = qw/Metabase::Resource/;
13              
14             sub _extract_type {
15 34     34   39 my ( $self, $resource ) = @_;
16 34         150 my ($type) = $resource =~ m{\Acpan:///([^/]+)/};
17 34 50 33     132 Carp::confess("could not determine Metabase::Resource type from '$resource'\n")
18             unless defined $type && length $type;
19 34         82 return __PACKAGE__ . "::$type";
20             }
21              
22             1;
23              
24             # ABSTRACT: class for Metabase resources
25              
26             __END__