Skip to content

Commit 4cfcd05

Browse files
committed
cogs: Parse couchdb credentials
1 parent 329e8b1 commit 4cfcd05

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

cogs/couchdb_doc_updater.rb

+9-1
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,17 @@ class CouchdbDocUpdater
88
include Celluloid
99
include Celluloid::Logger
1010

11+
def parse_credentials(creds)
12+
if creds
13+
u, p = creds.split(':', 2)
14+
15+
{ :username => u, :password => p }
16+
end
17+
end
18+
1119
def initialize(path, uri, credentials)
1220
@db = Analysand::Database.new(uri)
13-
@credentials = credentials
21+
@credentials = parse_credentials(credentials)
1422
@path = path
1523

1624
Dir.foreach(@path) do |filename|

0 commit comments

Comments
 (0)