From 83137da0f259e8366eba7f626319b5a5b9b27d6d Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Thu, 19 Jun 2014 19:17:23 -0400 Subject: v5 v6: indent spaces, minor --- lib/sisu/v5/xml_docbook5.rb | 74 ++++++++++++++++++++++----------------------- 1 file changed, 37 insertions(+), 37 deletions(-) (limited to 'lib/sisu/v5/xml_docbook5.rb') diff --git a/lib/sisu/v5/xml_docbook5.rb b/lib/sisu/v5/xml_docbook5.rb index 45e6f0cf..98450520 100644 --- a/lib/sisu/v5/xml_docbook5.rb +++ b/lib/sisu/v5/xml_docbook5.rb @@ -127,8 +127,8 @@ module SiSU_XML_Docbook_Book structure_build_collapsed(data) #tail end - def space - ' ' + def spaces + Ax[:spaces] end def tags # collapsed --> @@ -176,7 +176,7 @@ module SiSU_XML_Docbook_Book end def output(o,comment='') puts o.lc == (0..6) \ - ? "#{space*o.lc}<#{o.lc}>[#{o.ocn}] #{o.ln} #{o.obj}#{comment}" + ? "#{spaces*o.lc}<#{o.lc}>[#{o.ocn}] #{o.ln} #{o.obj}#{comment}" : "<#{o.lc}>[#{o.ocn}] #{o.ln} #{o.obj}#{comment}" end def structure_collapsed(data) @@ -213,21 +213,21 @@ module SiSU_XML_Docbook_Book @splv=o.lc tag_id=o.tags[0] ? %{ id="#{o.tags[0]}" } : '' if doc_position ==:head - filename_docbook.puts %{#{space*o.lc}} + filename_docbook.puts %{#{spaces*o.lc}} doc_position=:body_and_tail else filename_docbook.puts structure_build_tag_close(o.lc,h) - filename_docbook.puts %{#{space*(o.lc)}<#{tags.docbook(o.lc,chlv)}#{tag_id}> -#{space*o.lc} + filename_docbook.puts %{#{spaces*(o.lc)}<#{tags.docbook(o.lc,chlv)}#{tag_id}> +#{spaces*o.lc} } end filename_docbook.puts SiSU_TextUtils::Wrap.new(o.obj + ocn,80,(@splv*2+2)).line_wrap - filename_docbook.puts %{#{space*o.lc}} + filename_docbook.puts %{#{spaces*o.lc}} h=o.lc elsif (o.of ==:para or o.of ==:block) - filename_docbook.puts "#{space*(@splv)}" + filename_docbook.puts "#{spaces*(@splv)}" filename_docbook.puts SiSU_TextUtils::Wrap.new(o.obj + ocn,80,(@splv*2+2)).line_wrap - filename_docbook.puts "#{space*(@splv)}" + filename_docbook.puts "#{spaces*(@splv)}" end end filename_docbook.puts structure_build_tag_close(0,h) @@ -237,40 +237,40 @@ module SiSU_XML_Docbook_Book x=[] case h when 0 - x << "#{space*0}" if (lc <= 0) + x << "#{spaces*0}" if (lc <= 0) when 1 - x << "#{space*1}" if (lc <= 1) - x << "#{space*0}" if (lc <= 0) + x << "#{spaces*1}" if (lc <= 1) + x << "#{spaces*0}" if (lc <= 0) when 2 - x << "#{space*2}" if (lc <= 2) - x << "#{space*1}" if (lc <= 1) - x << "#{space*0}" if (lc <= 0) + x << "#{spaces*2}" if (lc <= 2) + x << "#{spaces*1}" if (lc <= 1) + x << "#{spaces*0}" if (lc <= 0) when 3 - x << "#{space*3}" if (lc <= 3) - x << "#{space*2}" if (lc <= 2) - x << "#{space*1}" if (lc <= 1) - x << "#{space*0}" if (lc <= 0) + x << "#{spaces*3}" if (lc <= 3) + x << "#{spaces*2}" if (lc <= 2) + x << "#{spaces*1}" if (lc <= 1) + x << "#{spaces*0}" if (lc <= 0) when 4 - x << "#{space*4}" if (lc <= 4) - x << "#{space*3}" if (lc <= 3) - x << "#{space*2}" if (lc <= 2) - x << "#{space*1}" if (lc <= 1) - x << "#{space*0}" if (lc <= 0) + x << "#{spaces*4}" if (lc <= 4) + x << "#{spaces*3}" if (lc <= 3) + x << "#{spaces*2}" if (lc <= 2) + x << "#{spaces*1}" if (lc <= 1) + x << "#{spaces*0}" if (lc <= 0) when 5 - x << "#{space*5}" if (lc <= 5) - x << "#{space*4}" if (lc <= 4) - x << "#{space*5}" if (lc <= 3) - x << "#{space*2}" if (lc <= 2) - x << "#{space*1}" if (lc <= 1) - x << "#{space*0}" if (lc <= 0) + x << "#{spaces*5}" if (lc <= 5) + x << "#{spaces*4}" if (lc <= 4) + x << "#{spaces*5}" if (lc <= 3) + x << "#{spaces*2}" if (lc <= 2) + x << "#{spaces*1}" if (lc <= 1) + x << "#{spaces*0}" if (lc <= 0) when 6 - x << "#{space*6}" if (lc <= 6) - x << "#{space*5}" if (lc <= 5) - x << "#{space*4}" if (lc <= 4) - x << "#{space*3}" if (lc <= 3) - x << "#{space*2}" if (lc <= 2) - x << "#{space*1}" if (lc <= 1) - x << "#{space*0}" if (lc <= 0) + x << "#{spaces*6}" if (lc <= 6) + x << "#{spaces*5}" if (lc <= 5) + x << "#{spaces*4}" if (lc <= 4) + x << "#{spaces*3}" if (lc <= 3) + x << "#{spaces*2}" if (lc <= 2) + x << "#{spaces*1}" if (lc <= 1) + x << "#{spaces*0}" if (lc <= 0) end x.join("\n") end -- cgit v1.2.3