Skip to content

Commit

Permalink
cogs: Parse couchdb credentials
Browse files Browse the repository at this point in the history
  • Loading branch information
iakat committed Sep 3, 2024
1 parent 329e8b1 commit 4cfcd05
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion cogs/couchdb_doc_updater.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,17 @@ class CouchdbDocUpdater
include Celluloid
include Celluloid::Logger

def parse_credentials(creds)
if creds
u, p = creds.split(':', 2)

{ :username => u, :password => p }
end
end

def initialize(path, uri, credentials)
@db = Analysand::Database.new(uri)
@credentials = credentials
@credentials = parse_credentials(credentials)
@path = path

Dir.foreach(@path) do |filename|
Expand Down

0 comments on commit 4cfcd05

Please sign in to comment.