lib/cmdparse.rb in cmdparse-3.0.3 vs lib/cmdparse.rb in cmdparse-3.0.4

- old
+ new

@@ -45,11 +45,11 @@ # # See CmdParse::CommandParser and CmdParse::Command for the two important classes. module CmdParse # The version of this cmdparse implemention - VERSION = '3.0.3'.freeze + VERSION = '3.0.4'.freeze # Base class for all cmdparse errors. class ParseError < StandardError @@ -623,10 +623,10 @@ pattern = first_line_pattern content.split(/\n\n/).map do |paragraph| lines = [] until paragraph.empty? - unless (str = paragraph.slice!(pattern).sub(/[ \n]\z/, '')) + unless (str = paragraph.slice!(pattern)) and (str = str.sub(/[ \n]\z/, '')) str = paragraph.slice!(0, line_length) end lines << (lines.empty? && !indent_first_line ? '' : ' ' * indent) + str.tr("\n", ' ') pattern = other_lines_pattern end