Sha256: 5aa060cdbada378d4ea89d319d111fc5984034087d3fdac6951029ad839eb905

Contents?: true

Size: 662 Bytes

Versions: 33

Compression:

Stored size: 662 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

# Thanks, ActiveSupport!
class Date
  # Converts datetime to an appropriate format for use in XML
  def xmlschema
    strftime("%Y-%m-%dT%H:%M:%S%Z")
  end if RUBY_VERSION < '1.9'
end

Version data entries

33 entries across 33 versions & 14 rubygems

Version Path
Chrononaut-hyde-0.1.0 lib/jekyll/core_ext.rb
Chrononaut-hyde-0.1.1 lib/jekyll/core_ext.rb
PerfectlyNormal-jekyll-0.5.3 lib/jekyll/core_ext.rb
codeslinger-jekyll-0.5.2 lib/jekyll/core_ext.rb
codeslinger-jekyll-0.5.3 lib/jekyll/core_ext.rb
codeslinger-jekyll-0.5.4 lib/jekyll/core_ext.rb
mojombo-jekyll-0.5.2 lib/jekyll/core_ext.rb
mojombo-jekyll-0.5.3 lib/jekyll/core_ext.rb
nirvdrum-jekyll-0.6.0 lib/jekyll/core_ext.rb
pol-hyde-0.1.2 lib/jekyll/core_ext.rb
pol-hyde-0.1.3 lib/jekyll/core_ext.rb
rfelix-jekyll-0.5.4 lib/jekyll/core_ext.rb
sixones-jekyll-0.5.2.2 lib/jekyll/core_ext.rb
sixones-jekyll-0.5.2 lib/jekyll/core_ext.rb
tekin-jekyll-0.5.2 lib/jekyll/core_ext.rb
tomafro-jekyll-0.5.2.1 lib/jekyll/core_ext.rb
tomafro-jekyll-0.5.3.1 lib/jekyll/core_ext.rb
tomafro-jekyll-0.5.3.2 lib/jekyll/core_ext.rb
tomafro-jekyll-0.5.3.3 lib/jekyll/core_ext.rb
tomafro-jekyll-0.5.3.5 lib/jekyll/core_ext.rb