magynhard/yaml_extend

Boolean keys with value "true" in base YAML are not overwritten by "false" in extended YAMLs

MohamedAsan opened this issue ยท 4 comments

For example,

Let the base YAML be:

# base.yml
alpha: true
beta: false
gamma: true
data:
    delta: false
    kappa: true
    theta: false

Let the extended YAML be:

# extended.yml
extends: 'base.yml'
alpha: false
beta: true
data:
    delta: true
    kappa: false

When you call

YAML.ext_load_file 'extended.yml'

the returned YAML value results in

alpha: true
beta: true
gamma: true
data:
    delta: true
    kappa: true
    theta: false

The values of alpha and kappa should actually be false since they are over-written in extended YAML

yaml_extend_issue

Thank you for your very clean reporting.

It seems to be related to the used deep_merge gem, which i use to merge the hashes:
danielsdeleo/deep_merge#23
danielsdeleo/deep_merge#28

I will look for a solution within the next days.

Thank you so much @entwanderer. It solves an important issue for me! :)

You are welcome! Thank you for contributing! ๐Ÿฅ‡