aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v0/sysenv.rb
diff options
context:
space:
mode:
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