Sha256: bbb719eac8572d3a5686d77217147b9d0d83c6e47801ceaf5035675d7c993fa9

Contents?: true

Size: 427 Bytes

Versions: 25

Compression:

Stored size: 427 Bytes

Contents

# frozen_string_literal: true

module Anyway
  using Anyway::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

25 entries across 25 versions & 2 rubygems

Version Path
anyway_config-2.6.4 lib/anyway/utils/deep_merge.rb
anyway_config-2.6.3 lib/anyway/utils/deep_merge.rb
anyway_config-2.6.2 lib/anyway/utils/deep_merge.rb
anyway_config-2.6.1 lib/anyway/utils/deep_merge.rb
anyway_config-2.6.0 lib/anyway/utils/deep_merge.rb
runger_config-3.0.1 lib/anyway/utils/deep_merge.rb
runger_config-3.0.0 lib/anyway/utils/deep_merge.rb
runger_config-2.7.0 lib/anyway/utils/deep_merge.rb
runger_config-2.6.1 lib/anyway/utils/deep_merge.rb
runger_config-2.6.0 lib/anyway/utils/deep_merge.rb
anyway_config-2.5.4 lib/anyway/utils/deep_merge.rb
anyway_config-2.5.3 lib/anyway/utils/deep_merge.rb
anyway_config-2.5.2 lib/anyway/utils/deep_merge.rb
anyway_config-2.5.1 lib/anyway/utils/deep_merge.rb
anyway_config-2.5.0 lib/anyway/utils/deep_merge.rb
anyway_config-2.4.2 lib/anyway/utils/deep_merge.rb
anyway_config-2.4.1 lib/anyway/utils/deep_merge.rb
anyway_config-2.4.0 lib/anyway/utils/deep_merge.rb
anyway_config-2.3.1 lib/anyway/utils/deep_merge.rb
anyway_config-2.3.0 lib/anyway/utils/deep_merge.rb