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   26 use strict;
  4         8  
  4         95  
2 4     4   15 use warnings;
  4         6  
  4         154  
3              
4             package Footprintless::Resource::Url;
5             $Footprintless::Resource::Url::VERSION = '1.28';
6             # ABSTRACT: A resource described by URL
7             # PODNAME: Footprintless::Resource::Url
8              
9 4     4   21 use parent qw(Footprintless::Resource);
  4         9  
  4         16  
10              
11             sub get_uri {
12 25     25 1 115 return $_[0]->{uri};
13             }
14              
15             sub _init {
16 22     22   46 my ( $self, $url ) = @_;
17              
18 22         127 $self->{uri} = URI->new($url);
19             $self->{uri} = $self->{uri}->abs('file://')
20 22 100       17655 unless ( $self->{uri}->has_recognized_scheme() );
21              
22 22         7408 $self->Footprintless::Resource::_init( $self->{uri}->as_string() );
23              
24 22         63 return $self;
25             }
26              
27             1;
28              
29             __END__