| 1 | package Catmandu::Fix::Condition::is_live_web_uri; | ||
| 2 | |||
| 3 | 1 | our $VERSION = '0.15'; | |
| 4 | |||
| 5 | 1 | ▶ | use Catmandu::Sane; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 1 | ▶ | use Moo; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | 1 | ▶ | use Data::Validate::URI; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | 1 | ▶ | use LWP::Simple; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 9 | 1 | ▶ | use Catmandu::Fix::Has; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 10 | |||
| 11 | 1 | has path => (fix_arg => 1); | |
| 12 | |||
| 13 | 1 | with 'Catmandu::Fix::Condition::SimpleAllTest'; | |
| 14 | |||
| 15 | 0 | ▶ | sub emit_test { |
|
Subroutine
emit_test: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 16 | 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 | 1; | |