diff options
author | Ralph Amissah <ralph@amissah.com> | 2011-09-05 10:36:28 -0400 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2011-09-05 10:41:45 -0400 |
commit | 7bc559f85cb0b6c6f4cdfe127a386573b4c5d8ce (patch) | |
tree | 4d7832a654779710edbf304437be8ee8ab0e6dc7 /lib/sisu/v3/db_import.rb | |
parent | v3: 3.0.17 version & changelog "opened" (diff) |
v3: unix conditional tests (? :) remove line break markers before : cosmetic
Diffstat (limited to 'lib/sisu/v3/db_import.rb')
-rw-r--r-- | lib/sisu/v3/db_import.rb | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/sisu/v3/db_import.rb b/lib/sisu/v3/db_import.rb index ac6f0104..856817e1 100644 --- a/lib/sisu/v3/db_import.rb +++ b/lib/sisu/v3/db_import.rb @@ -88,14 +88,14 @@ module SiSU_DB_import @db=SiSU_Env::Info_db.new if @sql_type=='sqlite' @driver_sqlite3=(@conn.inspect.match(/^(.{10})/)[1]==@db.sqlite.conn_sqlite3.inspect.match(/^(.{10})/)[1]) \ - ? true \ + ? true : false end sql='SELECT MAX(lid) FROM doc_objects' begin @col[:lid] ||=0 @col[:lid]=@driver_sqlite3 \ - ? @conn.execute( sql ).join.to_i \ + ? @conn.execute( sql ).join.to_i : @conn.execute( sql ) { |x| x.fetch_all.flatten[0] } rescue puts "#{__FILE__}:#{__LINE__}" if @opt.cmd =~/M/ @@ -104,7 +104,7 @@ module SiSU_DB_import sql='SELECT MAX(nid) FROM endnotes' begin @id_n=@driver_sqlite3 \ - ? @conn.execute( sql ).join.to_i \ + ? @conn.execute( sql ).join.to_i : @id_n=@conn.execute( sql ) { |x| x.fetch_all.flatten[0] } @id_n ||=0 rescue @@ -128,7 +128,7 @@ module SiSU_DB_import AND metadata_and_text.language_document_char = '#{@opt.lng}' ;} file_exist=@sql_type=~/sqlite/ \ - ? @conn.get_first_value(select_first_match) \ + ? @conn.get_first_value(select_first_match) : @conn.select_one(select_first_match) if not file_exist t_d=[] # transaction_data @@ -554,17 +554,17 @@ module SiSU_DB_import end def standard x=(@txt =~/#{Mx[:en_a_o]}.+?#{Mx[:en_a_c]}/) \ - ? @txt.scan(/#{Mx[:en_a_o]}(\d+).+?#{Mx[:en_a_c]}/) \ + ? @txt.scan(/#{Mx[:en_a_o]}(\d+).+?#{Mx[:en_a_c]}/) : nil end def asterisk x=(@txt =~/#{Mx[:en_b_o]}\*.+?#{Mx[:en_b_c]}/) \ - ? @txt.scan(/#{Mx[:en_b_o]}[*](\d+).+?#{Mx[:en_b_c]}/) \ + ? @txt.scan(/#{Mx[:en_b_o]}[*](\d+).+?#{Mx[:en_b_c]}/) : nil end def plus x=(@txt =~/#{Mx[:en_b_o]}\+.+?#{Mx[:en_b_c]}/) \ - ? @txt.scan(/#{Mx[:en_b_o]}[+](\d+).+?#{Mx[:en_b_c]}/) \ + ? @txt.scan(/#{Mx[:en_b_o]}[+](\d+).+?#{Mx[:en_b_c]}/) : nil end def clean_text(base_url=nil) |