class AOSW

Public Instance Methods

clean(cfg) click to toggle source
# File lib/redoxed/model/aosw.rb, line 105
def clean(cfg)
  out = []
  cfg.each_line do |line|
    # drop the temperature, fan speed and voltage, which change each run
    next if line =~ /Output \d Config/i
    next if line =~ /(Tachometers|Temperatures|Voltages)/
    next if line =~ /((Card|CPU) Temperature|Chassis Fan|VMON1[0-9])/
    next if line =~ /[0-9]+\s+(RPMS?|m?V|C)/i

    out << line.strip
  end
  out = comment out.join "\n"
  out << "\n"
end
rstrip_cfg(cfg) click to toggle source
# File lib/redoxed/model/aosw.rb, line 96
def rstrip_cfg(cfg)
  out = []
  cfg.each_line do |line|
    out << line.rstrip
  end
  out = out.join "\n"
  out << "\n"
end