From 21f5e220b738add01c19c2b15a76f2d240b2c0d5 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 23 Jan 2012 21:42:25 -0500 Subject: v3dv: replace use of most ruby exclamation (!) method actions --- lib/sisu/v3dv/html_segments.rb | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'lib/sisu/v3dv/html_segments.rb') diff --git a/lib/sisu/v3dv/html_segments.rb b/lib/sisu/v3dv/html_segments.rb index 20ab0726..ba825ae4 100644 --- a/lib/sisu/v3dv/html_segments.rb +++ b/lib/sisu/v3dv/html_segments.rb @@ -106,12 +106,12 @@ module SiSU_HTML_Seg filename_seg << @minitoc << @seg[:headings] << @seg[:main] << "\n\n" end filename_seg << @seg[:tail] << @seg[:tocband_bannerless] << @seg[:credits] - filename_seg.flatten!.compact! + filename_seg=filename_seg.flatten.compact #watch filename_seg.each do |str| unless str =~/\A\s*\Z/ - str.strip! - str.gsub!(Xx[:html_relative2],@file.path_rel_links.html_seg_2) - str.gsub!(Xx[:html_relative1],@file.path_rel_links.html_seg_1) + str=str.strip. + gsub(Xx[:html_relative2],@file.path_rel_links.html_seg_2). + gsub(Xx[:html_relative1],@file.path_rel_links.html_seg_1) @output_seg_file << str end end @@ -331,7 +331,7 @@ module SiSU_HTML_Seg txt_obj={ txt: @@heading1, ocn_display: @p_num.ocn_display } format_seg=SiSU_HTML_Format::FormatSeg.new(@md,txt_obj) @@seg[:headings] << format_seg.title_heading1.gsub(clean,'') - @@heading1.gsub!(/  [\d*+]+<\/sup> <\/a>/,'') + @@heading1=@@heading1.gsub(/  [\d*+]+<\/sup> <\/a>/,'') end if @@is2==1 heading2=@@heading2 @@ -342,7 +342,7 @@ module SiSU_HTML_Seg txt_obj={ txt: heading2, ocn_display: @p_num.ocn_display } format_seg=SiSU_HTML_Format::FormatSeg.new(@md,txt_obj) @@seg[:headings] << format_seg.title_heading2.gsub(clean,'') - @@heading2.gsub!(/  [\d*+]+<\/sup> <\/a>/,'') + @@heading2=@@heading2.gsub(/  [\d*+]+<\/sup> <\/a>/,'') end if @@is3==1 heading3=@@heading3 @@ -353,7 +353,7 @@ module SiSU_HTML_Seg txt_obj={ txt: heading3, ocn_display: @p_num.ocn_display } format_seg=SiSU_HTML_Format::FormatSeg.new(@md,txt_obj) @@seg[:headings] << format_seg.title_heading3.gsub(clean,'') - @@heading3.gsub!(/  [\d*+]+<\/sup> <\/a>/,'') + @@heading3=@@heading3.gsub(/  [\d*+]+<\/sup> <\/a>/,'') end if @@is4==1 heading4=@@heading4 @@ -421,13 +421,13 @@ module SiSU_HTML_Seg sto.break end if @md.flag_separate_endnotes - dob.obj.gsub!(/"\s+href="#_(\d+)">/,%{" href=\"endnotes#{Sfx[:html]}#_\\1">}) #endnote- twice #removed file type + dob.obj=dob.obj.gsub(/"\s+href="#_(\d+)">/,%{" href=\"endnotes#{Sfx[:html]}#_\\1">}) #endnote- twice #removed file type end if dob.obj !~/#{@vz.margin_txt_w1}|#{@vz.margin_txt_w2}/ if dob.is =~/heading|para/ and (not dob.ocn or dob.ocn.to_s.empty?) format_seg=SiSU_HTML_Format::FormatSeg.new(@md,dob) end - dob.obj.gsub!(/\s*(-\{{2}~\d+|<:e[:_]\d+>).*/,'') #potentially dagerous - removes all paragraphs with #?? workpoint + dob.obj=dob.obj.gsub(/\s*(-\{{2}~\d+|<:e[:_]\d+>).*/,'') #potentially dagerous - removes all paragraphs with #?? workpoint if dob.obj =~/ / #endnote- note- format_seg=SiSU_HTML_Format::FormatSeg.new(@md,dob) dob=format_seg.no_paranum @@ -471,7 +471,7 @@ module SiSU_HTML_Seg end def get_subtoc_endnotes(data) #get endnotes & sub-table of contents subtoc data.each do |dob| - dob.obj.gsub!(/(.+?)<\/a>/mi,'\1') + dob.obj=dob.obj.gsub(/(.+?)<\/a>/mi,'\1') if @md.flag_auto_endnotes if (dob.is=='heading' or dob.is=='heading_insert') \ and dob.ln.to_s =~/^[1234]/ \ @@ -523,7 +523,7 @@ module SiSU_HTML_Seg if dob.obj=~/#{Mx[:en_b_o]}[+]\d+\s.+?#{Mx[:en_b_c]}/m endnote_array << dob.obj.scan(/#{Mx[:en_b_o]}[+]\d+\s.+?#{Mx[:en_b_c]}/m) end - endnote_array.flatten!.compact! #check compacting + endnote_array=endnote_array.flatten.compact #watch, check compacting endnote_array.each do |note| note_match=note.dup note_match_seg=note.dup @@ -548,7 +548,7 @@ module SiSU_HTML_Seg note_match_all_seg=format_seg.endnote_seg_body(@@fn) #BUG WATCH 200408 @@seg[:endnote_all] << note_match_all_seg end - dob.obj.gsub!(/(?:#{Mx[:en_a_o]}.+?#{Mx[:en_a_c]}|#{Mx[:en_b_o]}.+?#{Mx[:en_b_c]})\s*/m,' ') + dob.obj=dob.obj.gsub(/(?:#{Mx[:en_a_o]}.+?#{Mx[:en_a_c]}|#{Mx[:en_b_o]}.+?#{Mx[:en_b_c]})\s*/m,' ') end end end -- cgit v1.2.3