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.14';
4              
5 1     1   429178 use Catmandu::Sane;
  1         8  
  1         7  
6 1     1   176 use Moo;
  1         2  
  1         6  
7 1     1   856 use Data::Validate::URI;
  1         50852  
  1         49  
8 1     1   8 use Catmandu::Fix::Has;
  1         2  
  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 31542 my ($self, $var) = @_;
16 5         25 "(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;