Class: SonicOS
- Inherits:
-
Oxidized::Model
- Object
- Oxidized::Model
- SonicOS
- Defined in:
- lib/oxidized/model/sonicos.rb
Constant Summary
Constants inherited from Oxidized::Model
Oxidized::Model::METADATA_DEFAULT
Instance Attribute Summary
Attributes inherited from Oxidized::Model
Instance Method Summary collapse
Methods inherited from Oxidized::Model
cfg, #cfg, cfgs, clean, cmd, #cmd, cmds, comment, #comment, #expect, expect, expects, #expects, #get, inherited, #interpolate_string, metadata, #metadata, #output, post, pre, prompt, #prompt, #screenscrape, #send, #xmlcomment
Methods included from Oxidized::Config::Vars
Instance Method Details
#clean(cfg) ⇒ Object
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/oxidized/model/sonicos.rb', line 53 def clean(cfg) out = [] cfg.each_line do |line| next if line =~ /date \d{4}:\d{2}:\d{2}/ next if line =~ /time \d{2}:\d{2}:\d{2}/ 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+|\d+ \w+(?:, \d+ \w+)*)"/ next if line =~ /checksum \d+/ line = line[1..-1] if line[0] == "\r" out << line.strip end out = out.join "\n" out << "\n" end |