diff options
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/rbotdb | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -227,6 +227,8 @@ class ImportRegistry case @type when :dbm write_dbm(file, hash) + when :tc + write_tc(file, hash) when :daybreak write_daybreak(file, hash) end @@ -242,6 +244,19 @@ class ImportRegistry db.close end + def write_tc(file, data) + db = TokyoCabinet::BDB.new + db.open(file + '.tdb', + TokyoCabinet::BDB::OREADER | + TokyoCabinet::BDB::OCREAT | + TokyoCabinet::BDB::OWRITER) + data.each_pair do |key, value| + db[key] = value + end + db.optimize + db.close + end + def write_daybreak(file, data) db = Daybreak::DB.new(file + '.db') data.each_pair do |key, value| |