lib/beaker/options/options_hash.rb
# Recursively merge and OptionsHash with an OptionsHash or Hash
#
# @param [OptionsHash]       base The hash to merge into
# @param [OptionsHash, Hash] hash The hash to merge from
#
# @example
#   base = { :key => { :subkey1 => 'subval', :subkey2 => 'subval' } }
#   hash = { :key => { :subkey1 => 'newval'} }
#      rmerge(base, hash) == { :key => { :subkey1 => 'newval', :subkey2 => 'subval' }
# @return [OptionsHash] The combined bash and hash
Recursively merge and OptionsHash with an OptionsHash or Hash
Recursively merge and OptionsHash with an OptionsHash or Hash
def rmerge base, hash
        return base unless hash.is_a?(Hash) || hash.is_a?(OptionsHash)
        hash.each do |key, v|
          if (base[key].is_a?(Hash) || base[key].is_a?(OptionsHash)) && (hash[key].is_a?(Hash) || has[key].is_a?(OptionsHash))
            rmerge(base[key], hash[key])
          elsif hash[key].is_a?(Hash) 
            base[key] = OptionsHash.new.merge(hash[key])
          else
            base[key]= hash[key]
          end
        end
        base
      end
def rmerge base , hash return base unless hash . is_a? ( Hash ) || hash . is_a? ( OptionsHash ) hash . each do | key , v | if ( base [ key ] . is_a? ( Hash ) || base [ key ] . is_a? ( OptionsHash ) ) && ( hash [ key ] . is_a? ( Hash ) || has [ key ] . is_a? ( OptionsHash ) ) rmerge ( base [ key ] , hash [ key ] ) elsif hash [ key ] . is_a? ( Hash ) base [ key ] = OptionsHash . new . merge ( hash [ key ] ) else base [ key ] = hash [ key ] end end base end
Recursively merge and OptionsHash with an OptionsHash or Hash
Recursively merge and OptionsHash with an OptionsHash or Hash
The combined bash and hash
The combined bash and hash
OptionsHash
base
<not_specific>
hash
<not_specific>
<not_specific>
hash The hash to merge from
hash The hash to merge from
example
None