line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package MooX::Value::Domain; |
2
|
|
|
|
|
|
|
|
3
|
4
|
|
|
4
|
|
40765
|
use warnings; |
|
4
|
|
|
|
|
27
|
|
|
4
|
|
|
|
|
154
|
|
4
|
4
|
|
|
4
|
|
19
|
use strict; |
|
4
|
|
|
|
|
5
|
|
|
4
|
|
|
|
|
108
|
|
5
|
4
|
|
|
4
|
|
1056
|
use Moo; |
|
4
|
|
|
|
|
24767
|
|
|
4
|
|
|
|
|
29
|
|
6
|
4
|
|
|
4
|
|
3912
|
use namespace::clean; |
|
4
|
|
|
|
|
20185
|
|
|
4
|
|
|
|
|
21
|
|
7
|
|
|
|
|
|
|
|
8
|
4
|
|
|
4
|
|
1513
|
use MooX::Value::ValidationUtils; |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
877
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our $VERSION = '0.03'; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
extends 'MooX::Value'; |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub _why_invalid |
15
|
|
|
|
|
|
|
{ |
16
|
15
|
|
|
15
|
|
23
|
my ($self, $value) = @_; |
17
|
15
|
|
|
|
|
49
|
my ($why, $long, $data) = MooX::Value::ValidationUtils::why_invalid_domain_name( $value ); |
18
|
15
|
100
|
|
|
|
42
|
return ( __PACKAGE__ . ": $why", $long, $data ) if defined $why; |
19
|
13
|
|
|
|
|
27
|
return; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub new_canonical |
23
|
|
|
|
|
|
|
{ |
24
|
2
|
|
|
2
|
1
|
3694
|
my ($class, $value) = @_; |
25
|
2
|
|
|
|
|
7
|
$value =~ tr/A-Z/a-z/; |
26
|
2
|
|
|
|
|
75
|
return $class->new( $value ); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub make_subdomain |
30
|
|
|
|
|
|
|
{ |
31
|
5
|
|
|
5
|
1
|
1661
|
my ($self, $label) = @_; |
32
|
5
|
100
|
|
|
|
29
|
die __PACKAGE__ . ': undefined label' unless defined $label; |
33
|
4
|
100
|
|
|
|
4
|
die __PACKAGE__ .': Not a DomainLabel' unless eval { $label->isa( 'MooX::Value::DomainLabel' ); }; |
|
4
|
|
|
|
|
44
|
|
34
|
2
|
|
|
|
|
46
|
return __PACKAGE__->new( $label->value . '.' . $self->value ); |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
1; |
38
|
|
|
|
|
|
|
__END__ |