line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Catmandu::Fix::Condition::is_live_web_uri; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
our $VERSION = '0.13'; |
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
400410
|
use Catmandu::Sane; |
|
1
|
|
|
|
|
10
|
|
|
1
|
|
|
|
|
8
|
|
6
|
1
|
|
|
1
|
|
202
|
use Moo; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
8
|
|
7
|
1
|
|
|
1
|
|
748
|
use Data::Validate::URI; |
|
1
|
|
|
|
|
38437
|
|
|
1
|
|
|
|
|
44
|
|
8
|
1
|
|
|
1
|
|
394
|
use LWP::Simple; |
|
1
|
|
|
|
|
15872
|
|
|
1
|
|
|
|
|
7
|
|
9
|
1
|
|
|
1
|
|
359
|
use Catmandu::Fix::Has; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
9
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
has path => (fix_arg => 1); |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
with 'Catmandu::Fix::Condition::SimpleAllTest'; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub emit_test { |
16
|
0
|
|
|
0
|
0
|
|
my ($self, $var) = @_; |
17
|
0
|
|
|
|
|
|
"(is_value(${var}) && Data::Validate::URI::is_web_uri(${var}) && LWP::Simple::head(${var}))"; |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
=head1 NAME |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
Catmandu::Fix::Condition::is_live_web_uri - check of a field contains an HTTP or HTTPS URI which is available online |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=head1 SYNOPSIS |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
if is_live_web_uri(uri_field) |
27
|
|
|
|
|
|
|
... |
28
|
|
|
|
|
|
|
else |
29
|
|
|
|
|
|
|
... |
30
|
|
|
|
|
|
|
end |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
=head1 SEE ALSO |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
L<Catmandu::Fix> |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=cut |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
1; |