line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package MooX::Value::Domain; |
2
|
|
|
|
|
|
|
|
3
|
4
|
|
|
4
|
|
32498
|
use warnings; |
|
4
|
|
|
|
|
16
|
|
|
4
|
|
|
|
|
88
|
|
4
|
4
|
|
|
4
|
|
12
|
use strict; |
|
4
|
|
|
|
|
3
|
|
|
4
|
|
|
|
|
74
|
|
5
|
4
|
|
|
4
|
|
930
|
use Moo; |
|
4
|
|
|
|
|
20048
|
|
|
4
|
|
|
|
|
18
|
|
6
|
4
|
|
|
4
|
|
3691
|
use namespace::clean; |
|
4
|
|
|
|
|
16124
|
|
|
4
|
|
|
|
|
15
|
|
7
|
|
|
|
|
|
|
|
8
|
4
|
|
|
4
|
|
1270
|
use MooX::Value::ValidationUtils; |
|
4
|
|
|
|
|
5
|
|
|
4
|
|
|
|
|
693
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our $VERSION = '0.05'; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
extends 'MooX::Value'; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub _why_invalid |
15
|
|
|
|
|
|
|
{ |
16
|
15
|
|
|
15
|
|
16
|
my ($self, $value) = @_; |
17
|
15
|
|
|
|
|
33
|
my ($why, $long, $data) = MooX::Value::ValidationUtils::why_invalid_domain_name( $value ); |
18
|
15
|
100
|
|
|
|
31
|
return ( __PACKAGE__ . ": $why", $long, $data ) if defined $why; |
19
|
13
|
|
|
|
|
15
|
return; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub new_canonical |
23
|
|
|
|
|
|
|
{ |
24
|
2
|
|
|
2
|
1
|
896
|
my ($class, $value) = @_; |
25
|
2
|
|
|
|
|
3
|
$value =~ tr/A-Z/a-z/; |
26
|
2
|
|
|
|
|
37
|
return $class->new( $value ); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub make_subdomain |
30
|
|
|
|
|
|
|
{ |
31
|
5
|
|
|
5
|
1
|
1090
|
my ($self, $label) = @_; |
32
|
5
|
100
|
|
|
|
28
|
die __PACKAGE__ . ': undefined label' unless defined $label; |
33
|
4
|
100
|
|
|
|
3
|
die __PACKAGE__ .': Not a DomainLabel' unless eval { $label->isa( 'MooX::Value::DomainLabel' ); }; |
|
4
|
|
|
|
|
29
|
|
34
|
2
|
|
|
|
|
53
|
return __PACKAGE__->new( $label->value . '.' . $self->value ); |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
1; |
38
|
|
|
|
|
|
|
__END__ |