line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Enbld::Target::Attribute::SortedVersionList; |
2
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
8204
|
use strict; |
|
3
|
|
|
|
|
3
|
|
|
3
|
|
|
|
|
74
|
|
4
|
3
|
|
|
3
|
|
9
|
use warnings; |
|
3
|
|
|
|
|
3
|
|
|
3
|
|
|
|
|
57
|
|
5
|
|
|
|
|
|
|
|
6
|
3
|
|
|
3
|
|
9
|
use Carp; |
|
3
|
|
|
|
|
0
|
|
|
3
|
|
|
|
|
128
|
|
7
|
3
|
|
|
3
|
|
11
|
use version; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
22
|
|
8
|
|
|
|
|
|
|
|
9
|
3
|
|
|
3
|
|
196
|
use parent qw/Enbld::Target::AttributeExtension::Word/; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
15
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
require Enbld::Exception; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub initialize { |
14
|
49
|
|
|
49
|
0
|
95
|
my ( $self, $param ) = @_; |
15
|
|
|
|
|
|
|
|
16
|
49
|
50
|
|
|
|
130
|
if ( ! defined $param ) { |
17
|
|
|
|
|
|
|
$self->{callback} = sub { |
18
|
35
|
|
|
35
|
|
59
|
my $attributes = shift; |
19
|
|
|
|
|
|
|
|
20
|
35
|
|
|
|
|
176
|
my $list = $attributes->VersionList; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
my @sorted = sort { |
23
|
34
|
|
|
|
|
861
|
version->declare( $a ) cmp version->declare( $b ) |
24
|
35
|
|
|
|
|
53
|
} @{ $list }; |
|
35
|
|
|
|
|
174
|
|
25
|
|
|
|
|
|
|
|
26
|
35
|
|
|
|
|
152
|
return \@sorted; |
27
|
49
|
|
|
|
|
316
|
}; |
28
|
|
|
|
|
|
|
|
29
|
49
|
|
|
|
|
116
|
return $self; |
30
|
|
|
|
|
|
|
}; |
31
|
|
|
|
|
|
|
|
32
|
0
|
0
|
|
|
|
0
|
if ( $param ) { |
33
|
0
|
|
|
|
|
0
|
$self->SUPER::initialize( $param ); |
34
|
0
|
|
|
|
|
0
|
return $self; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
0
|
|
|
|
|
0
|
my $err = "Attribute 'SortedVersionList' isn't defined"; |
38
|
0
|
|
|
|
|
0
|
croak( Enbld::Exception->new( $err )); |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub validate { |
42
|
39
|
|
|
39
|
0
|
47
|
my ( $self, $value ) = @_; |
43
|
|
|
|
|
|
|
|
44
|
39
|
50
|
|
|
|
98
|
unless ( ref( $value ) eq 'ARRAY' ) { |
45
|
0
|
|
|
|
|
0
|
my $type = ref( $self ); |
46
|
0
|
|
|
|
|
0
|
$type =~ s/.*:://; |
47
|
|
|
|
|
|
|
|
48
|
0
|
|
|
|
|
0
|
my $err = "Attribute 'SortedVersionList' isn't ARRAY reference"; |
49
|
0
|
|
|
|
|
0
|
croak( Enbld::Exception->new( $err, $value )); |
50
|
|
|
|
|
|
|
} |
51
|
|
|
|
|
|
|
|
52
|
39
|
50
|
|
|
|
45
|
if ( ! @{ $value } ) { |
|
39
|
|
|
|
|
94
|
|
53
|
0
|
|
|
|
|
0
|
my $err = "Attribute 'SortedVersionList' is no version list"; |
54
|
0
|
|
|
|
|
0
|
croak( Enbld::Exception->new( $err )); |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
39
|
|
|
|
|
45
|
foreach my $string ( @{ $value } ) { |
|
39
|
|
|
|
|
107
|
|
58
|
77
|
|
|
|
|
137
|
$self->SUPER::validate( $string ); |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
39
|
|
|
|
|
47
|
return $value; |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
sub to_value { |
65
|
39
|
|
|
39
|
0
|
52
|
my $self = shift; |
66
|
|
|
|
|
|
|
|
67
|
39
|
|
|
|
|
117
|
my $value = $self->evaluate; |
68
|
|
|
|
|
|
|
|
69
|
39
|
|
|
|
|
109
|
$self->validate( $value ); |
70
|
|
|
|
|
|
|
|
71
|
39
|
|
|
|
|
90
|
return $value; |
72
|
|
|
|
|
|
|
} |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
1; |