From 307ecb4df591aa675b71839014debf6e81d462e1 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sun, 18 May 2014 08:49:03 -0400 Subject: v5 v6: db, use symbols to identify sql engine --- lib/sisu/v6/db_create.rb | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'lib/sisu/v6/db_create.rb') diff --git a/lib/sisu/v6/db_create.rb b/lib/sisu/v6/db_create.rb index 661059a1..105f089c 100644 --- a/lib/sisu/v6/db_create.rb +++ b/lib/sisu/v6/db_create.rb @@ -66,10 +66,10 @@ module SiSU_DbCreate class Create < SiSU_DbColumns::Columns require_relative 'sysenv' # sysenv.rb @@dl=nil - def initialize(opt,conn,file,sql_type='pg') + def initialize(opt,conn,file,sql_type=:pg) @opt,@conn,@file,@sql_type=opt,conn,file,sql_type @cX=SiSU_Screen::Ansi.new(@opt.act[:color_state][:set]).cX - @comment=(@sql_type=='pg') \ + @comment=(@sql_type==:pg) \ ? (SiSU_DbCreate::Comment.new(@conn,@sql_type)) : nil @@dl ||=SiSU_Env::InfoEnv.new.digest.length @@ -84,7 +84,7 @@ module SiSU_DbCreate end def create_db @env=SiSU_Env::InfoEnv.new(@opt.fns) - tell=(@sql_type=='sqlite') \ + tell=(@sql_type==:sqlite) \ ? SiSU_Screen::Ansi.new(@opt.act[:color_state][:set],'Create SQLite db tables in:',%{"#{@file}"}) : SiSU_Screen::Ansi.new(@opt.act[:color_state][:set],'Create pgSQL db tables in:',%{"#{Db[:name_prefix]}#{@env.path.stub_pwd}"}) if (@opt.act[:verbose][:set]==:on \ @@ -92,7 +92,7 @@ module SiSU_DbCreate || @opt.act[:maintenance][:set]==:on) tell.dark_grey_title_hi end - SiSU_Env::SystemCall.new.create_pg_db(@env.path.stub_pwd) if @sql_type=='pg' #watch use of path.stub_pwd instead of stub + SiSU_Env::SystemCall.new.create_pg_db(@env.path.stub_pwd) if @sql_type==:pg #watch use of path.stub_pwd instead of stub end def output_dir? dir=SiSU_Env::InfoEnv.new('') @@ -105,7 +105,7 @@ module SiSU_DbCreate if (@opt.act[:verbose_plus][:set]==:on \ or @opt.act[:maintenance][:set]==:on) print %{ - currently using sisu dbi module + currently using sisu_dbi module to be populated from document files create tables metadata_and_text data import through ruby transfer @@ -343,7 +343,7 @@ module SiSU_DbCreate if (@opt.act[:verbose_plus][:set]==:on \ or @opt.act[:maintenance][:set]==:on) print %{ - currently using sisu dbi module + currently using sisu_dbi module to be populated from doc_objects files create tables urls data import through ruby transfer @@ -377,9 +377,9 @@ module SiSU_DbCreate end end class Comment < SiSU_DbColumns::Columns - def initialize(conn,sql_type='pg') + def initialize(conn,sql_type=:pg) @conn=conn - if sql_type =~ /pg/; psql + if sql_type == :pg then psql end end def psql -- cgit v1.2.3