rufus-tokyo 0.1.9 → 0.1.10
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG.txt +5 -0
- data/README.txt +18 -0
- data/TODO.txt +2 -2
- data/lib/rufus/edo/ntyrant/table.rb +2 -7
- data/lib/rufus/edo/tabcore.rb +12 -10
- data/lib/rufus/edo.rb +2 -7
- data/lib/rufus/tokyo/cabinet/lib.rb +9 -8
- data/lib/rufus/tokyo/cabinet/table.rb +10 -10
- data/lib/rufus/tokyo/tyrant/lib.rb +9 -8
- data/lib/rufus/tokyo.rb +3 -8
- metadata +3 -3
data/CHANGELOG.txt
CHANGED
@@ -2,6 +2,11 @@
|
|
2
2
|
= rufus-tokyo CHANGELOG.txt
|
3
3
|
|
4
4
|
|
5
|
+
== rufus-tokyo - 0.1.10 released 2009/03/19
|
6
|
+
|
7
|
+
- bug : had to adapt to TC 1.4.10 and TT 1.1.17 new "setlimit"
|
8
|
+
|
9
|
+
|
5
10
|
== rufus-tokyo - 0.1.9 released 2009/02/27
|
6
11
|
|
7
12
|
- bug : sudo gem install rufus-tokyo was failing because of
|
data/README.txt
CHANGED
@@ -24,6 +24,24 @@ Note : Rufus::Tokyo focuses on leveraging Hirabayashi-san's C libraries via ruby
|
|
24
24
|
|
25
25
|
hereafter TC references Tokyo Cabinet, while TT references Tokyo Tyrant.
|
26
26
|
|
27
|
+
the rdoc is at http://rufus.rubyforge.org/rufus-tokyo/
|
28
|
+
|
29
|
+
|
30
|
+
== version [mis]match
|
31
|
+
|
32
|
+
this version of rufus-tokyo works with
|
33
|
+
|
34
|
+
ruby 1.8.6
|
35
|
+
ruby 1.9.1p0
|
36
|
+
jruby 1.1.6
|
37
|
+
jruby 1.2.0
|
38
|
+
|
39
|
+
TC 1.4.9 and TT 1.1.16
|
40
|
+
TC 1.4.10 and TT 1.1.17 (adds the offset arg to query.limit)
|
41
|
+
|
42
|
+
tc-ruby 1.20 and tt-ruby 1.3 (Rufus::Edo)
|
43
|
+
tc-ruby 1.21 and tt-ruby 1.4 (Rufus::Edo)
|
44
|
+
|
27
45
|
|
28
46
|
=== TC Abstract API
|
29
47
|
|
data/TODO.txt
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
|
2
|
-
[
|
3
|
-
[
|
2
|
+
[x] table : bench find(1) after set_index
|
3
|
+
[x] table : bench insert(1) after set_index
|
4
4
|
|
5
5
|
[x] align edo#new on tokyo#new
|
6
6
|
[ ] horizontal (bdb hdb fdb) tests for tokyo and edo
|
@@ -1,4 +1,3 @@
|
|
1
|
-
#
|
2
1
|
#--
|
3
2
|
# Copyright (c) 2009, John Mettraux, jmettraux@gmail.com
|
4
3
|
#
|
@@ -19,14 +18,10 @@
|
|
19
18
|
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
19
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
20
|
# THE SOFTWARE.
|
22
|
-
#++
|
23
21
|
#
|
22
|
+
# Made in Japan.
|
23
|
+
#++
|
24
24
|
|
25
|
-
#
|
26
|
-
# "made in Japan"
|
27
|
-
#
|
28
|
-
# jmettraux@gmail.com
|
29
|
-
#
|
30
25
|
|
31
26
|
require 'tokyotyrant'
|
32
27
|
|
data/lib/rufus/edo/tabcore.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
#
|
2
1
|
#--
|
3
2
|
# Copyright (c) 2009, John Mettraux, jmettraux@gmail.com
|
4
3
|
#
|
@@ -19,14 +18,10 @@
|
|
19
18
|
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
19
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
20
|
# THE SOFTWARE.
|
22
|
-
#++
|
23
21
|
#
|
22
|
+
# Made in Japan.
|
23
|
+
#++
|
24
24
|
|
25
|
-
#
|
26
|
-
# "made in Japan"
|
27
|
-
#
|
28
|
-
# jmettraux@gmail.com
|
29
|
-
#
|
30
25
|
|
31
26
|
require 'rufus/tokyo/query'
|
32
27
|
require 'rufus/tokyo/transactions'
|
@@ -34,6 +29,10 @@ require 'rufus/tokyo/transactions'
|
|
34
29
|
|
35
30
|
module Rufus::Edo
|
36
31
|
|
32
|
+
#
|
33
|
+
# Methods common to the two table classes (cabinet + ntyrant) found in
|
34
|
+
# Rufus::Edo
|
35
|
+
#
|
37
36
|
module TableCore
|
38
37
|
|
39
38
|
include Rufus::Tokyo::HashMethods
|
@@ -383,11 +382,14 @@ module Rufus::Edo
|
|
383
382
|
#
|
384
383
|
# Sets the max number of records to return for this query.
|
385
384
|
#
|
386
|
-
# (
|
385
|
+
# (If you're using TC >= 1.4.10 the optional 'offset' (skip) parameter
|
386
|
+
# is accepted)
|
387
387
|
#
|
388
|
-
def limit (i)
|
388
|
+
def limit (i, offset=-1)
|
389
389
|
|
390
|
-
@query.
|
390
|
+
@query.respond_to?(:setlimit) ?
|
391
|
+
@query.setlimit(i, offset) :
|
392
|
+
@query.setmax(i)
|
391
393
|
end
|
392
394
|
|
393
395
|
#
|
data/lib/rufus/edo.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
#
|
2
1
|
#--
|
3
2
|
# Copyright (c) 2009, John Mettraux, jmettraux@gmail.com
|
4
3
|
#
|
@@ -19,14 +18,10 @@
|
|
19
18
|
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
19
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
20
|
# THE SOFTWARE.
|
22
|
-
#++
|
23
21
|
#
|
22
|
+
# Made in Japan.
|
23
|
+
#++
|
24
24
|
|
25
|
-
#
|
26
|
-
# "made in Japan"
|
27
|
-
#
|
28
|
-
# jmettraux@gmail.com
|
29
|
-
#
|
30
25
|
|
31
26
|
begin
|
32
27
|
|
@@ -1,4 +1,3 @@
|
|
1
|
-
#
|
2
1
|
#--
|
3
2
|
# Copyright (c) 2009, John Mettraux, jmettraux@gmail.com
|
4
3
|
#
|
@@ -19,14 +18,10 @@
|
|
19
18
|
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
19
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
20
|
# THE SOFTWARE.
|
22
|
-
#++
|
23
21
|
#
|
22
|
+
# Made in Japan.
|
23
|
+
#++
|
24
24
|
|
25
|
-
#
|
26
|
-
# "made in Japan"
|
27
|
-
#
|
28
|
-
# jmettraux@gmail.com
|
29
|
-
#
|
30
25
|
|
31
26
|
module Rufus::Tokyo
|
32
27
|
|
@@ -41,6 +36,7 @@ module Rufus::Tokyo
|
|
41
36
|
|
42
37
|
paths = Array(ENV['TOKYO_CABINET_LIB'] || %w{
|
43
38
|
/opt/local/lib/libtokyocabinet.dylib
|
39
|
+
/opt/local/lib/libtokyocabinet.so
|
44
40
|
/usr/local/lib/libtokyocabinet.dylib
|
45
41
|
/usr/local/lib/libtokyocabinet.so
|
46
42
|
})
|
@@ -156,7 +152,12 @@ module Rufus::Tokyo
|
|
156
152
|
|
157
153
|
attfunc :qry_addcond, :tctdbqryaddcond, [ :pointer, :string, :int, :string ], :void
|
158
154
|
attfunc :qry_setorder, :tctdbqrysetorder, [ :pointer, :string, :int ], :void
|
159
|
-
|
155
|
+
|
156
|
+
begin
|
157
|
+
attfunc :qry_setmax, :tctdbqrysetmax, [ :pointer, :int ], :void
|
158
|
+
rescue FFI::NotFoundError => nfe
|
159
|
+
attfunc :qry_setlimit, :tctdbqrysetlimit, [ :pointer, :int, :int ], :void
|
160
|
+
end
|
160
161
|
|
161
162
|
attfunc :qry_search, :tctdbqrysearch, [ :pointer ], :pointer
|
162
163
|
|
@@ -1,4 +1,3 @@
|
|
1
|
-
#
|
2
1
|
#--
|
3
2
|
# Copyright (c) 2009, John Mettraux, jmettraux@gmail.com
|
4
3
|
#
|
@@ -19,14 +18,10 @@
|
|
19
18
|
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
19
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
20
|
# THE SOFTWARE.
|
22
|
-
#++
|
23
21
|
#
|
22
|
+
# Made in Japan.
|
23
|
+
#++
|
24
24
|
|
25
|
-
#
|
26
|
-
# "made in Japan"
|
27
|
-
#
|
28
|
-
# jmettraux@gmail.com
|
29
|
-
#
|
30
25
|
|
31
26
|
require 'rufus/tokyo/query'
|
32
27
|
require 'rufus/tokyo/config'
|
@@ -505,6 +500,7 @@ module Rufus::Tokyo
|
|
505
500
|
# :numoreq # number which is equal to at least one token
|
506
501
|
#
|
507
502
|
def add (colname, operator, val, affirmative=true, no_index=true)
|
503
|
+
|
508
504
|
op = operator.is_a?(Fixnum) ? operator : OPERATORS[operator]
|
509
505
|
op = op | TDBQCNEGATE unless affirmative
|
510
506
|
op = op | TDBQCNOIDX if no_index
|
@@ -515,10 +511,14 @@ module Rufus::Tokyo
|
|
515
511
|
#
|
516
512
|
# Sets the max number of records to return for this query.
|
517
513
|
#
|
518
|
-
# (
|
514
|
+
# (If you're using TC >= 1.4.10 the optional 'offset' (skip) parameter
|
515
|
+
# is accepted)
|
519
516
|
#
|
520
|
-
def limit (i)
|
521
|
-
|
517
|
+
def limit (i, offset=-1)
|
518
|
+
|
519
|
+
lib.respond_to?(:qry_setlimit) ?
|
520
|
+
lib.qry_setlimit(@query, i, offset) :
|
521
|
+
lib.qry_setmax(@query, i)
|
522
522
|
end
|
523
523
|
|
524
524
|
#
|
@@ -1,4 +1,3 @@
|
|
1
|
-
#
|
2
1
|
#--
|
3
2
|
# Copyright (c) 2009, John Mettraux, jmettraux@gmail.com
|
4
3
|
#
|
@@ -19,14 +18,10 @@
|
|
19
18
|
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
19
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
20
|
# THE SOFTWARE.
|
22
|
-
#++
|
23
21
|
#
|
22
|
+
# Made in Japan.
|
23
|
+
#++
|
24
24
|
|
25
|
-
#
|
26
|
-
# "made in Japan"
|
27
|
-
#
|
28
|
-
# jmettraux@gmail.com
|
29
|
-
#
|
30
25
|
|
31
26
|
module Rufus::Tokyo
|
32
27
|
|
@@ -42,6 +37,7 @@ module Rufus::Tokyo
|
|
42
37
|
|
43
38
|
paths = Array(ENV['TOKYO_TYRANT_LIB'] || %w{
|
44
39
|
/opt/local/lib/libtokyotyrant.dylib
|
40
|
+
/opt/local/lib/libtokyotyrant.so
|
45
41
|
/usr/local/lib/libtokyotyrant.dylib
|
46
42
|
/usr/local/lib/libtokyotyrant.so
|
47
43
|
})
|
@@ -123,7 +119,12 @@ module Rufus::Tokyo
|
|
123
119
|
|
124
120
|
attfunc :qry_addcond, :tcrdbqryaddcond, [ :pointer, :string, :int, :string ], :void
|
125
121
|
attfunc :qry_setorder, :tcrdbqrysetorder, [ :pointer, :string, :int ], :void
|
126
|
-
|
122
|
+
|
123
|
+
begin
|
124
|
+
attfunc :qry_setmax, :tcrdbqrysetmax, [ :pointer, :int ], :void
|
125
|
+
rescue FFI::NotFoundError => nfe
|
126
|
+
attfunc :qry_setlimit, :tcrdbqrysetlimit, [ :pointer, :int, :int ], :void
|
127
|
+
end
|
127
128
|
|
128
129
|
attfunc :qry_search, :tcrdbqrysearch, [ :pointer ], :pointer
|
129
130
|
end
|
data/lib/rufus/tokyo.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
#
|
2
1
|
#--
|
3
2
|
# Copyright (c) 2009, John Mettraux, jmettraux@gmail.com
|
4
3
|
#
|
@@ -19,14 +18,10 @@
|
|
19
18
|
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
19
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
20
|
# THE SOFTWARE.
|
22
|
-
#++
|
23
21
|
#
|
22
|
+
# Made in Japan.
|
23
|
+
#++
|
24
24
|
|
25
|
-
#
|
26
|
-
# "made in Japan"
|
27
|
-
#
|
28
|
-
# jmettraux@gmail.com
|
29
|
-
#
|
30
25
|
|
31
26
|
require 'ffi' # sudo gem install ffi
|
32
27
|
|
@@ -34,7 +29,7 @@ require 'ffi' # sudo gem install ffi
|
|
34
29
|
module Rufus
|
35
30
|
module Tokyo
|
36
31
|
|
37
|
-
VERSION = '0.1.
|
32
|
+
VERSION = '0.1.10'
|
38
33
|
|
39
34
|
#
|
40
35
|
# A common error class
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rufus-tokyo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Mettraux
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-03-19 00:00:00 +09:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -91,6 +91,6 @@ rubyforge_project: rufus
|
|
91
91
|
rubygems_version: 1.3.1
|
92
92
|
signing_key:
|
93
93
|
specification_version: 2
|
94
|
-
summary: ruby-ffi based lib to access Tokyo Cabinet
|
94
|
+
summary: ruby-ffi based lib to access Tokyo Cabinet and Tyrant
|
95
95
|
test_files:
|
96
96
|
- spec/spec.rb
|