platform_simulation_specs/common/ohai_plugin_common.rb
def subsumes?(source, test, path = [], &block)
  if source.is_a?( Hash ) && test.is_a?( Hash )
    test.all? { |k,v| subsumes?( source[k], v, path.clone << k, &block )}
  else
    block.call( path, source, test ) if block
    source == test
  end
end
# checks to see if the elements in test are also in source.  Recursively decends into Hashes.
# nil values in test match against both nil and non-existance in source.
checks to see if the elements in test are also in source.  Recursively decends into Hashes.
nil values in test match against both nil and non-existance in source.
checks to see if the elements in test are also in source . Recursively decends into Hashes . nil values in test match against both nil and non - existance in source .
def subsumes?(source, test, path = [], &block)
  if source.is_a?( Hash ) && test.is_a?( Hash )
    test.all? { |k,v| subsumes?( source[k], v, path.clone << k, &block )}
  else
    block.call( path, source, test ) if block
    source == test
  end
end
def subsumes? ( source , test , path = [ ] , & block ) if source . is_a? ( Hash ) && test . is_a? ( Hash ) test . all? { | k , v | subsumes? ( source [ k ] , v , path . clone << k , & block ) } else block . call ( path , source , test ) if block source == test end end
checks to see if the elements in test are also in source.
checks to see if the elements in test are also in source .
source
test
path
block