diff options
author | Ralph Amissah <ralph@amissah.com> | 2014-05-18 09:39:31 -0400 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2014-05-18 09:39:31 -0400 |
commit | 808c9c74a72b95e6272c8927cce839d89626ba47 (patch) | |
tree | 8047b7cee667ca0c2b6b9bb12a4c3e33a34704fa /lib/sisu/v6/sysenv.rb | |
parent | debian/changelog (5.3.5-1) (diff) | |
parent | v5 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/v6/sysenv.rb')
-rw-r--r-- | lib/sisu/v6/sysenv.rb | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/lib/sisu/v6/sysenv.rb b/lib/sisu/v6/sysenv.rb index 8c819d9b..2c2a8c10 100644 --- a/lib/sisu/v6/sysenv.rb +++ b/lib/sisu/v6/sysenv.rb @@ -249,7 +249,9 @@ module SiSU_Env $:.each do |reqpath| if FileTest.exist?("#{reqpath}/#{@prog}.rb") load_prog=true + #SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).ok("#{reqpath}/#{@prog}.rb loaded") break + #else SiSU_Utils::CodeMarker.new(__LINE__,__FILE__,:fuchsia).warn("#{reqpath}/#{@prog}.rb not found") end end if load_prog \ @@ -2673,7 +2675,7 @@ WOK else (opt.mod.inspect =~/--db[=-]["']?sqlite/) \ ? "#{Db[:name_prefix_db]}sqlite.cgi" \ - : "#{Db[:name_prefix_db]}pgsql.cgi" + : "#{Db[:name_prefix_db]}pg.cgi" end end def sample_search_form_title(organised_by=:language) @@ -4428,6 +4430,9 @@ WOK : '' end def dbi + PG::Connection.open(:dbname => psql.db) + end + def dbi_ (psql.host =~/(?:\S{1,3}\.){3}\S{1,3}|\S+?\.\S+/) \ ? "DBI:Pg:database=#{psql.db};host=#{psql.host};port=#{psql.port}" : "DBI:Pg:database=#{psql.db};port=#{psql.port}" @@ -4435,19 +4440,11 @@ WOK def conn_dbi DBI.connect(psql.dbi,psql.user,psql.db) end - self - end - def mysql - def db - #"#{Db[:name_prefix]}#{@pwd_stub}" - end - def port - '**' + def conn_pg + require 'pg' + PG::Connection.new(dbname: psql.db, port: psql.port) end - def dbi - "dbi:Mysql:database=#{mysql.db};port=#{mysql.port}" - end - self + self end def sqlite def db |