Files
metasploit-gs/lib/anemone/storage.rb
T
HD Moore b3cc6e19b6 Initial import of an Anemone snapshot
git-svn-id: file:///home/svn/framework3/trunk@10924 4d416f70-5f16-0410-b530-b9f4589650da
2010-11-06 04:34:43 +00:00

35 lines
882 B
Ruby

module Anemone
module Storage
def self.Hash(*args)
hash = Hash.new(*args)
# add close method for compatibility with Storage::Base
class << hash; def close; end; end
hash
end
def self.PStore(*args)
require 'anemone/storage/pstore'
self::PStore.new(*args)
end
def self.TokyoCabinet(file = 'anemone.tch')
require 'anemone/storage/tokyo_cabinet'
self::TokyoCabinet.new(file)
end
def self.MongoDB(mongo_db = nil, collection_name = 'pages')
require 'anemone/storage/mongodb'
mongo_db ||= Mongo::Connection.new.db('anemone')
raise "First argument must be an instance of Mongo::DB" unless mongo_db.is_a?(Mongo::DB)
self::MongoDB.new(mongo_db, collection_name)
end
def self.Redis(opts = {})
require 'anemone/storage/redis'
self::Redis.new(opts)
end
end
end