Skip to content

Commit 9a3a721

Browse files
committed
Fixed issue #3 "Behavior 'CONFIG_PRECEDENT' does not exist"
Thanks to Slaven Rezić.
1 parent 969ebf8 commit 9a3a721

File tree

4 files changed

+30
-5
lines changed

4 files changed

+30
-5
lines changed

Changes

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
Revision history for Perl extension Config::Processor.
22

3+
0.28 Sun Jan 21 17:34:53 MSK 2018
4+
- Fixed issue #3 "Behavior 'CONFIG_PRECEDENT' does not exist".
5+
Thanks to Slaven Rezić.
6+
37
0.26 Fri Mar 24 11:22:54 MSK 2017
48
- README.pod replaced by README.md.
59

Makefile.PL

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ WriteMakefile(
88
'File::Spec' => '0',
99
'YAML::XS' => '0.41',
1010
'Cpanel::JSON::XS' => '3.0104',
11-
'Hash::Merge' => '0.200',
11+
'Hash::Merge' => '0.299',
1212
'Scalar::Util' => '0',
1313
'Carp' => '0',
1414
},

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ Eugene Ponizovsky, <[email protected]>
358358

359359
# COPYRIGHT AND LICENSE
360360

361-
Copyright (c) 2016-2017, Eugene Ponizovsky, <[email protected]>.
361+
Copyright (c) 2016-2018, Eugene Ponizovsky, <[email protected]>.
362362
All rights reserved.
363363

364364
This module is free software; you can redistribute it and/or modify it under

lib/Config/Processor.pm

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use 5.008000;
44
use strict;
55
use warnings;
66

7-
our $VERSION = '0.26';
7+
our $VERSION = '0.28';
88

99
use File::Spec;
1010
use YAML::XS qw( LoadFile );
@@ -59,7 +59,28 @@ sub new {
5959
? $params{process_directives} : 1;
6060
$self->{export_env} = $params{export_env};
6161

62-
$self->{_merger} = Hash::Merge->new('CONFIG_PRECEDENT');
62+
my $merger = Hash::Merge->new;
63+
$merger->specify_behavior(
64+
{ SCALAR => {
65+
SCALAR => sub { $_[1] },
66+
ARRAY => sub { $_[1] },
67+
HASH => sub { $_[1] },
68+
},
69+
ARRAY => {
70+
SCALAR => sub { $_[1] },
71+
ARRAY => sub { $_[1] },
72+
HASH => sub { $_[1] },
73+
},
74+
HASH => {
75+
SCALAR => sub { $_[1] },
76+
ARRAY => sub { $_[1] },
77+
HASH => sub { $merger->_merge_hashes( $_[0], $_[1] ) },
78+
},
79+
},
80+
'CONFIG_PRECEDENT',
81+
);
82+
$self->{_merger} = $merger;
83+
6384
$self->{_config} = undef;
6485
$self->{_vars} = {};
6586
$self->{_seen_nodes} = {};
@@ -763,7 +784,7 @@ Eugene Ponizovsky, E<lt>[email protected]<gt>
763784
764785
=head1 COPYRIGHT AND LICENSE
765786
766-
Copyright (c) 2016-2017, Eugene Ponizovsky, E<lt>[email protected]E<gt>.
787+
Copyright (c) 2016-2018, Eugene Ponizovsky, E<lt>[email protected]E<gt>.
767788
All rights reserved.
768789
769790
This module is free software; you can redistribute it and/or modify it under

0 commit comments

Comments
 (0)