summaryrefslogtreecommitdiff
path: root/lib/nickserver/config.rb
diff options
context:
space:
mode:
authorAzul <azul@riseup.net>2016-06-08 12:44:38 +0200
committerAzul <azul@riseup.net>2016-06-08 12:54:23 +0200
commita89e2ba55399e6bddd9e052cf2064ed0056c958a (patch)
treec28ec332f9763f395a88db991defcae59fa46806 /lib/nickserver/config.rb
parent712c1d062c08a58ca8772aafcdc39d0281959b4a (diff)
refactor: use new couch_db classes from fetch_key
This moves all the em_http related stuff into a single adapter. We're also not using callback and errback inside fetch_key or server for couch requests anymore. Changing the interface for hkp to do the same will follow.
Diffstat (limited to 'lib/nickserver/config.rb')
-rw-r--r--lib/nickserver/config.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/nickserver/config.rb b/lib/nickserver/config.rb
index 13e284b..b1def7c 100644
--- a/lib/nickserver/config.rb
+++ b/lib/nickserver/config.rb
@@ -36,6 +36,21 @@ module Nickserver
self.validate
end
+ def self.couch_url
+ [ 'http://',
+ couch_auth,
+ couch_host,
+ ':',
+ couch_port,
+ '/',
+ couch_database
+ ].join
+ end
+
+ def self.couch_auth
+ "#{couch_user}:#{couch_password}@" if couch_user
+ end
+
private
def self.validate