Confusing behavior when deep cloning with configatron
morrifeldman opened this issue · comments
Hello,
I really like configatron.
Perhaps I've got the wrong idea, but I would like to be able to duplicate/clone a set of configurations. It roughly seems to work but I think there is something wrong with either deep_clone or the inspect method. After using deep_clone to copy a set of configurations, the configurations seem to be duplicated under their original names. Try running the code below to see what I mean.
Thanks,
Morri
require 'configatron'
configatron.testConfig.field = :value
configatron.duplicateConfig = configatron.testConfig.deep_clone
puts "Expecting to see .duplicateConfig, but it isn't there, only .testConfig twice"
p configatron
puts "However configatron_keys does know about .duplicateConfig"
p configatron.configatron_keys
Sorry for the slow follow-up here (I'm now going back and answering our unresolved issues). We no longer support deep_clone
, but may soon have a replacement mechanism for doing so (#52).