File Coverage

lib/Bio/MLST/Validate/Resource.pm
Criterion Covered Total %
statement 9 14 64.2
branch 0 6 0.0
condition n/a
subroutine 3 4 75.0
pod 0 1 0.0
total 12 25 48.0


line stmt bran cond sub pod time code
1             package Bio::MLST::Validate::Resource;
2             # ABSTRACT: Check to see if a file exists or if a uri is valid. For validation when classes have input files which may be local or on the web.
3             $Bio::MLST::Validate::Resource::VERSION = '2.1.1706216';
4              
5 17     17   60 use Moose;
  17         24  
  17         78  
6 17     17   78206 use Regexp::Common qw /URI/;
  17         31569  
  17         53  
7              
8             sub does_resource_exist
9             {
10 0     0 0   my($self, $resource) = @_;
11            
12 0 0         return 1 if($RE{URI}{FTP}->matches($resource));
13 0 0         return 1 if($RE{URI}{HTTP}->matches($resource));
14            
15 0 0         return 1 if(-e $resource);
16            
17 0           return 0;
18             }
19              
20 17     17   320975 no Moose;
  17         28  
  17         125  
21             __PACKAGE__->meta->make_immutable;
22             1;
23              
24             __END__
25              
26             =pod
27              
28             =encoding UTF-8
29              
30             =head1 NAME
31              
32             Bio::MLST::Validate::Resource - Check to see if a file exists or if a uri is valid. For validation when classes have input files which may be local or on the web.
33              
34             =head1 VERSION
35              
36             version 2.1.1706216
37              
38             =head1 SYNOPSIS
39              
40             Check to see if a file exists or if a uri is valid. For validation when classes have input files which may be local or on the web.
41              
42             =head1 METHODS
43              
44             =head2 does_file_exist
45              
46             Check to see if a file exists or if a uri is valid. For validation when classes have input files which may be local or on the web.
47              
48             =head1 AUTHOR
49              
50             Andrew J. Page <ap13@sanger.ac.uk>
51              
52             =head1 COPYRIGHT AND LICENSE
53              
54             This software is Copyright (c) 2012 by Wellcome Trust Sanger Institute.
55              
56             This is free software, licensed under:
57              
58             The GNU General Public License, Version 3, June 2007
59              
60             =cut