Sha256: f5f32251e453bd84874020e186f6b1ba143c5649bb97590089282d2532e429f1

Contents?: true

Size: 1.19 KB

Versions: 65

Compression:

Stored size: 1.19 KB

Contents

module PEBuild
  module Util
    module Config

      # Merge configuration classes together with the "local" object overwriting any
      # values set in the "other" object. This uses the default merging in the Vagrant
      # plugin config class. The builtin merge function is not straight forward however.
      # It needs to be called on the object being overwritten. When using a subclass of
      # a global config for a provisioner config, the builtin merge method cannot actually
      # merge them in the direction that would be needed.
      #
      # This function assumes that the "local" object is of the same class or at the very
      # least a subclass of "other".
      #
      # @param local [Vagrant::Plugin::V2::Config] Local configuration class to merge
      # @param other [Vagrant::Plugin::V2::Config] Other configuration class to merge
      # @return [Vagrant::Plugin::V2::Config] New object of the same class as Local that represents the merged result
      #
      def self.local_merge(local, other)
        if other.class >= local.class
          result = local.class.new

          result = result.merge(other)
          result = result.merge(local)
        end
      end
    end
  end
end

Version data entries

65 entries across 65 versions & 1 rubygems

Version Path
vagrant-pe_build-0.17.0 lib/pe_build/util/config.rb
vagrant-pe_build-0.16.0 lib/pe_build/util/config.rb
vagrant-pe_build-0.15.6 lib/pe_build/util/config.rb
vagrant-pe_build-0.15.5 lib/pe_build/util/config.rb
vagrant-pe_build-0.15.4 lib/pe_build/util/config.rb
vagrant-pe_build-0.15.3 lib/pe_build/util/config.rb
vagrant-pe_build-0.15.1 lib/pe_build/util/config.rb
vagrant-pe_build-0.15.0 lib/pe_build/util/config.rb
vagrant-pe_build-0.14.2 lib/pe_build/util/config.rb
vagrant-pe_build-0.14.1 lib/pe_build/util/config.rb
vagrant-pe_build-0.14.0 lib/pe_build/util/config.rb
vagrant-pe_build-0.13.7 lib/pe_build/util/config.rb
vagrant-pe_build-0.13.6 lib/pe_build/util/config.rb
vagrant-pe_build-0.13.5 lib/pe_build/util/config.rb
vagrant-pe_build-0.13.4 lib/pe_build/util/config.rb
vagrant-pe_build-0.13.3 lib/pe_build/util/config.rb
vagrant-pe_build-0.13.2 lib/pe_build/util/config.rb
vagrant-pe_build-0.13.1 lib/pe_build/util/config.rb
vagrant-pe_build-0.13.0 lib/pe_build/util/config.rb
vagrant-pe_build-0.12.0 lib/pe_build/util/config.rb