Skip to content

Instantly share code, notes, and snippets.

@a-chernykh
Created March 10, 2011 16:18
Show Gist options
  • Save a-chernykh/864379 to your computer and use it in GitHub Desktop.
Save a-chernykh/864379 to your computer and use it in GitHub Desktop.
def mongo=(server)
case server
when String
host, port = server.split(':')
@con = Mongo::Connection.new(host, port)
@db = @con.db('monque')
@mongo = @db.collection('monque')
@workers = @db.collection('workers')
@failures = @db.collection('failures')
@stats = @db.collection('stats')
add_indexes
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment