groonga 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/NEWS.ja.rdoc +18 -3
- data/NEWS.rdoc +18 -3
- data/README.ja.rdoc +2 -0
- data/README.rdoc +2 -0
- data/Rakefile +14 -5
- data/TUTORIAL.ja.rdoc +82 -16
- data/benchmark/{read-write-small-many-items.rb → read-write-many-small-items.rb} +26 -23
- data/benchmark/{write-small-many-items.rb → write-many-small-items.rb} +26 -23
- data/example/bookmark.rb +49 -5
- data/ext/rb-grn-array.c +11 -1
- data/ext/rb-grn-column.c +132 -5
- data/ext/rb-grn-context.c +85 -80
- data/ext/rb-grn-database.c +182 -9
- data/ext/rb-grn-expression-builder.c +69 -0
- data/ext/rb-grn-expression.c +314 -0
- data/ext/rb-grn-fix-size-column.c +68 -89
- data/ext/rb-grn-hash.c +14 -5
- data/ext/rb-grn-index-column.c +14 -55
- data/ext/rb-grn-object.c +206 -75
- data/ext/rb-grn-operation.c +92 -0
- data/ext/rb-grn-patricia-trie.c +10 -32
- data/ext/rb-grn-query.c +9 -9
- data/ext/rb-grn-table-cursor.c +19 -80
- data/ext/rb-grn-table-key-support.c +33 -39
- data/ext/rb-grn-table.c +436 -79
- data/ext/rb-grn-type.c +10 -3
- data/ext/rb-grn-utils.c +131 -4
- data/ext/rb-grn-variable-size-column.c +36 -0
- data/ext/rb-grn-variable.c +90 -0
- data/ext/rb-grn.h +109 -56
- data/ext/rb-groonga.c +4 -0
- data/extconf.rb +39 -13
- data/html/index.html +2 -2
- data/lib/groonga.rb +22 -0
- data/lib/groonga/expression-builder.rb +141 -0
- data/lib/groonga/record.rb +25 -1
- data/lib/groonga/schema.rb +418 -0
- data/test/test-column.rb +11 -23
- data/test/test-context.rb +1 -1
- data/test/test-database.rb +60 -19
- data/test/test-expression-builder.rb +114 -0
- data/test/test-expression.rb +55 -0
- data/test/test-fix-size-column.rb +53 -0
- data/test/test-hash.rb +10 -3
- data/test/test-index-column.rb +24 -0
- data/test/test-patricia-trie.rb +9 -0
- data/test/test-procedure.rb +5 -5
- data/test/test-record.rb +71 -4
- data/test/test-schema.rb +207 -0
- data/test/test-table.rb +94 -12
- data/test/test-type.rb +18 -11
- data/test/test-variable-size-column.rb +53 -0
- data/test/test-variable.rb +28 -0
- metadata +18 -5
data/test/test-type.rb
CHANGED
@@ -24,20 +24,27 @@ class TypeTest < Test::Unit::TestCase
|
|
24
24
|
end
|
25
25
|
|
26
26
|
def test_builtins
|
27
|
-
assert_equal_type("
|
28
|
-
assert_equal_type("
|
29
|
-
assert_equal_type("
|
30
|
-
assert_equal_type("
|
31
|
-
assert_equal_type("
|
32
|
-
assert_equal_type("
|
33
|
-
assert_equal_type("
|
34
|
-
assert_equal_type("
|
35
|
-
assert_equal_type("
|
27
|
+
assert_equal_type("Object", Groonga::Type::OBJECT) # FIXME!!!
|
28
|
+
assert_equal_type("Bool", Groonga::Type::BOOLEAN)
|
29
|
+
assert_equal_type("Bool", Groonga::Type::BOOL)
|
30
|
+
assert_equal_type("Int8", Groonga::Type::INT8)
|
31
|
+
assert_equal_type("UInt8", Groonga::Type::UINT8)
|
32
|
+
assert_equal_type("Int16", Groonga::Type::INT16)
|
33
|
+
assert_equal_type("UInt16", Groonga::Type::UINT16)
|
34
|
+
assert_equal_type("Int32", Groonga::Type::INT32)
|
35
|
+
assert_equal_type("UInt32", Groonga::Type::UINT32)
|
36
|
+
assert_equal_type("Int64", Groonga::Type::INT64)
|
37
|
+
assert_equal_type("UInt64", Groonga::Type::UINT64)
|
38
|
+
assert_equal_type("Float", Groonga::Type::FLOAT)
|
39
|
+
assert_equal_type("Time", Groonga::Type::TIME)
|
40
|
+
assert_equal_type("ShortText", Groonga::Type::SHORT_TEXT)
|
41
|
+
assert_equal_type("Text", Groonga::Type::TEXT)
|
42
|
+
assert_equal_type("LongText", Groonga::Type::LONG_TEXT)
|
36
43
|
end
|
37
44
|
|
38
45
|
def test_inspect
|
39
|
-
assert_equal("#<Groonga::Type id:
|
40
|
-
"name:
|
46
|
+
assert_equal("#<Groonga::Type id: <#{Groonga::Type::LONG_TEXT}>, " +
|
47
|
+
"name: <LongText>, " +
|
41
48
|
"path: (temporary), " +
|
42
49
|
"domain: <nil>, " +
|
43
50
|
"range: <2147483648>>",
|
@@ -0,0 +1,53 @@
|
|
1
|
+
# Copyright (C) 2009 Kouhei Sutou <kou@clear-code.com>
|
2
|
+
#
|
3
|
+
# This library is free software; you can redistribute it and/or
|
4
|
+
# modify it under the terms of the GNU Lesser General Public
|
5
|
+
# License version 2.1 as published by the Free Software Foundation.
|
6
|
+
#
|
7
|
+
# This library is distributed in the hope that it will be useful,
|
8
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
9
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
10
|
+
# Lesser General Public License for more details.
|
11
|
+
#
|
12
|
+
# You should have received a copy of the GNU Lesser General Public
|
13
|
+
# License along with this library; if not, write to the Free Software
|
14
|
+
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
15
|
+
|
16
|
+
class VariableSizeColumnTest < Test::Unit::TestCase
|
17
|
+
include GroongaTestUtils
|
18
|
+
|
19
|
+
def setup
|
20
|
+
setup_database
|
21
|
+
|
22
|
+
setup_users_table
|
23
|
+
end
|
24
|
+
|
25
|
+
def setup_users_table
|
26
|
+
@users_path = @tables_dir + "users"
|
27
|
+
@users = Groonga::Array.create(:name => "users",
|
28
|
+
:path => @users_path.to_s)
|
29
|
+
|
30
|
+
@users_name_column_path = @columns_dir + "name"
|
31
|
+
@name = @users.define_column("name", "<shorttext>",
|
32
|
+
:path => @users_name_column_path.to_s)
|
33
|
+
end
|
34
|
+
|
35
|
+
def test_inspect
|
36
|
+
assert_equal("#<Groonga::VariableSizeColumn " +
|
37
|
+
"id: <#{@name.id}>, " +
|
38
|
+
"name: <users.name>, " +
|
39
|
+
"path: <#{@users_name_column_path}>, " +
|
40
|
+
"domain: <#{@users.inspect}>, " +
|
41
|
+
"range: <#{context['<shorttext>'].inspect}>" +
|
42
|
+
">",
|
43
|
+
@name.inspect)
|
44
|
+
end
|
45
|
+
|
46
|
+
def test_domain
|
47
|
+
assert_equal(@users, @name.domain)
|
48
|
+
end
|
49
|
+
|
50
|
+
def test_table
|
51
|
+
assert_equal(@users, @name.table)
|
52
|
+
end
|
53
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# Copyright (C) 2009 Kouhei Sutou <kou@clear-code.com>
|
2
|
+
#
|
3
|
+
# This library is free software; you can redistribute it and/or
|
4
|
+
# modify it under the terms of the GNU Lesser General Public
|
5
|
+
# License version 2.1 as published by the Free Software Foundation.
|
6
|
+
#
|
7
|
+
# This library is distributed in the hope that it will be useful,
|
8
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
9
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
10
|
+
# Lesser General Public License for more details.
|
11
|
+
#
|
12
|
+
# You should have received a copy of the GNU Lesser General Public
|
13
|
+
# License along with this library; if not, write to the Free Software
|
14
|
+
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
15
|
+
|
16
|
+
class VariableTest < Test::Unit::TestCase
|
17
|
+
include GroongaTestUtils
|
18
|
+
|
19
|
+
setup :setup_database
|
20
|
+
|
21
|
+
def test_value
|
22
|
+
expression = Groonga::Expression.new
|
23
|
+
variable = expression.define_variable
|
24
|
+
assert_nil(variable.value)
|
25
|
+
variable.value = "morita"
|
26
|
+
assert_equal("morita", variable.value)
|
27
|
+
end
|
28
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: groonga
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kouhei Sutou
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-07-18 00:00:00 +09:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -40,8 +40,8 @@ files:
|
|
40
40
|
- Rakefile
|
41
41
|
- TUTORIAL.ja.rdoc
|
42
42
|
- benchmark/common.rb
|
43
|
-
- benchmark/read-write-small-
|
44
|
-
- benchmark/write-small-
|
43
|
+
- benchmark/read-write-many-small-items.rb
|
44
|
+
- benchmark/write-many-small-items.rb
|
45
45
|
- example/bookmark.rb
|
46
46
|
- ext/.gitignore
|
47
47
|
- ext/rb-grn-accessor.c
|
@@ -53,12 +53,15 @@ files:
|
|
53
53
|
- ext/rb-grn-encoding-support.c
|
54
54
|
- ext/rb-grn-encoding.c
|
55
55
|
- ext/rb-grn-exception.c
|
56
|
+
- ext/rb-grn-expression-builder.c
|
57
|
+
- ext/rb-grn-expression.c
|
56
58
|
- ext/rb-grn-fix-size-column.c
|
57
59
|
- ext/rb-grn-hash-cursor.c
|
58
60
|
- ext/rb-grn-hash.c
|
59
61
|
- ext/rb-grn-index-column.c
|
60
62
|
- ext/rb-grn-logger.c
|
61
63
|
- ext/rb-grn-object.c
|
64
|
+
- ext/rb-grn-operation.c
|
62
65
|
- ext/rb-grn-patricia-trie-cursor.c
|
63
66
|
- ext/rb-grn-patricia-trie.c
|
64
67
|
- ext/rb-grn-procedure.c
|
@@ -71,6 +74,8 @@ files:
|
|
71
74
|
- ext/rb-grn-table.c
|
72
75
|
- ext/rb-grn-type.c
|
73
76
|
- ext/rb-grn-utils.c
|
77
|
+
- ext/rb-grn-variable-size-column.c
|
78
|
+
- ext/rb-grn-variable.c
|
74
79
|
- ext/rb-grn.h
|
75
80
|
- ext/rb-groonga.c
|
76
81
|
- extconf.rb
|
@@ -89,7 +94,9 @@ files:
|
|
89
94
|
- html/ranguba.css
|
90
95
|
- html/tutorial.svg
|
91
96
|
- lib/groonga.rb
|
97
|
+
- lib/groonga/expression-builder.rb
|
92
98
|
- lib/groonga/record.rb
|
99
|
+
- lib/groonga/schema.rb
|
93
100
|
- license/GPL
|
94
101
|
- license/LGPL
|
95
102
|
- license/RUBY
|
@@ -179,16 +186,22 @@ files:
|
|
179
186
|
- test/test-database.rb
|
180
187
|
- test/test-encoding.rb
|
181
188
|
- test/test-exception.rb
|
189
|
+
- test/test-expression-builder.rb
|
190
|
+
- test/test-expression.rb
|
191
|
+
- test/test-fix-size-column.rb
|
182
192
|
- test/test-hash.rb
|
183
193
|
- test/test-index-column.rb
|
184
194
|
- test/test-patricia-trie.rb
|
185
195
|
- test/test-procedure.rb
|
186
196
|
- test/test-query.rb
|
187
197
|
- test/test-record.rb
|
198
|
+
- test/test-schema.rb
|
188
199
|
- test/test-snippet.rb
|
189
200
|
- test/test-table-cursor.rb
|
190
201
|
- test/test-table.rb
|
191
202
|
- test/test-type.rb
|
203
|
+
- test/test-variable-size-column.rb
|
204
|
+
- test/test-variable.rb
|
192
205
|
- test/test-version.rb
|
193
206
|
has_rdoc: true
|
194
207
|
homepage: http://groonga.rubyforge.org/
|
@@ -216,7 +229,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
216
229
|
requirements: []
|
217
230
|
|
218
231
|
rubyforge_project: groonga
|
219
|
-
rubygems_version: 1.3.
|
232
|
+
rubygems_version: 1.3.4
|
220
233
|
signing_key:
|
221
234
|
specification_version: 3
|
222
235
|
summary: Ruby bindings for groonga that provides full text search and column store features.
|