From 31d9927f356d05c24d5495bb3e4d59597bcea6eb Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sat, 19 Dec 2009 16:28:24 -0500 Subject: minor code adjustments --- lib/sisu/v1/sst_to_s_xml_dom.rb | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) (limited to 'lib/sisu/v1/sst_to_s_xml_dom.rb') diff --git a/lib/sisu/v1/sst_to_s_xml_dom.rb b/lib/sisu/v1/sst_to_s_xml_dom.rb index 3db194b2..39ae7bcc 100644 --- a/lib/sisu/v1/sst_to_s_xml_dom.rb +++ b/lib/sisu/v1/sst_to_s_xml_dom.rb @@ -22,7 +22,7 @@ This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with @@ -214,13 +214,13 @@ WOK #{@tab*n2} #{@tab*n1}#{xml_content} WOK - if lv == 4 + if lv==4 @copen[1]=true @copen[2]=@copen[3]=false - elsif lv == 5 + elsif lv==5 @copen[2]=true @copen[3]=false - elsif lv == 6 + elsif lv==6 @copen[3]=true end end @@ -264,7 +264,7 @@ WOK when 4..6 6.downto(lv) do |x| y=x - 1 - if @level[x] == true + if @level[x]==true u=x - 3; @xml_contents_close[x]='' end @@ -275,11 +275,11 @@ WOK case lv when 4 @@xml[:body] << "#{@tab*5}\n" if @cont[1] - if @copen[3] == true # 6{ + if @copen[3]==true # 6{ [3,2,1].each { |v| @@xml[:body] << "#{@tab*n}\n" } - elsif @copen[2] == true # 5{ + elsif @copen[2]==true # 5{ [2,1].each { |v| @@xml[:body] << "#{@tab*n}\n" } - elsif @copen[1] == true # 4{ + elsif @copen[1]==true # 4{ [1].each { |v| @@xml[:body] << "#{@tab*n}\n" } end @cont[1]=true @@ -288,9 +288,9 @@ WOK or @cont[1] @@xml[:body] << "#{@tab*5}\n" end - if @copen[3] == true #6{ + if @copen[3]==true #6{ [3,2].each { |v| @@xml[:body] << "#{@tab*n}\n" } - elsif @copen[2] == true #5{ + elsif @copen[2]==true #5{ [2].each { |v| @@xml[:body] << "#{@tab*n}\n" } end @cont[2]=true @@ -479,7 +479,7 @@ WOK @content_flag=true 6.downto(4) do |x| y=x - 1; v=x - 3 - if @level[x] == true + if @level[x]==true if @content_flag==true @@xml[:body] << "#{@tab*5}\n#{@tab*y}\n" @content_flag=false @@ -490,9 +490,8 @@ WOK end 3.downto(1) do |x| y=x - 1 - @@xml[:body] << "#{@tab*y}\n" if @level[x] == true + @@xml[:body] << "#{@tab*y}\n" if @level[x]==true end - #6.downto(1) { |x| y=x - 1; @@xml[:body] << "#{@tab*y}\n" if @level[x] == true } end def pre rdf=SiSU_XML_tags::RDF.new(@md) @@ -559,7 +558,7 @@ WOK @sisu=new_file_data.scan(/.+/) SiSU_Env::SiSU_file.new(@md).mkdir filename_sxm=SiSU_Env::SiSU_file.new(@md,@md.fn[:sxd]).mkfile_pwd - if filename_sxm.class == File + if filename_sxm.class==File @sisu.each {|para| filename_sxm.puts para} filename_sxm.close else puts 'file not created, is directory writable?' -- cgit v1.2.3