Skip to content

Instantly share code, notes, and snippets.

@pooza
Created January 24, 2019 09:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pooza/e6d915909a60c77afcd78c1c718280f2 to your computer and use it in GitHub Desktop.
Save pooza/e6d915909a60c77afcd78c1c718280f2 to your computer and use it in GitHub Desktop.
module MulukhiyaTootProxy
class Config < Ginseng::Config
include Package
def self.deep_merge(src, target)
raise ArgumentError 'Not Hash' unless target.is_a?(Hash)
dest = (src.clone || {}).with_indifferent_access
target.each do |k, v|
dest[k] = v.is_a?(Hash) ? deep_merge(dest[k], v) : v
end
return dest.compact
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment