line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Catmandu::Fix::Condition::is_web_uri; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
our $VERSION = '0.13'; |
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
349932
|
use Catmandu::Sane; |
|
1
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
6
|
|
6
|
1
|
|
|
1
|
|
148
|
use Moo; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
7
|
1
|
|
|
1
|
|
720
|
use Data::Validate::URI; |
|
1
|
|
|
|
|
40184
|
|
|
1
|
|
|
|
|
57
|
|
8
|
1
|
|
|
1
|
|
7
|
use Catmandu::Fix::Has; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
9
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
has path => (fix_arg => 1); |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
with 'Catmandu::Fix::Condition::SimpleAllTest'; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub emit_test { |
15
|
6
|
|
|
6
|
0
|
28872
|
my ($self, $var) = @_; |
16
|
6
|
|
|
|
|
22
|
"(is_value(${var}) && Data::Validate::URI::is_web_uri(${var}))"; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
=head1 NAME |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
Catmandu::Fix::Condition::is_web_uri - check of a field contains an HTTP or HTTPS URI |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=head1 SYNOPSIS |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
if is_web_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; |