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.1630910';
4              
5 18     18   89 use Moose;
  18         27  
  18         117  
6 18     18   126751 use Regexp::Common qw /URI/;
  18         51790  
  18         91  
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 18     18   516743 no Moose;
  18         40  
  18         219  
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.1630910
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