hostsgen.rb
def parse(hosts)
    hosts.lines.each_with_index do |l, i|
      l = l.strip
      if l[0] == '#' then next end
      if l == "" then next end
      l = l.split ' '
      #raise "more or less than 2 col at line " + i.to_s + " (hostsgen does not trim non-line comments)(plese use space to split only)" if not l.length == 2
      host = l[1]
      loc = l[0]
      @logs.push (HostsItem.new i, host, loc)
    end
  end
# parse a String, store data in self
# valid log should not be started with '#'
parse a String, store data in self
valid log should not be started with '#'
parse a String store data in self valid log should not be started with ' # '
def parse(hosts)
    hosts.lines.each_with_index do |l, i|
      l = l.strip
      if l[0] == '#' then next end
      if l == "" then next end
      l = l.split ' '
      host = l[1]
      loc = l[0]
      @logs.push (HostsItem.new i, host, loc)
    end
  end
def parse ( hosts ) hosts . lines . each_with_index do | l , i | l = l . strip if l [ 0 ] == '#' then next end if l == "" then next end l = l . split ' ' host = l [ 1 ] loc = l [ 0 ] @logs . push ( HostsItem . new i , host , loc ) end end
parse a String, store data in self
valid log should not be started with '#'
parse a String store data in self valid log should not be started with ' # '
#raise "more or less than 2 col at line " + i.to_s + " (hostsgen does not trim non-line comments)(plese use space to split only)" if not l.length == 2
hosts