#
# dcast: Setting /etc/hosts

require 'path_class'

path = Path.new
file = IO.popen("ruby dcast-parser --host --ip --mac")

hostname = Array.new
ip = Array.new
mac =  Array.new

while text = file.gets do
  hostname << text.split[0]
  ip << text.split[1]
  mac_address = ""
  text.split[2].split(/:/).each {|str|
    str = "0" + str if str.length == 1
    mac_address = mac_address + ":" + str
  }
  mac << mac_address.sub(/:/,'')
end


