File Coverage

blib/lib/Metabase/Resource/cpan.pm
Criterion Covered Total %
statement 19 19 100.0
branch 1 2 50.0
condition 1 3 33.3
subroutine 6 6 100.0
pod n/a
total 27 30 90.0


line stmt bran cond sub pod time code
1 6     6   120 use 5.006;
  6         23  
  6         238  
2 6     6   44 use strict;
  6         10  
  6         205  
3 6     6   32 use warnings;
  6         10  
  6         311  
4              
5             package Metabase::Resource::cpan;
6             our $VERSION = '0.024'; # VERSION
7              
8 6     6   31 use Carp ();
  6         11  
  6         144  
9              
10 6     6   30 use Metabase::Resource;
  6         12  
  6         1075  
11             our @ISA = qw/Metabase::Resource/;
12              
13             sub _extract_type {
14 34     34   52 my ( $self, $resource ) = @_;
15 34         142 my ($type) = $resource =~ m{\Acpan:///([^/]+)/};
16 34 50 33     290 Carp::confess("could not determine Metabase::Resource type from '$resource'\n")
17             unless defined $type && length $type;
18 34         125 return __PACKAGE__ . "::$type";
19             }
20              
21             1;
22              
23             # ABSTRACT: class for Metabase resources
24              
25             __END__