From 06520be4633f7ee3463c92615be3e11f0f21fa08 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sat, 21 Apr 2012 01:47:35 -0400 Subject: v3: db bugfix in maintenance mode (variable name reused) --- lib/sisu/v3/db_load_tuple.rb | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'lib/sisu/v3/db_load_tuple.rb') diff --git a/lib/sisu/v3/db_load_tuple.rb b/lib/sisu/v3/db_load_tuple.rb index c3273ace..5b263411 100644 --- a/lib/sisu/v3/db_load_tuple.rb +++ b/lib/sisu/v3/db_load_tuple.rb @@ -62,8 +62,8 @@ module SiSU_DbTuple class LoadDocuments require_relative 'param' # param.rb include SiSU_Param - def initialize(conn,col,opt,file) - @conn,@col,@opt,@file=conn,col,opt,file + def initialize(conn,col,opt,file_maint) + @conn,@col,@opt,@file_maint=conn,col,opt,file_maint @col[:lev]=@col[:lev].to_i unless @col[:lev]=~/^[1-6]/ \ or @col[:lev]==1 \ @@ -87,14 +87,14 @@ module SiSU_DbTuple end if @opt.cmd =~/M/ if @opt.cmd =~/V/ - puts @file.inspect + puts @file_maint.inspect puts sql_entry end - @file.puts sql_entry + @file_maint.puts sql_entry else if @opt.cmd =~/V/ puts sql_entry - @file.puts sql_entry + @file_maint.puts sql_entry end end if @opt.cmd =~/v/ @@ -115,8 +115,8 @@ module SiSU_DbTuple end end class LoadMetadata #< SiSU_DbColumns::Columns - def initialize(conn,id,md,file) - @conn,@id,@md,@file=conn,id,md,file + def initialize(conn,id,md,file_maint) + @conn,@id,@md,@file_maint=conn,id,md,file_maint @tp=SiSU_DbColumns::Columns.new(md) end def tuple @@ -291,40 +291,40 @@ tid) #{@id} );" if @md.opt.cmd =~/M/ - puts "maintenance mode on: creating sql transaction file (for last transaction set (document) only):\n\t#{@file.inspect}" - @file.puts sql_entry + puts "maintenance mode on: creating sql transaction file (for last transaction set (document) only):\n\t#{@file_maint.inspect}" + @file_maint.puts sql_entry else - @file.puts sql_entry if @md.opt.cmd =~/V/ + @file_maint.puts sql_entry if @md.opt.cmd =~/V/ end sql_entry end end class LoadUrls - def initialize(conn,f,u,id,opt,file) - @conn,@f,@u,@id,@opt,@file=conn,f,u,id,opt,file + def initialize(conn,f,u,id,opt,file_maint) + @conn,@f,@u,@id,@opt,@file_maint=conn,f,u,id,opt,file_maint end def tuple sql_entry="INSERT INTO urls (#{@f[:txt]} #{@f[:html_toc]} #{@f[:html_doc]} #{@f[:xhtml]} #{@f[:xml_sax]} #{@f[:xml_dom]} #{@f[:odf]} #{@f[:pdf_p]} #{@f[:pdf_l]} #{@f[:concordance]} #{@f[:latex_p]} #{@f[:latex_l]} #{@f[:manifest]} #{@f[:digest]} #{@f[:markup]} #{@f[:sisupod]} metadata_tid) " + "VALUES (#{@u[:txt]} #{@u[:html_toc]} #{@u[:html_doc]} #{@u[:xhtml]} #{@u[:xml_sax]} #{@u[:xml_dom]} #{@u[:odf]} #{@u[:pdf_p]} #{@u[:pdf_l]} #{@u[:concordance]} #{@u[:latex_p]} #{@u[:latex_l]} #{@u[:manifest]} #{@u[:digest]} #{@u[:markup]} #{@u[:sisupod]} #{@id});" if @opt.cmd =~/M/ - @file.puts sql_entry + @file_maint.puts sql_entry else - @file.puts sql_entry if @opt.cmd =~/V/ + @file_maint.puts sql_entry if @opt.cmd =~/V/ end sql_entry end end class LoadEndnotes - def initialize(conn,en,opt,file) - @conn,@en,@opt,@file=conn,en,opt,file + def initialize(conn,en,opt,file_maint) + @conn,@en,@opt,@file_maint=conn,en,opt,file_maint end def tuple sql_entry="INSERT INTO #{@en[:type]} (nid, document_lid, nr, clean, body, ocn, ocnd, ocns, metadata_tid, digest_clean) " + "VALUES ('#{@en[:id]}', '#{@en[:lid]}', '#{@en[:nr]}', '#{@en[:txt]}', '#{@en[:body]}', '#{@en[:ocn]}', '#{@en[:ocnd]}', '#{@en[:ocns]}', '#{@en[:id_t]}', '#{@en[:hash]}');" if @opt.cmd =~/M/ - @file.puts sql_entry + @file_maint.puts sql_entry else - @file.puts sql_entry if @opt.cmd =~/V/ + @file_maint.puts sql_entry if @opt.cmd =~/V/ end sql_entry end -- cgit v1.2.3