line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Enbld::Target::Attribute::Dependencies; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
3411
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
31
|
|
4
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
27
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
5
|
use Carp; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
74
|
|
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
5
|
use parent qw/Enbld::Target::AttributeExtension::Word/; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub initialize { |
11
|
46
|
|
|
46
|
0
|
106
|
my ( $self, $param ) = @_; |
12
|
|
|
|
|
|
|
|
13
|
46
|
100
|
|
|
|
170
|
if ( ref( $param ) eq 'CODE' ) { |
14
|
3
|
|
|
|
|
11
|
$self->{callback} = $param; |
15
|
3
|
|
|
|
|
14
|
return $self; |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
# Usually, as for supporting a Dependencies, only OS X (darwin) is. |
19
|
|
|
|
|
|
|
# However, Enbld supports a Dependencies by the Code Reference |
20
|
|
|
|
|
|
|
# If You are and all the operating systems. |
21
|
43
|
50
|
|
|
|
238
|
$self->{value} = ( $^O eq 'darwin' ) ? $param : undef; |
22
|
|
|
|
|
|
|
|
23
|
43
|
|
|
|
|
110
|
$self->{is_evaluated}++; |
24
|
|
|
|
|
|
|
|
25
|
43
|
|
|
|
|
105
|
return $self; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub validate { |
29
|
6
|
|
|
6
|
0
|
14
|
my ( $self, $value ) = @_; |
30
|
|
|
|
|
|
|
|
31
|
6
|
50
|
|
|
|
42
|
unless ( ref( $value ) eq 'ARRAY' ) { |
32
|
0
|
|
|
|
|
0
|
my $err = "Attribute 'Dependencies' isn't ARRAY reference"; |
33
|
0
|
|
|
|
|
0
|
require Enbld::Exception; |
34
|
0
|
|
|
|
|
0
|
croak( Enbld::Exception->new( $err, $value )); |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
6
|
|
|
|
|
10
|
foreach my $string ( @{ $value } ) { |
|
6
|
|
|
|
|
25
|
|
38
|
6
|
|
|
|
|
40
|
$self->SUPER::validate( $string ); |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
6
|
|
|
|
|
17
|
return $value; |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub to_value { |
45
|
32
|
|
|
32
|
0
|
55
|
my $self = shift; |
46
|
|
|
|
|
|
|
|
47
|
32
|
|
|
|
|
162
|
my $value = $self->evaluate; |
48
|
|
|
|
|
|
|
|
49
|
32
|
100
|
|
|
|
231
|
return [] if ( ! defined $value ); |
50
|
|
|
|
|
|
|
|
51
|
6
|
|
|
|
|
26
|
$self->validate( $value ); |
52
|
|
|
|
|
|
|
|
53
|
6
|
|
|
|
|
35
|
return $value; |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
1; |