aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v0/sysenv.rb
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2008-01-02 19:45:03 +0000
committerRalph Amissah <ralph@amissah.com>2008-01-02 19:45:03 +0000
commit084433a84b1d850187663e10492dda544923a681 (patch)
tree3f307efd7da95c9808bdc38dbe25d27e72b2be04 /lib/sisu/v0/sysenv.rb
parentyear updated to 2008 - happy new year (diff)
sql, postgresql allow tcp/ip connections, parameters from rc file, sisurc.yml
Diffstat (limited to 'lib/sisu/v0/sysenv.rb')
-rw-r--r--lib/sisu/v0/sysenv.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/sisu/v0/sysenv.rb b/lib/sisu/v0/sysenv.rb
index b4252e28..4187f6e9 100644
--- a/lib/sisu/v0/sysenv.rb
+++ b/lib/sisu/v0/sysenv.rb
@@ -2648,6 +2648,19 @@ WOK
else ''
end
end
+ def host
+ if defined? @rc['db']['postgresql']['host'] \
+ and @rc['db']['postgresql']['host']=~/(?:\S{1,3}\.){3}\S{1,3}|\S+?\.\S+/
+ @rc['db']['postgresql']['host']
+ else ''
+ end
+ end
+ def dbi
+ if psql.host =~/(?:\S{1,3}\.){3}\S{1,3}|\S+?\.\S+/
+ "DBI:Pg:database=#{psql.db};host=#{psql.host};port=#{psql.port}"
+ else "DBI:Pg:database=#{psql.db};port=#{psql.port}"
+ end
+ end
self
end
def mysql