jmettraux / rufus-tokyo
- Source
- Commits
- Network (15)
- Issues (3)
- Downloads (23)
- Graphs
-
Branch:
master
| name | age | message | |
|---|---|---|---|
| .. | |||
| |
README.txt | Mon Dec 21 23:53:43 -0800 2009 | |
| |
cabcore.rb | Tue Jan 05 23:06:19 -0800 2010 | |
| |
cabinet/ | Tue Jan 05 23:06:19 -0800 2010 | |
| |
error.rb | Tue Jan 05 23:06:19 -0800 2010 | |
| |
ntyrant.rb | Tue Feb 24 21:03:11 -0800 2009 | |
| |
ntyrant/ | Tue Jan 05 23:06:19 -0800 2010 | |
| |
tabcore.rb | Tue Jan 05 23:06:19 -0800 2010 |
lib/rufus/edo/README.txt
= Rufus::Edo wrapping Hirabayashi-san's 'native' ruby bindings into a rubiyst-friendly set of Ruby classes. In order to use Rufus::Edo, you have to have the libtokyocabinet dynamic library installed on your system : http://openwferu.rubyforge.org/tokyo.html Then you can install the 'native' C bindings. NOTE : I have only tested those native bindings with Ruby 1.8.6. To run them with JRuby, the best option is Rufus::Tokyo and its FFI bindings. NOTE : the Ruby tyrant library provided by Hirabayashi-san is not a C binding, it's a pure Ruby connector. It is slower than Rufus::Tokyo::Tyrant and Rufus::Tokyo::TyrantTable, but the advantage is that there is no need to install cabinet and tyrant C libraries to connect your Ruby code to your Tokyo Tyrant. == installation of the 'native' C bindings === directly from http://1978th.net/tokyocabinet/ Get the tokyocabinet-ruby package at : http://1978th.net/tokyocabinet/rubypkg/ unpack it : tar xzvf tokyocabinet-ruby-1.29.tar.gz cd tokyocabinet-ruby-1.29 and then, as described at : http://tokyocabinet.sourceforge.net/rubydoc/ ruby extconf.rb make sudo make install == Rufus::Edo::Cabinet require 'rufus/edo' # sudo gem install rufus-tokyo db = Rufus::Edo::Cabinet.new('data.tch') db['a'] = 'alpha' # ... db.close == Rufus::Edo::Table require 'rufus/edo' db = Rufus::Edo::Table.new('data.tct') db['customer1'] = { 'name' => 'Taira no Kyomori', 'age' => '55' } # ... db.close == tyrant Hirabayashi-san's pure Ruby gem for accessing Tokyo Tyrant can be installed with : sudo gem install careo-tokyotyrant --source http://gems.github.com It's also available at : http://sourceforge.net/project/showfiles.php?group_id=200242 http://github.com/careo/tokyotyrant-ruby == Rufus::Edo::NetTyrant Note : 'NetTyrant' instead of 'Tyrant' to clearly show that this class isn't a C binding but a simple [pure Ruby] network implementation of a connection to a Tyrant. require 'rufus/edo/ntyrant' db = Rufus::Edo::NetTyrant.new('127.0.0.1', 45000) db['a'] = 'alpha' puts db['a] # => 'alpha' db.close == Rufus::Edo::NetTyrantTable require 'rufus/edo/ntyrant' t = Rufus::Edo::NetTyrantTable.new('127.0.0.1', 44502) t['client0'] = { 'name' => 'Heike no Kyomori', 'country' => 'jp' } t.close
