File Coverage

blib/lib/Footprintless/Resource/Url.pm
Criterion Covered Total %
statement 15 15 100.0
branch 2 2 100.0
condition n/a
subroutine 5 5 100.0
pod 1 1 100.0
total 23 23 100.0


line stmt bran cond sub pod time code
1 4     4   22 use strict;
  4         12  
  4         101  
2 4     4   19 use warnings;
  4         9  
  4         179  
3              
4             package Footprintless::Resource::Url;
5             $Footprintless::Resource::Url::VERSION = '1.26';
6             # ABSTRACT: A resource described by URL
7             # PODNAME: Footprintless::Resource::Url
8              
9 4     4   23 use parent qw(Footprintless::Resource);
  4         8  
  4         21  
10              
11             sub get_uri {
12 25     25 1 159 return $_[0]->{uri};
13             }
14              
15             sub _init {
16 22     22   62 my ( $self, $url ) = @_;
17              
18 22         126 $self->{uri} = URI->new($url);
19             $self->{uri} = $self->{uri}->abs('file://')
20 22 100       16855 unless ( $self->{uri}->has_recognized_scheme() );
21              
22 22         8314 $self->Footprintless::Resource::_init( $self->{uri}->as_string() );
23              
24 22         107 return $self;
25             }
26              
27             1;
28              
29             __END__