Sha256: deb9180ede9e47b41cfbea3fb3e8f4212fcd5f47a1365bf1c4e8277428044d80

Contents?: true

Size: 492 Bytes

Versions: 28

Compression:

Stored size: 492 Bytes

Contents

class Hash
  # Merges self with another hash, recursively.
  # 
  # This code was lovingly stolen from some random gem:
  # http://gemjack.com/gems/tartan-0.1.1/classes/Hash.html
  # 
  # Thanks to whoever made it.
  def deep_merge(hash)
    target = dup
    
    hash.keys.each do |key|
      if hash[key].is_a? Hash and self[key].is_a? Hash
        target[key] = target[key].deep_merge(hash[key])
        next
      end
      
      target[key] = hash[key]
    end
    
    target
  end
end

Version data entries

28 entries across 28 versions & 11 rubygems

Version Path
codeslinger-jekyll-0.3.0 lib/jekyll/core_ext.rb
codeslinger-jekyll-0.4.1 lib/jekyll/core_ext.rb
danski-jekyll-0.4.1 lib/jekyll/core_ext.rb
dysinger-jekyll-0.4.0 lib/jekyll/core_ext.rb
elq-jekyll-0.4.2 lib/jekyll/core_ext.rb
jsjohnst-jekyll-0.4.1.999.1 lib/jekyll/core_ext.rb
jsjohnst-jekyll-0.4.1.999.2 lib/jekyll/core_ext.rb
jsjohnst-jekyll-0.4.1.999.3 lib/jekyll/core_ext.rb
jsjohnst-jekyll-0.4.1.999.4 lib/jekyll/core_ext.rb
jsjohnst-jekyll-0.4.1.999.6 lib/jekyll/core_ext.rb
matflores-jekyll-0.4.1.1 lib/jekyll/core_ext.rb
matflores-jekyll-0.4.1 lib/jekyll/core_ext.rb
matflores-jekyll-0.4.2 lib/jekyll/core_ext.rb
matflores-jekyll-0.4.3 lib/jekyll/core_ext.rb
mattmatt-jekyll-0.4.0 lib/jekyll/core_ext.rb
mattmatt-jekyll-0.4.1 lib/jekyll/core_ext.rb
mattmatt-jekyll-0.4.3 lib/jekyll/core_ext.rb
mattmatt-jekyll-0.4.4 lib/jekyll/core_ext.rb
mattmatt-jekyll-0.4.5 lib/jekyll/core_ext.rb
mojombo-jekyll-0.3.0 lib/jekyll/core_ext.rb