File Coverage

blib/lib/Metabase/Resource/perl.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 1     1   16 use 5.006;
  1         2  
2 1     1   4 use strict;
  1         1  
  1         16  
3 1     1   2 use warnings;
  1         2  
  1         40  
4              
5             package Metabase::Resource::perl;
6              
7             our $VERSION = '0.025';
8              
9 1     1   3 use Carp ();
  1         1  
  1         12  
10              
11 1     1   2 use Metabase::Resource;
  1         1  
  1         151  
12             our @ISA = qw/Metabase::Resource/;
13              
14             sub _extract_type {
15 1     1   2 my ( $self, $resource ) = @_;
16              
17             # determine type
18             # Possible types could be:
19             # - commit
20             # - tag -- not implemented
21             # - tarball -- not implemented
22 1         3 my ($type) = $resource =~ m{\Aperl:///([^/]+)/};
23 1 50 33     5 Carp::confess("could not determine Metabase::Resource type from '$resource'\n")
24             unless defined $type && length $type;
25 1         3 return __PACKAGE__ . "::$type";
26             }
27              
28             1;
29              
30             # ABSTRACT: class for Metabase resources under the perl scheme
31              
32             __END__