class VirtualBox class <= 1 HOBO_LOGGER.error "VBoxManage command failed: #{cmd}" # TODO: Raise error here that other commands can catch? raise Exception.new("Failure: #{result}") end return result end # Parses the key value pairs from the VBoxManage key=value pair # format and returns as a Ruby Hash def parse_kv_pairs(raw) parsed = {} raw.lines.each do |line| # Some lines aren't configuration, we just ignore them next unless line =~ /^"?(.+?)"?="?(.+?)"?$/ parsed[$1] = $2.strip end parsed end end end