File Coverage

blib/lib/ExtUtils/Config/MakeMaker.pm
Criterion Covered Total %
statement 28 35 80.0
branch 5 6 83.3
condition 0 3 0.0
subroutine 8 11 72.7
pod 8 8 100.0
total 49 63 77.7


line stmt bran cond sub pod time code
1             package ExtUtils::Config::MakeMaker;
2             $ExtUtils::Config::MakeMaker::VERSION = '0.010';
3 2     2   224724 use strict;
  2         4  
  2         93  
4 2     2   12 use warnings;
  2         4  
  2         118  
5              
6 2     2   1115 use ExtUtils::MakeMaker::Config;
  2         101966  
  2         25  
7              
8             sub new {
9 1     1 1 5 my ($class, $maker) = @_;
10 1         6 return bless { maker => $maker }, $class;
11             }
12              
13             sub get {
14 1252     1252 1 2280 my ($self, $key) = @_;
15 1252 100       4682 return exists $self->{maker}{uc $key} ? $self->{maker}{uc $key} : $Config{$key};
16             }
17              
18             sub exists {
19 0     0 1 0 my ($self, $key) = @_;
20 0         0 return exists $Config{$key};
21             }
22              
23             sub all_config {
24 1     1 1 3 my $self = shift;
25 1         3 my %result;
26 1         175 for my $key (keys %Config) {
27 1252         2437 $result{$key} = $self->get($key);
28             }
29 1         149 return \%result;
30             }
31              
32             sub values_set {
33 2     2 1 6783 my $self = shift;
34 2         7 my %result;
35 2         442 for my $key (keys %Config) {
36 2504 100       6239 next if not exists $self->{maker}{uc $key};
37 2 50       16 next if $self->{maker}{uc $key} eq $Config{$key};
38 2         12 $result{$key} = $self->{maker}{uc $key};
39             }
40 2         221 return \%result;
41             }
42              
43             sub serialize {
44 0     0 1 0 my $self = shift;
45 0         0 require Data::Dumper;
46 0   0     0 return $self->{serialized} ||= Data::Dumper->new($self->values_set)->Terse(1)->Sortkeys(1)->Dump;
47             }
48              
49             sub materialize {
50 1     1 1 4 my $self = shift;
51 1         33 require ExtUtils::Config;
52 1         7 return ExtUtils::Config->new($self->values_set);
53             }
54              
55             sub but {
56 0     0 1   my ($self, %args) = @_;
57 0           return $self->materialize->but(%args);
58             }
59              
60             1;
61              
62             #ABSTRACT: A ExtUtils::Config compatible wrapper for ExtUtils::MakeMaker's configuration.
63              
64             __END__