lib/chef/project_cache.rb
# Define a deep merge for nested hashes
Define a deep merge for nested hashes
Define a deep merge for nested hashes
def deep_merge(h1, h2)
      result = h1.dup
      h2.keys.each do |key|
        result[key] = if h1[key].is_a? Hash and h2[key].is_a? Hash
                        deep_merge(result[key], h2[key])
                      else
                        h2[key]
                      end
      end
      result
    end
def deep_merge ( h1 , h2 ) result = h1 . dup h2 . keys . each do | key | result [ key ] = if h1 [ key ] . is_a? Hash and h2 [ key ] . is_a? Hash deep_merge ( result [ key ] , h2 [ key ] ) else h2 [ key ] end end result end
Define a deep merge for nested hashes
Define a deep merge for nested hashes
h1
<not_specific>
h2
<not_specific>