TokyoCabinetã使ã£ã¦ã¿ãï¼
ã¾ãã¯ã¤ã³ã¹ãã¼ã«ãã
% wget http://tokyocabinet.sourceforge.net/tokyocabinet-1.3.26.tar.gz % cd tokyocabinet-1.3.26/ % ./configure --prefix=/usr/local % make % sudo make install % wget http://tokyocabinet.sourceforge.net/rubypkg/tokyocabinet-ruby-1.18.tar.gz % cd tokyocabinet-ruby-1.18/ % ruby extconf.rb % make % sudo make install
ããã¦å®é¨
require 'tokyocabinet' bdb = TokyoCabinet::BDB.new unless bdb.open("dbd-sample.dbd", TokyoCabinet::BDB::OWRITER | TokyoCabinet::BDB::OCREAT) puts "error" exit end bdb.put("hoge", Time.now.to_s) bdb.put("foo", Time.mktime(2008,10,10,10,10,10).to_s) puts bdb.get("hoge") puts bdb.get("foo") # >> Fri Dec 26 17:38:33 +0900 2008 # >> Fri Oct 10 10:10:10 +0900 2008