From 9908930bc5649d559bb830936b8245b792eaf8f5 Mon Sep 17 00:00:00 2001 From: laurens Date: Mon, 11 Nov 2019 13:14:18 +0100 Subject: [PATCH] Fix multi-line each + use gsub! iso gsub --- lib/cmock_header_parser.rb | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/cmock_header_parser.rb b/lib/cmock_header_parser.rb index 70c7b45..1d15378 100644 --- a/lib/cmock_header_parser.rb +++ b/lib/cmock_header_parser.rb @@ -86,12 +86,11 @@ class CMockHeaderParser # Cleanup the function declarations # Not strictly necessary, it will compile just fine, but it can help during debugging m_lines = m.split(/\s*;\s*/).uniq - m_lines.each { - |m_line| + m_lines.each do |m_line| m_line.gsub!(/^\s+/, '') # remove extra white space from beginning of line - m_line.gsub(/\s+/, ' ') # remove remaining extra white space - m_line.gsub(/\n/, '') # remove newlines - } + m_line.gsub!(/\s+/, ' ') # remove remaining extra white space + m_line.gsub!(/\n/, '') # remove newlines + end m_lines.join(";\n") + ";" # Join the lines and add the last semicolon manually end