summaryrefslogtreecommitdiff
path: root/lib/nickserver/config.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/nickserver/config.rb')
-rw-r--r--lib/nickserver/config.rb17
1 files changed, 16 insertions, 1 deletions
diff --git a/lib/nickserver/config.rb b/lib/nickserver/config.rb
index 46b6bef..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
@@ -59,7 +74,7 @@ module Nickserver
YAML.load(File.read(file_path)).each do |key, value|
begin
self.send("#{key}=", value)
- rescue NoMethodError => exc
+ rescue NoMethodError
STDERR.puts "ERROR in file #{file_path}, '#{key}' is not a valid option"
exit(1)
end