From e1ec4bd2dad2bd22ad97cea398ae1cfcfae183a2 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 15 Oct 2007 19:27:16 +0100 Subject: mostly the arrangement of conditionals --- lib/sisu/v0/shared_txt.rb | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'lib/sisu/v0/shared_txt.rb') diff --git a/lib/sisu/v0/shared_txt.rb b/lib/sisu/v0/shared_txt.rb index 6af436b0..e5acf36d 100644 --- a/lib/sisu/v0/shared_txt.rb +++ b/lib/sisu/v0/shared_txt.rb @@ -81,15 +81,18 @@ module SiSU_text_utils word="\n" @n_char_max_extend = @n_char_max + out[line].length line=line - elsif (out[line].length + word.length) > (@n_char_max_extend - @n_indent) and out[line] =~/\S+/ + elsif (out[line].length + word.length) > (@n_char_max_extend - @n_indent) \ + and out[line] =~/\S+/ @n_char_max_extend = @n_char_max out[line].squeeze!(' ') line += 1 end if word - out[line]=if out[line] and out[line] !~/\S+$/m + out[line]=if out[line] \ + and out[line] !~/\S+$/m "#{out[line]}#{word}" - elsif out[line] and out[line] =~/\S+/ + elsif out[line] \ + and out[line] =~/\S+/ "#{out[line]} #{word}" else "#{word.strip}" end @@ -114,7 +117,8 @@ module SiSU_text_utils @md,@p=md,para end def extract(tag,tag_content,type,attrib) - dc=if dc_tag and dc_content + dc=if dc_tag \ + and dc_content [dc_tag,dc_content,{dc_tag=>dc_content}] else nil end -- cgit v1.2.3