aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v5/dbi.rb
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2014-05-18 09:39:31 -0400
committerRalph Amissah <ralph@amissah.com>2014-05-18 09:39:31 -0400
commit808c9c74a72b95e6272c8927cce839d89626ba47 (patch)
tree8047b7cee667ca0c2b6b9bb12a4c3e33a34704fa /lib/sisu/v5/dbi.rb
parentdebian/changelog (5.3.5-1) (diff)
parentv5 v6: cgi, sample search forms: use ruby-pg & ruby-sqlite3; remove ruby-dbi (diff)
Merge tag 'sisu_5.3.6' into debian/sid
SiSU 5.3.6
Diffstat (limited to 'lib/sisu/v5/dbi.rb')
-rw-r--r--lib/sisu/v5/dbi.rb16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/sisu/v5/dbi.rb b/lib/sisu/v5/dbi.rb
index 1ab9bc9c..737f02fd 100644
--- a/lib/sisu/v5/dbi.rb
+++ b/lib/sisu/v5/dbi.rb
@@ -79,22 +79,22 @@ module SiSU_DBI
@sql_type=if @opt.cmd=~/D/ \
or @opt.mod.inspect =~/--pg(?:sql)?/
maintenance_check(@opt,__FILE__,__LINE__) if @opt.act[:maintenance][:set]==:on
- 'pg'
+ :pg
elsif @opt.cmd =~/d/ \
and @opt.mod.inspect =~/--(?:db[=-])?pg(?:sql)?/
maintenance_check(@opt,__FILE__,__LINE__) if @opt.act[:maintenance][:set]==:on
- 'pg'
+ :pg
elsif @opt.cmd=~/d/ \
or @opt.mod.inspect =~/--(?:sq)?lite/
maintenance_check(@opt,__FILE__,__LINE__) if @opt.act[:maintenance][:set]==:on
- 'sqlite'
+ :sqlite
elsif @opt.cmd =~/d/ \
and @opt.mod.inspect =~/--(?:db[=-])?(?:sq)?lite/
maintenance_check(@opt,__FILE__,__LINE__) if @opt.act[:maintenance][:set]==:on
- 'sqlite'
+ :sqlite
else
maintenance_check(@opt,__FILE__,__LINE__) if @opt.act[:maintenance][:set]==:on
- 'sqlite'
+ :sqlite
end
end
end
@@ -107,7 +107,7 @@ module SiSU_DBI
begin
@conn=@db.psql.conn_dbi
rescue
- if @opt.mod.inspect=~/--(createall|create)/
+ if @opt.mod.inspect=~/--(?:createall|create)/
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
@@ -130,8 +130,8 @@ manually create the database: "#{cX.green}#{@db.db}#{cX.off}" if it does not yet
end
def connect
case @sql_type
- when /pg/ then read_psql
- when /sqlite/ then read_sqlite
+ when :pg then read_psql #read_pg
+ when :sqlite then read_sqlite
end
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