summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorytti <saku@ytti.fi>2015-09-26 13:46:55 -0500
committerytti <saku@ytti.fi>2015-09-26 13:46:55 -0500
commit576a0b1df455d14f4bde0d21c63a1a498248e485 (patch)
tree1cbf5734a629ad21be591bebc4fc6acc37425eca
parente70a1a02899cfc80d13dd88b075045cfa40b6f53 (diff)
parent02b3b8fca75861880f6b1205e7169a368b8cf06e (diff)
Merge pull request #197 from nickhilliard/master
fix white space and CR problems on xos model
-rw-r--r--lib/oxidized/model/xos.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/oxidized/model/xos.rb b/lib/oxidized/model/xos.rb
index 309340f..e4a1ed4 100644
--- a/lib/oxidized/model/xos.rb
+++ b/lib/oxidized/model/xos.rb
@@ -6,7 +6,9 @@ class XOS < Oxidized::Model
comment '# '
cmd :all do |cfg|
- cfg.each_line.to_a[1..-2].join
+ # xos inserts leading \r characters and other trailing white space.
+ # this deletes extraneous \r and trailing white space.
+ cfg.each_line.to_a[1..-2].map{|line|line.delete("\r").rstrip}.join("\n") + "\n"
end
cmd 'show version' do |cfg|