def clean(cfg)
out = []
len1 = len2 = skip_blocks = 0
cfg.each_line do |line|
if line.match(/Up\sTime|Temperature|Power Suppl(ies|y)|Fans/i) && (@stackable == true)
skip_blocks = 1
skip_blocks = 2 if line =~ /:/
end
if skip_blocks.positive?
skip_blocks -= 1 if /\S/ !~ line
next
end
line = line.strip
if (match = line.match(/^(---+ +)(---+ +)/))
one, two = match.captures
len1 = one.length
len2 = two.length
end
if (match = line.match(/^(\d{1,2}) {3,}\d+ (.*)$/))
one, two = match.captures
line = one.to_s + (' ' * (len1 - one.length)) + "XXX" + (' ' * (len2 - 3)) + two.to_s
end
out << line
end
out = out.reject { |line| line[/Up\sTime/] }
out = comment out.join "\n"
out << "\n"
end