File Coverage

blib/lib/Catmandu/Fix/Condition/is_http_uri.pm
Criterion Covered Total %
statement 14 14 100.0
branch n/a
condition n/a
subroutine 5 5 100.0
pod 0 1 0.0
total 19 20 95.0


line stmt bran cond sub pod time code
1             package Catmandu::Fix::Condition::is_http_uri;
2              
3             our $VERSION = '0.13';
4              
5 1     1   344452 use Catmandu::Sane;
  1         7  
  1         8  
6 1     1   203 use Moo;
  1         1  
  1         5  
7 1     1   718 use Data::Validate::URI;
  1         40738  
  1         45  
8 1     1   8 use Catmandu::Fix::Has;
  1         3  
  1         10  
9              
10             has path => (fix_arg => 1);
11              
12             with 'Catmandu::Fix::Condition::SimpleAllTest';
13              
14             sub emit_test {
15 5     5 0 26846 my ($self, $var) = @_;
16 5         20 "(is_value(${var}) && Data::Validate::URI::is_http_uri(${var}))";
17             }
18              
19             =head1 NAME
20              
21             Catmandu::Fix::Condition::is_http_uri - check of a field contains an HTTP URI
22              
23             =head1 SYNOPSIS
24              
25             if is_http_uri(uri_field)
26             ...
27             else
28             ...
29             end
30              
31             =head1 SEE ALSO
32              
33             L<Catmandu::Fix>
34              
35             =cut
36              
37             1;