Sha256: b0cfba2b6ac9f673b1e93af07ac769a58b9978dd3257a0d929e346cdc6e13cdf

Contents?: true

Size: 427 Bytes

Versions: 4

Compression:

Stored size: 427 Bytes

Contents

# frozen_string_literal: true

module Runger
  using Runger::Ext::DeepDup

  module Utils
    def self.deep_merge!(source, other)
      other.each do |key, other_value|
        this_value = source[key]

        if this_value.is_a?(::Hash) && other_value.is_a?(::Hash)
          deep_merge!(this_value, other_value)
        else
          source[key] = other_value.deep_dup
        end
      end

      source
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
runger_config-5.2.0 lib/runger/utils/deep_merge.rb
runger_config-5.1.0 lib/runger/utils/deep_merge.rb
runger_config-5.0.0 lib/runger/utils/deep_merge.rb
runger_config-4.0.0 lib/runger/utils/deep_merge.rb