From edd89902036bde18c91031470e19c871a182cf6d Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Wed, 23 Oct 2013 23:40:45 -0400 Subject: v5: options & downstream, more use of opt.act instead of opt.cmd * opt.act.*.set==:on instead of opt.cmd =~/\S/ --- lib/sisu/v5/dbi.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'lib/sisu/v5/dbi.rb') diff --git a/lib/sisu/v5/dbi.rb b/lib/sisu/v5/dbi.rb index cc2b614e..e59a09b7 100644 --- a/lib/sisu/v5/dbi.rb +++ b/lib/sisu/v5/dbi.rb @@ -77,22 +77,22 @@ module SiSU_DBI or @opt.mod.inspect =~/--(pg(?:sql)?|(?:sq)?lite)/ @sql_type=if @opt.cmd=~/D/ \ or @opt.mod.inspect =~/--pg(?:sql)?/ - maintenance_check(@opt,__FILE__,__LINE__) if @opt.cmd.inspect =~/M/ + maintenance_check(@opt,__FILE__,__LINE__) if @opt.act[:maintenance][:set]==:on 'pg' elsif @opt.cmd =~/d/ \ and @opt.mod.inspect =~/--(?:db[=-])?pg(?:sql)?/ - maintenance_check(@opt,__FILE__,__LINE__) if @opt.cmd.inspect =~/M/ + maintenance_check(@opt,__FILE__,__LINE__) if @opt.act[:maintenance][:set]==:on 'pg' elsif @opt.cmd=~/d/ \ or @opt.mod.inspect =~/--(?:sq)?lite/ - maintenance_check(@opt,__FILE__,__LINE__) if @opt.cmd.inspect =~/M/ + maintenance_check(@opt,__FILE__,__LINE__) if @opt.act[:maintenance][:set]==:on 'sqlite' elsif @opt.cmd =~/d/ \ and @opt.mod.inspect =~/--(?:db[=-])?(?:sq)?lite/ - maintenance_check(@opt,__FILE__,__LINE__) if @opt.cmd.inspect =~/M/ + maintenance_check(@opt,__FILE__,__LINE__) if @opt.act[:maintenance][:set]==:on 'sqlite' else - maintenance_check(@opt,__FILE__,__LINE__) if @opt.cmd.inspect =~/M/ + maintenance_check(@opt,__FILE__,__LINE__) if @opt.act[:maintenance][:set]==:on 'sqlite' end end @@ -107,7 +107,7 @@ module SiSU_DBI @conn=@db.psql.conn_dbi rescue if @opt.mod.inspect=~/--(createall|create)/ - cX=SiSU_Screen::Ansi.new(@opt.cmd).cX + cX=SiSU_Screen::Ansi.new(@opt.act[:color_state][:set]).cX puts <<-WOK manually create the database: "#{cX.green}#{@db.db}#{cX.off}" if it does not yet exist #{cX.yellow}createdb #{@db.db}#{cX.off} @@ -129,7 +129,7 @@ manually create the database: "#{cX.green}#{@db.db}#{cX.off}" if it does not yet when /pg/; read_psql when /sqlite/; read_sqlite end - SiSU_Screen::Ansi.new(@opt.cmd,"DBI (#{@sql_type}) #{@opt.mod}",@opt.fno).dbi_title unless @opt.cmd =~/q/ + SiSU_Screen::Ansi.new(@opt.act[:color_state][:set],"DBI (#{@sql_type}) #{@opt.mod}",@opt.fno).dbi_title unless @opt.act[:quiet][:set]==:on begin SiSU_DbDBI::Case.new(@opt,@conn,@sql_type).cases rescue -- cgit v1.2.3