class SonicOS

Public Instance Methods

clean(cfg) click to toggle source
# File lib/redoxed/model/sonicos.rb, line 38
def clean(cfg)
  out = []
  cfg.each_line do |line|
    next if line =~ /system-time \"\d{2}\/\d{2}\/\d{4} \d{2}\:\d{2}:\d{2}.\d+\"/
    next if line =~ /system-uptime "(\s+up\s+\d+\s+)|(.*Days.*)"/
    next if line =~ /checksum \d+/

    line = line[1..-1] if line[0] == "\r"
    out << line.strip
  end
  out = out.join "\n"
  out << "\n"
end