From e1ec4bd2dad2bd22ad97cea398ae1cfcfae183a2 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Mon, 15 Oct 2007 19:27:16 +0100 Subject: mostly the arrangement of conditionals --- lib/sisu/v0/dbi.rb | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'lib/sisu/v0/dbi.rb') diff --git a/lib/sisu/v0/dbi.rb b/lib/sisu/v0/dbi.rb index 0ad4880a..17568ce6 100644 --- a/lib/sisu/v0/dbi.rb +++ b/lib/sisu/v0/dbi.rb @@ -70,13 +70,21 @@ module SiSU_DBI SiSU_Env::Load.new('dbi',true).prog @opt=opt @db=SiSU_Env::Info_db.new - if @opt.cmd =~/d/i or @opt.mod.inspect =~/--pg(?:sql)?|(?:sq)?lite/ - @sql_type=if @opt.cmd=~/D/ or @opt.mod.inspect =~/--pg(?:sql)?/; 'pg' - elsif @opt.cmd =~/d/ and @opt.mod.inspect =~/--(?:db[=-])?pg(?:sql)?/; 'pg' - elsif @opt.mod.inspect =~/--(?:sq)?lite/; 'sqlite' - elsif @opt.cmd =~/d/ and @opt.mod.inspect =~/--(?:db[=-])?(?:sq)?lite/; 'sqlite' + if @opt.cmd =~/d/i \ + or @opt.mod.inspect =~/--pg(?:sql)?|(?:sq)?lite/ + @sql_type=if @opt.cmd=~/D/ \ + or @opt.mod.inspect =~/--pg(?:sql)?/ + 'pg' + elsif @opt.cmd =~/d/ \ + and @opt.mod.inspect =~/--(?:db[=-])?pg(?:sql)?/ + 'pg' + elsif @opt.mod.inspect =~/--(?:sq)?lite/ + 'sqlite' + elsif @opt.cmd =~/d/ \ + and @opt.mod.inspect =~/--(?:db[=-])?(?:sq)?lite/ + 'sqlite' #elsif @opt.cmd =~/d/ and @opt.mod.select =~/--my(?:sql)?/; 'mysql' - else 'sqlite' + else 'sqlite' end end end -- cgit v1.2.3