github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

jmettraux / rufus-tokyo

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 191
    • 15
  • Source
  • Commits
  • Network (15)
  • Issues (3)
  • Downloads (23)
  • Graphs
  • Branch: master

click here to add a description

click here to add a homepage

  • Branches (1)
    • master ✓
  • Tags (23)
    • v1.0.7
    • v1.0.6
    • v1.0.5
    • v1.0.4
    • r1.0.3
    • r1.0.2
    • r1.0.1
    • r1.0.0
    • r0.1.14
    • r0.1.13
    • r0.1.12
    • r0.1.11
    • r0.1.10
    • r0.1.9
    • r0.1.8
    • r0.1.7
    • r0.1.6
    • r0.1.5
    • r0.1.4
    • r0.1.3
    • r0.1.2
    • r0.1.1
    • r0.1.0
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

ffi based ruby library to access Tokyo Cabinet and Tokyo Tyrant — Read more

  cancel

http://rufus.rubyforge.org

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

removed hard dependency on ffi so that JRuby installs stop failing. Closes 
gh-30. 
jmettraux (author)
Tue Feb 09 19:56:33 -0800 2010
commit  bdd2eadd296b78acde189804358847fe2c61c9c5
tree    44f18ca8abf1360b9db5f74c4969b73ef7b55a7f
parent  37c3a191fcf54a6e101399c212cebeed72547471
rufus-tokyo / lib / rufus / edo
name age
history
message
..
file README.txt Mon Dec 21 23:53:43 -0800 2009 updated links (1978th.net) [jmettraux]
file cabcore.rb Tue Jan 05 23:06:19 -0800 2010 2010 [jmettraux]
directory cabinet/ Tue Jan 05 23:06:19 -0800 2010 2010 [jmettraux]
file error.rb Tue Jan 05 23:06:19 -0800 2010 2010 [jmettraux]
file ntyrant.rb Tue Feb 24 21:03:11 -0800 2009 rufus/edo and rufus/edo/ntyrant done [jmettraux]
directory ntyrant/ Tue Jan 05 23:06:19 -0800 2010 2010 [jmettraux]
file tabcore.rb Tue Jan 05 23:06:19 -0800 2010 2010 [jmettraux]
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

Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server