| 1 | 4 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 2 | 4 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 3 | |||||||||||||||||||||||||||||
| 4 | package Footprintless::Resource::Provider; | ||||||||||||||||||||||||||||
| 5 | 4 | $Footprintless::Resource::Provider::VERSION = '1.29'; | |||||||||||||||||||||||||||
| 6 | # ABSTRACT: A contract for providing resources to the resource manager | ||||||||||||||||||||||||||||
| 7 | # PODNAME: Footprintless::Resource::Provider | ||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||
| 9 | 4 | ▶ | use parent qw(Footprintless::MixableBase); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 10 | |||||||||||||||||||||||||||||
| 11 | 4 | ▶ | use Carp; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 12 | 4 | ▶ | use Footprintless::Util qw( | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 13 | temp_file | ||||||||||||||||||||||||||||
| 14 | 4 | ); | |||||||||||||||||||||||||||
| 15 | 4 | ▶ | use Log::Any; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 16 | |||||||||||||||||||||||||||||
| 17 | 4 | my $logger = Log::Any->get_logger(); | |||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||
| 19 | 20 | ▶ | sub download { | ||||||||||||||||||||||||||
|
Subroutine
download: called CC=4 SCAR=14.5
Pod
documented
| |||||||||||||||||||||||||||||
| 20 | 20 | my ( $self, $resource, @options ) = @_; | |||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||
| 22 | 20 | my $ref = ref($resource); | |||||||||||||||||||||||||||
| 23 | 20 | ▶ | $resource = $self->resource($resource) if ( !$ref || $ref eq 'HASH' ); | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
not $ref or $ref eq "HASH"
MC/DC0%0/2
not $ref or $ref eq "HASH"
not $ref
$ref eq "HASH"
Truth table66%2/3
not(A) or B
A= not $refB= $ref eq "HASH"
| |||||||||||||||||||||||||||||
| 24 | |||||||||||||||||||||||||||||
| 25 | 20 | ▶ | croak("invalid resource [$resource]") | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 26 | unless ( $resource->isa('Footprintless::Resource') ); | ||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||
| 28 | 20 | return $self->_download( $resource, @options ); | |||||||||||||||||||||||||||
| 29 | } | ||||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||
| 31 | 0 | ▶ | sub _download { | ||||||||||||||||||||||||||
|
Subroutine
_download: not called CC=1 SCAR=6.9
| |||||||||||||||||||||||||||||
| 32 | 0 | my ( $self, $resource, @options ) = @_; | |||||||||||||||||||||||||||
| 33 | 0 | croak( __PACKAGE__ . " does not support [$resource]" ); | |||||||||||||||||||||||||||
| 34 | } | ||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||
| 36 | 0 | ▶ | sub resource { | ||||||||||||||||||||||||||
|
Subroutine
resource: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 37 | 0 | my ( $self, $spec ) = @_; | |||||||||||||||||||||||||||
| 38 | 0 | croak( __PACKAGE__ . " does not support [$spec]" ); | |||||||||||||||||||||||||||
| 39 | } | ||||||||||||||||||||||||||||
| 40 | |||||||||||||||||||||||||||||
| 41 | 0 | ▶ | sub supports { | ||||||||||||||||||||||||||
|
Subroutine
supports: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||||||||||
| 42 | 0 | my ( $self, $spec ) = @_; | |||||||||||||||||||||||||||
| 43 | 0 | return 0; | |||||||||||||||||||||||||||
| 44 | } | ||||||||||||||||||||||||||||
| 45 | |||||||||||||||||||||||||||||
| 46 | 4 | 1; | |||||||||||||||||||||||||||
| 47 | |||||||||||||||||||||||||||||
| 48 | __END__ | ||||||||||||||||||||||||||||