line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Module::Build::Config; |
2
|
|
|
|
|
|
|
|
3
|
293
|
|
|
293
|
|
2037
|
use strict; |
|
293
|
|
|
|
|
655
|
|
|
293
|
|
|
|
|
9609
|
|
4
|
293
|
|
|
293
|
|
2247
|
use warnings; |
|
293
|
|
|
|
|
655
|
|
|
293
|
|
|
|
|
15256
|
|
5
|
|
|
|
|
|
|
our $VERSION = '0.4234'; |
6
|
|
|
|
|
|
|
$VERSION = eval $VERSION; |
7
|
293
|
|
|
293
|
|
1937
|
use Config; |
|
293
|
|
|
|
|
563
|
|
|
293
|
|
|
|
|
129800
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub new { |
10
|
1026
|
|
|
1026
|
0
|
18459
|
my ($pack, %args) = @_; |
11
|
|
|
|
|
|
|
return bless { |
12
|
|
|
|
|
|
|
stack => {}, |
13
|
|
|
|
|
|
|
values => $args{values} || {}, |
14
|
1026
|
|
50
|
|
|
41717
|
}, $pack; |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub get { |
18
|
21384
|
|
|
21384
|
0
|
56369
|
my ($self, $key) = @_; |
19
|
21384
|
100
|
100
|
|
|
89518
|
return $self->{values}{$key} if ref($self) && exists $self->{values}{$key}; |
20
|
17951
|
|
|
|
|
424262
|
return $Config{$key}; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub set { |
24
|
1
|
|
|
1
|
0
|
4
|
my ($self, $key, $val) = @_; |
25
|
1
|
|
|
|
|
5
|
$self->{values}{$key} = $val; |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub push { |
29
|
3
|
|
|
3
|
0
|
30
|
my ($self, $key, $val) = @_; |
30
|
0
|
|
|
|
|
0
|
push @{$self->{stack}{$key}}, $self->{values}{$key} |
31
|
3
|
50
|
|
|
|
57
|
if exists $self->{values}{$key}; |
32
|
3
|
|
|
|
|
57
|
$self->{values}{$key} = $val; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub pop { |
36
|
3
|
|
|
3
|
0
|
4302
|
my ($self, $key) = @_; |
37
|
|
|
|
|
|
|
|
38
|
3
|
|
|
|
|
33
|
my $val = delete $self->{values}{$key}; |
39
|
3
|
50
|
|
|
|
54
|
if ( exists $self->{stack}{$key} ) { |
40
|
0
|
|
|
|
|
0
|
$self->{values}{$key} = pop @{$self->{stack}{$key}}; |
|
0
|
|
|
|
|
0
|
|
41
|
0
|
0
|
|
|
|
0
|
delete $self->{stack}{$key} unless @{$self->{stack}{$key}}; |
|
0
|
|
|
|
|
0
|
|
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
3
|
|
|
|
|
30
|
return $val; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
sub values_set { |
48
|
6
|
|
|
6
|
0
|
45
|
my $self = shift; |
49
|
6
|
50
|
|
|
|
77
|
return undef unless ref($self); |
50
|
6
|
|
|
|
|
53
|
return $self->{values}; |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
sub all_config { |
54
|
30
|
|
|
30
|
0
|
116
|
my $self = shift; |
55
|
30
|
50
|
|
|
|
287
|
my $v = ref($self) ? $self->{values} : {}; |
56
|
30
|
|
|
|
|
442599
|
return {%Config, %$v}; |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
1; |