aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v5/dbi.rb
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2013-10-23 23:40:45 -0400
committerRalph Amissah <ralph@amissah.com>2013-10-23 23:40:45 -0400
commitedd89902036bde18c91031470e19c871a182cf6d (patch)
tree1269e7b1660aa64896fc21768002e837233c2c24 /lib/sisu/v5/dbi.rb
parentv4 v5: version & changelog (diff)
v5: options & downstream, more use of opt.act instead of opt.cmd
* opt.act.*.set==:on instead of opt.cmd =~/\S/
Diffstat (limited to 'lib/sisu/v5/dbi.rb')
-rw-r--r--lib/sisu/v5/dbi.rb14
1 files changed, 7 insertions, 7 deletions
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