line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package MooX::Value::Domain; |
2
|
|
|
|
|
|
|
|
3
|
4
|
|
|
4
|
|
37019
|
use warnings; |
|
4
|
|
|
|
|
18
|
|
|
4
|
|
|
|
|
117
|
|
4
|
4
|
|
|
4
|
|
17
|
use strict; |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
92
|
|
5
|
4
|
|
|
4
|
|
958
|
use Moo; |
|
4
|
|
|
|
|
21810
|
|
|
4
|
|
|
|
|
21
|
|
6
|
4
|
|
|
4
|
|
3683
|
use namespace::clean; |
|
4
|
|
|
|
|
18343
|
|
|
4
|
|
|
|
|
18
|
|
7
|
|
|
|
|
|
|
|
8
|
4
|
|
|
4
|
|
1385
|
use MooX::Value::ValidationUtils; |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
844
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our $VERSION = '0.04'; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
extends 'MooX::Value'; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub _why_invalid |
15
|
|
|
|
|
|
|
{ |
16
|
15
|
|
|
15
|
|
18
|
my ($self, $value) = @_; |
17
|
15
|
|
|
|
|
39
|
my ($why, $long, $data) = MooX::Value::ValidationUtils::why_invalid_domain_name( $value ); |
18
|
15
|
100
|
|
|
|
40
|
return ( __PACKAGE__ . ": $why", $long, $data ) if defined $why; |
19
|
13
|
|
|
|
|
23
|
return; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub new_canonical |
23
|
|
|
|
|
|
|
{ |
24
|
2
|
|
|
2
|
1
|
1502
|
my ($class, $value) = @_; |
25
|
2
|
|
|
|
|
5
|
$value =~ tr/A-Z/a-z/; |
26
|
2
|
|
|
|
|
45
|
return $class->new( $value ); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub make_subdomain |
30
|
|
|
|
|
|
|
{ |
31
|
5
|
|
|
5
|
1
|
1527
|
my ($self, $label) = @_; |
32
|
5
|
100
|
|
|
|
27
|
die __PACKAGE__ . ': undefined label' unless defined $label; |
33
|
4
|
100
|
|
|
|
5
|
die __PACKAGE__ .': Not a DomainLabel' unless eval { $label->isa( 'MooX::Value::DomainLabel' ); }; |
|
4
|
|
|
|
|
32
|
|
34
|
2
|
|
|
|
|
34
|
return __PACKAGE__->new( $label->value . '.' . $self->value ); |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
1; |
38
|
|
|
|
|
|
|
__END__ |