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/db_import.rb | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'lib/sisu/v3dv/db_import.rb') diff --git a/lib/sisu/v3dv/db_import.rb b/lib/sisu/v3dv/db_import.rb index adbe5af5..a2b66937 100644 --- a/lib/sisu/v3dv/db_import.rb +++ b/lib/sisu/v3dv/db_import.rb @@ -212,7 +212,7 @@ module SiSU_DbImport src=special_character_escape(src) @tp[:sisutxt_f],@tp[:sisutxt_i]='sisutxt, ',"'#{src}', " txt=clean_searchable_text(txt_arr) - #special_character_escape(txt) + #txt=special_character_escape(txt) @tp[:fulltxt_f],@tp[:fulltxt_i]='fulltxt, ',"'#{txt}', " end #% title @@ -268,7 +268,7 @@ module SiSU_DbImport @col[:lid]+=1 txt=endnotes(txt).extract_any @col[:body]=SiSU_FormatShared::CSS_Format.new(@md,data).lev4_minus - special_character_escape(@col[:body]) + @col[:body]=special_character_escape(@col[:body]) @col[:plaintext]=@col[:body].dup @col[:plaintext]=strip_markup(@col[:plaintext]) @col[:plaintext]=clean_searchable_text(@col[:plaintext]) @@ -302,7 +302,7 @@ module SiSU_DbImport @base_url="#{@env.url.root}/#{@md.fnb}/#{@hname}.html" txt=endnotes(txt).extract_any @col[:body]=SiSU_FormatShared::CSS_Format.new(@md,data).lev4_plus - special_character_escape(@col[:body]) + @col[:body]=special_character_escape(@col[:body]) @col[:plaintext]=@col[:body].dup @col[:plaintext]=strip_markup(@col[:plaintext]) @col[:plaintext]=clean_searchable_text(@col[:plaintext]) @@ -329,7 +329,7 @@ module SiSU_DbImport @base_url="#{@env.url.root}/#{@md.fnb}/#{@hname}.html" txt=endnotes(txt).extract_any @col[:body]=SiSU_FormatShared::CSS_Format.new(@md,data).lev4_plus - special_character_escape(@col[:body]) + @col[:body]=special_character_escape(@col[:body]) @col[:plaintext]=@col[:body].dup @col[:plaintext]=strip_markup(@col[:plaintext]) @col[:plaintext]=clean_searchable_text(@col[:plaintext]) @@ -356,7 +356,7 @@ module SiSU_DbImport @base_url="#{@env.url.root}/#{@md.fnb}/#{@hname}.html" txt=endnotes(txt).extract_any @col[:body]=SiSU_FormatShared::CSS_Format.new(@md,data).lev4_plus - special_character_escape(@col[:body]) + @col[:body]=special_character_escape(@col[:body]) @col[:plaintext]=@col[:body].dup @col[:plaintext]=strip_markup(@col[:plaintext]) @col[:plaintext]=clean_searchable_text(@col[:plaintext]) @@ -406,7 +406,7 @@ module SiSU_DbImport else SiSU_FormatShared::CSS_Format.new(@md,data).norm end - special_character_escape(@col[:body]) + @col[:body]=special_character_escape(@col[:body]) @col[:plaintext]=@col[:body].dup @col[:plaintext]=strip_markup(@col[:plaintext]) @col[:plaintext]=clean_searchable_text(@col[:plaintext]) @@ -424,9 +424,9 @@ module SiSU_DbImport nr,txt,digest_clean=$1,$2.strip,0 end @id_n+=1 - special_character_escape(txt) + txt=special_character_escape(txt) body=SiSU_FormatShared::CSS_Format.new(@md,data).endnote(nr,txt) - strip_markup(txt) + txt=strip_markup(txt) if txt.size > (SiSU_DbColumns::ColumnSize.new.endnote_clean - 1) puts "\n\nTOO LARGE (ENDNOTE - see error log)\n\n" open("#{Dir.pwd}/pg_documents_error_log",'a') do |error| @@ -463,9 +463,9 @@ module SiSU_DbImport nr,txt,digest_clean=$1,$2.strip,0 end @id_n+=1 - special_character_escape(txt) + txt=special_character_escape(txt) body=SiSU_FormatShared::CSS_Format.new(@md,data).endnote(nr,txt) - strip_markup(txt) + txt=strip_markup(txt) if txt.size > (SiSU_DbColumns::ColumnSize.new.endnote_clean - 1) puts "\n\nTOO LARGE (ENDNOTE - see error log)\n\n" open("#{Dir.pwd}/pg_documents_error_log",'a') do |error| @@ -502,9 +502,9 @@ module SiSU_DbImport nr,txt,digest_clean=$1,$2.strip,0 end @id_n+=1 - special_character_escape(txt) + txt=special_character_escape(txt) body=SiSU_FormatShared::CSS_Format.new(@md,data).endnote(nr,txt) - strip_markup(txt) + txt=strip_markup(txt) if txt.size > (SiSU_DbColumns::ColumnSize.new.endnote_clean - 1) puts "\n\nTOO LARGE (ENDNOTE - see error log)\n\n" open("#{Dir.pwd}/pg_documents_error_log",'a') do |error| @@ -568,14 +568,14 @@ module SiSU_DbImport : nil end def clean_text(base_url=nil) - if base_url - @txt.gsub!(/#{Mx[:en_a_o]}(\d+).+?#{Mx[:en_a_c]}/,%{\\1}) - @txt.gsub!(/#{Mx[:en_b_o]}([*]\d+).+?#{Mx[:en_b_c]}/,%{\\1}) - @txt.gsub!(/#{Mx[:en_b_o]}([+]\d+).+?#{Mx[:en_b_c]}/,%{\\1}) + @txt=if base_url + @txt.gsub(/#{Mx[:en_a_o]}(\d+).+?#{Mx[:en_a_c]}/,%{\\1}). + gsub(/#{Mx[:en_b_o]}([*]\d+).+?#{Mx[:en_b_c]}/,%{\\1}). + gsub(/#{Mx[:en_b_o]}([+]\d+).+?#{Mx[:en_b_c]}/,%{\\1}) else - @txt.gsub!(/#{Mx[:en_a_o]}(\d+).+?#{Mx[:en_a_c]}/,'\1') - @txt.gsub!(/#{Mx[:en_b_o]}([*]\d+).+?#{Mx[:en_b_c]}/,'\1') - @txt.gsub!(/#{Mx[:en_b_o]}([+]\d+).+?#{Mx[:en_b_c]}/,'\1') + @txt.gsub(/#{Mx[:en_a_o]}(\d+).+?#{Mx[:en_a_c]}/,'\1'). + gsub(/#{Mx[:en_b_o]}([*]\d+).+?#{Mx[:en_b_c]}/,'\1'). + gsub(/#{Mx[:en_b_o]}([+]\d+).+?#{Mx[:en_b_c]}/,'\1') end @txt end -- cgit v1.2.3