module Anemone::Storage
Public Class Methods
Hash(*args)
click to toggle source
# File lib/anemone/storage.rb, line 4 def self.Hash(*args) hash = Hash.new(*args) # add close method for compatibility with Storage::Base class << hash; def close; end; end hash end
KyotoCabinet(file = 'anemone.kch')
click to toggle source
# File lib/anemone/storage.rb, line 21 def self.KyotoCabinet(file = 'anemone.kch') require 'anemone/storage/kyoto_cabinet' self::KyotoCabinet.new(file) end
MongoDB(mongo_db = nil, collection_name = 'pages')
click to toggle source
# File lib/anemone/storage.rb, line 26 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
PStore(*args)
click to toggle source
# File lib/anemone/storage.rb, line 11 def self.PStore(*args) require 'anemone/storage/pstore' self::PStore.new(*args) end
Redis(opts = {})
click to toggle source
# File lib/anemone/storage.rb, line 33 def self.Redis(opts = {}) require 'anemone/storage/redis' self::Redis.new(opts) end
SQLite3(file = 'anemone.db')
click to toggle source
# File lib/anemone/storage.rb, line 38 def self.SQLite3(file = 'anemone.db') require 'anemone/storage/sqlite3' self::SQLite3.new(file) end
TokyoCabinet(file = 'anemone.tch')
click to toggle source
# File lib/anemone/storage.rb, line 16 def self.TokyoCabinet(file = 'anemone.tch') require 'anemone/storage/tokyo_cabinet' self::TokyoCabinet.new(file) end