| 1 | package ExtUtils::Config; | ||||||||||||||||||||
| 2 | 2 | $ExtUtils::Config::VERSION = '0.010'; | |||||||||||||||||||
| 3 | 2 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 4 | 2 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 5 | 2 | ▶ | use Config; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 6 | |||||||||||||||||||||
| 7 | 3 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||||||||||||
| 8 | 3 | my ($pack, $args) = @_; | |||||||||||||||||||
| 9 | 3 | ▶ | return bless { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 10 | values => ($args ? { %$args } : {}), | ||||||||||||||||||||
| 11 | }, $pack; | ||||||||||||||||||||
| 12 | } | ||||||||||||||||||||
| 13 | |||||||||||||||||||||
| 14 | 3 | ▶ | sub get { | ||||||||||||||||||
|
Subroutine
get: called CC=2 SCAR=7.2
Pod
documented
| |||||||||||||||||||||
| 15 | 3 | my ($self, $key) = @_; | |||||||||||||||||||
| 16 | 3 | ▶ | return exists $self->{values}{$key} ? $self->{values}{$key} : $Config{$key}; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 17 | } | ||||||||||||||||||||
| 18 | |||||||||||||||||||||
| 19 | 2 | ▶ | sub exists { | ||||||||||||||||||
|
Subroutine
exists: called CC=2 SCAR=7.1
Pod
documented
| |||||||||||||||||||||
| 20 | 2 | my ($self, $key) = @_; | |||||||||||||||||||
| 21 | 2 | ▶ | return exists $self->{values}{$key} || exists $Config{$key}; | ||||||||||||||||||
|
Condition66%2/3
exists $self->{'values'}{$key} || exists $ExtUtils::Config::Config{$key}
MC/DC50%1/2
exists $self->{'values'}{$key} || exists $ExtUtils::Config::Config{$key}
exists $self->{'values'}{$key}
exists $ExtUtils::Config::Config{$key}
Truth table66%2/3
A || B
A= exists $self->{'values'}{$key}B= exists $ExtUtils::Config::Config{$key}
| |||||||||||||||||||||
| 22 | } | ||||||||||||||||||||
| 23 | |||||||||||||||||||||
| 24 | 4 | ▶ | sub values_set { | ||||||||||||||||||
|
Subroutine
values_set: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||
| 25 | 4 | my $self = shift; | |||||||||||||||||||
| 26 | 4 | return { %{$self->{values}} }; | |||||||||||||||||||
| 27 | } | ||||||||||||||||||||
| 28 | |||||||||||||||||||||
| 29 | 4 | ▶ | sub all_config { | ||||||||||||||||||
|
Subroutine
all_config: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||
| 30 | 4 | my $self = shift; | |||||||||||||||||||
| 31 | 4 | return { %Config, %{ $self->{values}} }; | |||||||||||||||||||
| 32 | } | ||||||||||||||||||||
| 33 | |||||||||||||||||||||
| 34 | 0 | ▶ | sub serialize { | ||||||||||||||||||
|
Subroutine
serialize: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||||||||
| 35 | 0 | my $self = shift; | |||||||||||||||||||
| 36 | 0 | require Data::Dumper; | |||||||||||||||||||
| 37 | 0 | ▶ | return $self->{serialized} ||= Data::Dumper->new([ $self->{values} ])->Terse(1)->Sortkeys(1)->Dump; | ||||||||||||||||||
|
Condition0%0/3
$self->{"serialized"} ||= "Data::Dumper"->new([$self->{"values"}])->Terse(1)->Sortkeys(1)->Dump
MC/DC0%0/2
$self->{"serialized"} ||= "Data::Dumper"->new([$self->{"values"}])->Terse(1)->Sortkeys(1)->Dump
$self->{"serialized"}
"Data::Dumper"->new([$self->{"values"}])->Terse(1)->Sortkeys(1)->Dump
Truth table0%0/3
A ||= B
A= $self->{"serialized"}B= "Data::Dumper"->new([$self->{"values"}])->Terse(1)->Sortkeys(1)->Dump
| |||||||||||||||||||||
| 38 | } | ||||||||||||||||||||
| 39 | |||||||||||||||||||||
| 40 | 1 | ▶ | sub but { | ||||||||||||||||||
|
Subroutine
but: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||||||||
| 41 | 1 | my ($self, $args) = @_; | |||||||||||||||||||
| 42 | 1 | my %new = %{ $self->{values} }; | |||||||||||||||||||
| 43 | 1 | for my $key (keys %$args) { | |||||||||||||||||||
| 44 | 2 | ▶ | if (defined $args->{$key}) { | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 45 | 1 | $new{$key} = $args->{$key} | |||||||||||||||||||
| 46 | } | ||||||||||||||||||||
| 47 | else { | ||||||||||||||||||||
| 48 | 1 | delete $new{$key}; | |||||||||||||||||||
| 49 | } | ||||||||||||||||||||
| 50 | } | ||||||||||||||||||||
| 51 | 1 | return bless { values => \%new }, ref $self; | |||||||||||||||||||
| 52 | } | ||||||||||||||||||||
| 53 | |||||||||||||||||||||
| 54 | 2 | 1; | |||||||||||||||||||
| 55 | |||||||||||||||||||||
| 56 | # ABSTRACT: A wrapper for perl's configuration | ||||||||||||||||||||
| 57 | |||||||||||||||||||||
| 58 | __END__ | ||||||||||||||||||||