cookbooks/kagent/libraries/inifile.rb
# Public: Merges other_inifile into this inifile, overwriting existing
# entries. Useful for having a system inifile with user over-ridable settings
# elsewhere.
#
# other - The other IniFile.
#
# Returns this IniFile.
#
Merges other_inifile into this inifile, overwriting existing
entries. Useful for having a system inifile with user over-ridable settings
elsewhere.




Merges other_inifile into this inifile overwriting existing entries . Useful for having a system inifile with user over - ridable settings elsewhere .
def merge!( other )
    my_keys = @ini.keys
    other_keys =
        case other
        when IniFile; other.instance_variable_get(:@ini).keys
        when Hash; other.keys
        else raise "cannot merge contents from '#{other.class.name}'" end
    (my_keys & other_keys).each do |key|
      @ini[key].merge!(other[key])
    end
    (other_keys - my_keys).each do |key|
      @ini[key] = other[key]
    end
    self
  end
def merge! ( other ) my_keys = @ini . keys other_keys = case other when IniFile ; other . instance_variable_get ( :@ini ) . keys when Hash ; other . keys else raise "cannot merge contents from '#{other.class.name}'" end ( my_keys & other_keys ) . each do | key | @ini [ key ] . merge! ( other [ key ] ) end ( other_keys - my_keys ) . each do | key | @ini [ key ] = other [ key ] end self end
Public: Merges other_inifile into this inifile, overwriting existing
entries.
Public : Merges other_inifile into this inifile overwriting existing entries .
other