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_node.rb | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) (limited to 'lib/sisu/v1/sst_to_s_xml_node.rb') diff --git a/lib/sisu/v1/sst_to_s_xml_node.rb b/lib/sisu/v1/sst_to_s_xml_node.rb index 09e9f740..3cbd1156 100644 --- a/lib/sisu/v1/sst_to_s_xml_node.rb +++ b/lib/sisu/v1/sst_to_s_xml_node.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 @@ -203,10 +203,10 @@ WOK @@parent[:ocn] end def prt_node - parent.node.each_with_index { |a,n| puts "n.#{n} a.#{a}" unless n == 0 } #x == node + parent.node.each_with_index { |a,n| puts "n.#{n} a.#{a}" unless n==0 } #x==node end def prt_ocn - parent.ocn.each_with_index { |a,n| puts "n.#{n} a.#{a}" unless n == 0 } #x == node + parent.ocn.each_with_index { |a,n| puts "n.#{n} a.#{a}" unless n==0 } #x==node end self end @@ -233,10 +233,10 @@ WOK end if lv.inspect =~/^[1-6]/; @@current=lv end - if o.node == 1 \ - or lv == 1 + if o.node==1 \ + or lv==1 @@parent[:node][o.node]=0 - elsif @@current == lv \ + elsif @@current==lv \ and @@current !=nil if @node[:no][lv-1] != nil @@parent[:node][o.node]=@node[:no][lv-1] @@ -246,14 +246,14 @@ WOK @@parent[:node][o.node]=@node[:no][lv-3] else puts 'error' end - elsif lv == nil - if o.ocn.class == Fixnum \ + elsif lv==nil + if o.ocn.class==Fixnum \ and @@current @@parent[:node][o.node]=@node[:no][@@current] end else puts 'error' end - if @@current == lv \ + if @@current==lv \ and @@current !=nil if @node[:ocn][lv-1] != nil @@parent[:ocn][o.ocn]=@node[:ocn][lv-1] @@ -263,8 +263,8 @@ WOK @@parent[:ocn][o.ocn]=@node[:ocn][lv-3] else puts 'error' end - elsif lv == nil - if o.ocn.class == Fixnum \ + elsif lv==nil + if o.ocn.class==Fixnum \ and @@current @@parent[:ocn][o.ocn]=@node[:ocn][@@current] end @@ -274,7 +274,7 @@ WOK #def node_structure(o='',para='',lv='',hname='') #extracted endnotes # if o.ocn # lv=lv.to_i - # lv=nil if lv == 0 + # lv=nil if lv==0 # build_relationships(o,lv) # end #end @@ -284,7 +284,7 @@ WOK lv=lv.to_i n=lv - 1 n3=lv + 2 - lv=nil if lv == 0 + lv=nil if lv==0 embedded_endnotes(para) if para[@regx] paragraph="#{para[@regx,2]}" @@ -533,13 +533,12 @@ WOK end 6.downto(4) do |x| y=x - 1; v=x - 3 - @@xml[:body] << "#{@tab*5}\n#{@tab*y}\n" if @level[x] == true + @@xml[:body] << "#{@tab*5}\n#{@tab*y}\n" if @level[x]==true 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) @@ -591,7 +590,7 @@ WOK @sisu=new_file_data.scan(/.+/) SiSU_Env::SiSU_file.new(@md).mkdir filename_sxm=SiSU_Env::SiSU_file.new(@md,@md.fn[:sxn]).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