rroonga 1.2.1 → 1.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.textile +1 -0
- data/Rakefile +48 -28
- data/ext/groonga/groonga.so +0 -0
- data/ext/groonga/rb-grn-accessor.o +0 -0
- data/ext/groonga/rb-grn-array-cursor.o +0 -0
- data/ext/groonga/rb-grn-array.o +0 -0
- data/ext/groonga/rb-grn-column.o +0 -0
- data/ext/groonga/rb-grn-context.o +0 -0
- data/ext/groonga/rb-grn-database.o +0 -0
- data/ext/groonga/rb-grn-encoding-support.o +0 -0
- data/ext/groonga/rb-grn-encoding.o +0 -0
- data/ext/groonga/rb-grn-exception.o +0 -0
- data/ext/groonga/rb-grn-expression-builder.o +0 -0
- data/ext/groonga/rb-grn-expression.c +3 -2
- data/ext/groonga/rb-grn-expression.o +0 -0
- data/ext/groonga/rb-grn-fix-size-column.o +0 -0
- data/ext/groonga/rb-grn-hash-cursor.o +0 -0
- data/ext/groonga/rb-grn-hash.o +0 -0
- data/ext/groonga/rb-grn-index-column.o +0 -0
- data/ext/groonga/rb-grn-index-cursor.o +0 -0
- data/ext/groonga/rb-grn-logger.o +0 -0
- data/ext/groonga/rb-grn-object.c +1 -7
- data/ext/groonga/rb-grn-object.o +0 -0
- data/ext/groonga/rb-grn-operator.o +0 -0
- data/ext/groonga/rb-grn-patricia-trie-cursor.o +0 -0
- data/ext/groonga/rb-grn-patricia-trie.o +0 -0
- data/ext/groonga/rb-grn-plugin.o +0 -0
- data/ext/groonga/rb-grn-posting.o +0 -0
- data/ext/groonga/rb-grn-procedure.o +0 -0
- data/ext/groonga/rb-grn-query.o +0 -0
- data/ext/groonga/rb-grn-record.o +0 -0
- data/ext/groonga/rb-grn-snippet.o +0 -0
- data/ext/groonga/rb-grn-table-cursor-key-support.o +0 -0
- data/ext/groonga/rb-grn-table-cursor.o +0 -0
- data/ext/groonga/rb-grn-table-key-support.o +0 -0
- data/ext/groonga/rb-grn-table.c +5 -3
- data/ext/groonga/rb-grn-table.o +0 -0
- data/ext/groonga/rb-grn-type.o +0 -0
- data/ext/groonga/rb-grn-utils.o +0 -0
- data/ext/groonga/rb-grn-variable-size-column.o +0 -0
- data/ext/groonga/rb-grn-variable.o +0 -0
- data/ext/groonga/rb-grn-view-accessor.o +0 -0
- data/ext/groonga/rb-grn-view-cursor.o +0 -0
- data/ext/groonga/rb-grn-view-record.o +0 -0
- data/ext/groonga/rb-grn-view.c +6 -10
- data/ext/groonga/rb-grn-view.o +0 -0
- data/ext/groonga/rb-grn.h +1 -1
- data/ext/groonga/rb-groonga.o +0 -0
- data/extconf.rb +1 -1
- data/lib/groonga/record.rb +15 -32
- data/test/test-record.rb +55 -26
- metadata +44 -3
data/README.textile
CHANGED
data/Rakefile
CHANGED
@@ -117,15 +117,31 @@ module YARD
|
|
117
117
|
end
|
118
118
|
end
|
119
119
|
|
120
|
+
reference_base_dir = Pathname.new("doc/html")
|
121
|
+
doc_en_dir = reference_base_dir + "en"
|
120
122
|
YARD::Rake::YardocTask.new do |task|
|
121
123
|
task.options += ["--title", "#{spec.name} - #{version}"]
|
122
124
|
# task.options += ["--charset", "UTF-8"]
|
123
125
|
task.options += ["--readme", "README.textile"]
|
124
|
-
task.options += ["--files", "text
|
126
|
+
task.options += ["--files", "doc/text/**/*"]
|
127
|
+
task.options += ["--output-dir", doc_en_dir.to_s]
|
128
|
+
task.options += ["--charset", "utf-8"]
|
125
129
|
task.files += FileList["ext/groonga/**/*.c"]
|
126
130
|
task.files += FileList["lib/**/*.rb"]
|
127
131
|
end
|
128
132
|
|
133
|
+
task :yard do
|
134
|
+
doc_en_dir.find do |path|
|
135
|
+
next if path.extname != ".html"
|
136
|
+
html = path.read
|
137
|
+
html = html.gsub(/<div id="footer">.+<\/div>/m,
|
138
|
+
"<div id=\"footer\"></div>")
|
139
|
+
path.open("w") do |html_file|
|
140
|
+
html_file.print(html)
|
141
|
+
end
|
142
|
+
end
|
143
|
+
end
|
144
|
+
|
129
145
|
def windows?(platform=nil)
|
130
146
|
platform ||= RUBY_PLATFORM
|
131
147
|
platform =~ /mswin(?!ce)|mingw|cygwin|bccwin/
|
@@ -169,12 +185,12 @@ end
|
|
169
185
|
|
170
186
|
include ERB::Util
|
171
187
|
|
172
|
-
def apply_template(file, head, header, footer, language)
|
188
|
+
def apply_template(file, top_path, current_page, head, header, footer, language)
|
173
189
|
content = File.read(file)
|
174
190
|
content = content.sub(/lang="en"/, 'lang="#{language}"')
|
175
191
|
|
176
192
|
title = nil
|
177
|
-
content = content.sub(/<title>(.+?)<\/title>/) do
|
193
|
+
content = content.sub(/<title>(.+?)<\/title>/m) do
|
178
194
|
title = $1
|
179
195
|
head.result(binding)
|
180
196
|
end
|
@@ -204,22 +220,21 @@ def rsync_to_rubyforge(spec, source, destination, options={})
|
|
204
220
|
config = YAML.load(File.read(File.expand_path("~/.rubyforge/user-config.yml")))
|
205
221
|
host = "#{config["username"]}@rubyforge.org"
|
206
222
|
|
207
|
-
rsync_args = "-av --exclude '*.erb' --
|
223
|
+
rsync_args = "-av --exclude '*.erb' --chmod=ug+w"
|
208
224
|
rsync_args << " --delete" if options[:delete]
|
209
|
-
remote_dir = "/var/www/gforge-projects/#{spec.
|
225
|
+
remote_dir = "/var/www/gforge-projects/#{spec.rubyforge_project}/"
|
210
226
|
sh("rsync #{rsync_args} #{source} #{host}:#{remote_dir}#{destination}")
|
211
227
|
end
|
212
228
|
|
213
229
|
namespace :reference do
|
214
230
|
translate_languages = [:ja]
|
215
231
|
supported_languages = [:en, *translate_languages]
|
216
|
-
|
217
|
-
html_files = FileList["doc/**/*.html"].to_a
|
232
|
+
html_files = FileList["doc/html/en/**/*.html"].to_a
|
218
233
|
|
219
|
-
directory reference_base_dir
|
220
|
-
CLOBBER.include(reference_base_dir)
|
234
|
+
directory reference_base_dir.to_s
|
235
|
+
CLOBBER.include(reference_base_dir.to_s)
|
221
236
|
|
222
|
-
po_dir = "po"
|
237
|
+
po_dir = "doc/po"
|
223
238
|
namespace :pot do
|
224
239
|
pot_file = "#{po_dir}/#{spec.name}.pot"
|
225
240
|
|
@@ -237,7 +252,7 @@ namespace :reference do
|
|
237
252
|
namespace language do
|
238
253
|
po_file = "#{po_dir}/#{language}.po"
|
239
254
|
|
240
|
-
file po_file do |t|
|
255
|
+
file po_file => html_files do |t|
|
241
256
|
sh("xml2po", "--keep-entities", "--update", t.name, *html_files)
|
242
257
|
end
|
243
258
|
|
@@ -248,17 +263,14 @@ namespace :reference do
|
|
248
263
|
end
|
249
264
|
|
250
265
|
namespace :translate do
|
251
|
-
directory reference_base_dir
|
252
|
-
|
253
266
|
translate_languages.each do |language|
|
254
267
|
po_file = "#{po_dir}/#{language}.po"
|
255
268
|
translate_doc_dir = "#{reference_base_dir}/#{language}"
|
256
269
|
|
257
|
-
doc_dir = Pathname("doc")
|
258
270
|
desc "Translates documents to #{language}."
|
259
271
|
task language => [po_file, reference_base_dir, *html_files] do
|
260
|
-
|
261
|
-
base_path = path.relative_path_from(
|
272
|
+
doc_en_dir.find do |path|
|
273
|
+
base_path = path.relative_path_from(doc_en_dir)
|
262
274
|
translated_path = "#{translate_doc_dir}/#{base_path}"
|
263
275
|
if path.directory?
|
264
276
|
mkdir_p(translated_path)
|
@@ -284,34 +296,40 @@ namespace :reference do
|
|
284
296
|
task :translate => translate_task_names
|
285
297
|
|
286
298
|
desc "Generates references."
|
287
|
-
task :generate => [:yard, :translate]
|
288
|
-
cp_r("doc", "#{reference_base_dir}/en", :preserve => true)
|
289
|
-
end
|
299
|
+
task :generate => [:yard, :translate]
|
290
300
|
|
291
301
|
namespace :publication do
|
292
302
|
task :prepare do
|
293
|
-
head = erb_template("head")
|
294
|
-
header = erb_template("header")
|
295
|
-
footer = erb_template("footer")
|
296
303
|
supported_languages.each do |language|
|
297
|
-
doc_dir = "#{reference_base_dir}/#{language}"
|
298
|
-
|
299
|
-
|
300
|
-
|
304
|
+
doc_dir = Pathname.new("#{reference_base_dir}/#{language}")
|
305
|
+
head = erb_template("head.#{language}")
|
306
|
+
header = erb_template("header.#{language}")
|
307
|
+
footer = erb_template("footer.#{language}")
|
308
|
+
doc_dir.find do |file|
|
309
|
+
case file.basename.to_s
|
310
|
+
when "_index.html", /\A(?:class|method|file)_list.html\z/
|
311
|
+
next
|
312
|
+
when /\.html\z/
|
313
|
+
relative_dir_path = file.relative_path_from(doc_dir).dirname
|
314
|
+
current_page = relative_dir_path + file.basename
|
315
|
+
top_path = doc_dir.relative_path_from(file.dirname).to_s
|
316
|
+
apply_template(file, top_path, current_page,
|
317
|
+
head, header, footer, language)
|
301
318
|
end
|
302
319
|
end
|
303
320
|
end
|
304
321
|
File.open("#{reference_base_dir}/.htaccess", "w") do |file|
|
305
322
|
file.puts("Redirect permanent /rroonga/text/TUTORIAL_ja_rdoc.html " +
|
306
323
|
"http://groonga.rubyforge.org/rroonga/ja/file.tutorial.html")
|
307
|
-
file.puts("
|
324
|
+
file.puts("RedirectMatch permanent ^/rroonga/$ " +
|
308
325
|
"http://groonga.rubyforge.org/rroonga/en/")
|
309
326
|
end
|
310
327
|
end
|
311
328
|
end
|
312
329
|
|
330
|
+
desc "Upload document to rubyforge."
|
313
331
|
task :publish => [:generate, "reference:publication:prepare"] do
|
314
|
-
rsync_to_rubyforge(spec, "#{reference_base_dir}/",
|
332
|
+
rsync_to_rubyforge(spec, "#{reference_base_dir}/", spec.name,
|
315
333
|
:delete => true)
|
316
334
|
end
|
317
335
|
end
|
@@ -322,6 +340,8 @@ namespace :html do
|
|
322
340
|
rsync_to_rubyforge(spec, "html/", "")
|
323
341
|
end
|
324
342
|
end
|
343
|
+
|
344
|
+
desc "Upload document and HTML to rubyforge."
|
325
345
|
task :publish => ["reference:publish", "html:publish"]
|
326
346
|
|
327
347
|
desc "Tag the current revision."
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -559,8 +559,9 @@ rb_grn_expression_inspect (VALUE self)
|
|
559
559
|
grn_expr_inspect(context, &inspected, expression);
|
560
560
|
#endif
|
561
561
|
GRN_TEXT_PUTS(context, &inspected, ">");
|
562
|
-
rb_inspected =
|
563
|
-
|
562
|
+
rb_inspected = rb_grn_context_rb_string_new(context,
|
563
|
+
GRN_TEXT_VALUE(&inspected),
|
564
|
+
GRN_TEXT_LEN(&inspected));
|
564
565
|
GRN_OBJ_FIN(context, &inspected);
|
565
566
|
|
566
567
|
return rb_inspected;
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/ext/groonga/rb-grn-object.c
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
/* -*- c-file-style: "ruby" -*- */
|
2
2
|
/*
|
3
|
-
Copyright (C) 2009-
|
3
|
+
Copyright (C) 2009-2011 Kouhei Sutou <kou@clear-code.com>
|
4
4
|
|
5
5
|
This library is free software; you can redistribute it and/or
|
6
6
|
modify it under the terms of the GNU Lesser General Public
|
@@ -414,10 +414,6 @@ void
|
|
414
414
|
rb_grn_named_object_bind (RbGrnNamedObject *rb_grn_named_object,
|
415
415
|
grn_ctx *context, grn_obj *object)
|
416
416
|
{
|
417
|
-
RbGrnObject *rb_grn_object;
|
418
|
-
|
419
|
-
rb_grn_object = RB_GRN_OBJECT(rb_grn_named_object);
|
420
|
-
|
421
417
|
rb_grn_named_object->name = NULL;
|
422
418
|
rb_grn_named_object->name_size = 0;
|
423
419
|
}
|
@@ -1284,14 +1280,12 @@ static VALUE
|
|
1284
1280
|
rb_grn_object_set (VALUE self, VALUE rb_id, VALUE rb_value, int flags)
|
1285
1281
|
{
|
1286
1282
|
RbGrnObject *rb_grn_object;
|
1287
|
-
grn_ctx *context;
|
1288
1283
|
grn_id id;
|
1289
1284
|
|
1290
1285
|
rb_grn_object = SELF(self);
|
1291
1286
|
if (!rb_grn_object->object)
|
1292
1287
|
return Qnil;
|
1293
1288
|
|
1294
|
-
context = rb_grn_object->context;
|
1295
1289
|
id = NUM2UINT(rb_id);
|
1296
1290
|
|
1297
1291
|
return rb_grn_object_set_raw(rb_grn_object, id, rb_value, flags, self);
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/ext/groonga/rb-grn-table.c
CHANGED
@@ -1028,7 +1028,7 @@ rb_grn_table_sort (int argc, VALUE *argv, VALUE self)
|
|
1028
1028
|
grn_obj *result;
|
1029
1029
|
grn_table_sort_key *keys;
|
1030
1030
|
int i, n_keys;
|
1031
|
-
int
|
1031
|
+
int offset = 0, limit = -1;
|
1032
1032
|
VALUE rb_keys, options;
|
1033
1033
|
VALUE rb_offset, rb_limit;
|
1034
1034
|
VALUE *rb_sort_keys;
|
@@ -1111,8 +1111,10 @@ rb_grn_table_sort (int argc, VALUE *argv, VALUE self)
|
|
1111
1111
|
|
1112
1112
|
result = grn_table_create(context, NULL, 0, NULL, GRN_TABLE_NO_KEY,
|
1113
1113
|
NULL, table);
|
1114
|
-
n_records
|
1115
|
-
|
1114
|
+
/* use n_records that is return value from
|
1115
|
+
grn_table_sort() when rroonga user become specifying
|
1116
|
+
output table. */
|
1117
|
+
grn_table_sort(context, table, offset, limit, result, keys, n_keys);
|
1116
1118
|
exception = rb_grn_context_to_exception(context, self);
|
1117
1119
|
if (!NIL_P(exception)) {
|
1118
1120
|
grn_obj_unlink(context, result);
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
data/ext/groonga/rb-grn-view.c
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
/* -*- c-file-style: "ruby" -*- */
|
2
2
|
/*
|
3
|
-
Copyright (C) 2010 Kouhei Sutou <kou@clear-code.com>
|
3
|
+
Copyright (C) 2010-2011 Kouhei Sutou <kou@clear-code.com>
|
4
4
|
|
5
5
|
This library is free software; you can redistribute it and/or
|
6
6
|
modify it under the terms of the GNU Lesser General Public
|
@@ -292,7 +292,7 @@ rb_grn_view_sort (int argc, VALUE *argv, VALUE self)
|
|
292
292
|
grn_obj *result;
|
293
293
|
grn_table_sort_key *keys;
|
294
294
|
int i, n_keys;
|
295
|
-
int
|
295
|
+
int offset = 0, limit = -1;
|
296
296
|
VALUE rb_keys, options;
|
297
297
|
VALUE rb_offset, rb_limit;
|
298
298
|
VALUE *rb_sort_keys;
|
@@ -376,14 +376,10 @@ rb_grn_view_sort (int argc, VALUE *argv, VALUE self)
|
|
376
376
|
|
377
377
|
result = grn_table_create(context, NULL, 0, NULL, GRN_TABLE_VIEW,
|
378
378
|
NULL, NULL);
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
grn_table_create(context, NULL, 0, NULL, GRN_TABLE_NO_KEY,
|
384
|
-
NULL, grn_ctx_get(context, "People", strlen("People"))));
|
385
|
-
n_records = grn_table_sort(context, view, offset, limit,
|
386
|
-
result, keys, n_keys);
|
379
|
+
/* use n_records that is return value from
|
380
|
+
grn_table_sort() when rroonga user become specifying
|
381
|
+
output table. */
|
382
|
+
grn_table_sort(context, view, offset, limit, result, keys, n_keys);
|
387
383
|
exception = rb_grn_context_to_exception(context, self);
|
388
384
|
if (!NIL_P(exception)) {
|
389
385
|
grn_obj_unlink(context, result);
|
Binary file
|
data/ext/groonga/rb-grn.h
CHANGED
Binary file
|
data/extconf.rb
CHANGED
@@ -46,7 +46,7 @@ def install_groonga_locally(major, minor, micro)
|
|
46
46
|
|
47
47
|
install_dir = local_groonga_install_dir
|
48
48
|
Dir.chdir(local_groonga_base_dir) do
|
49
|
-
url = "http://groonga.org/
|
49
|
+
url = "http://packages.groonga.org/source/groonga/#{tar_gz}"
|
50
50
|
message("downloading %s...", url)
|
51
51
|
open(url, "rb") do |input|
|
52
52
|
File.open(tar_gz, "wb") do |output|
|
data/lib/groonga/record.rb
CHANGED
@@ -293,6 +293,8 @@ module Groonga
|
|
293
293
|
# レコードが所属しているテーブルで定義されているインデックス
|
294
294
|
# 型のカラムでない全カラムを対象とし、カラムの名前をキーとし
|
295
295
|
# たこのレコードのカラムの値のハッシュを返す。
|
296
|
+
#
|
297
|
+
# return same attributes object if duplicate records exist.
|
296
298
|
def attributes
|
297
299
|
accessor = AttributeHashBuilder.new(self)
|
298
300
|
accessor.build
|
@@ -414,7 +416,7 @@ module Groonga
|
|
414
416
|
|
415
417
|
def initialize(root_record)
|
416
418
|
@root_record = root_record
|
417
|
-
@
|
419
|
+
@all_built_attributes = {}
|
418
420
|
end
|
419
421
|
|
420
422
|
def build
|
@@ -423,32 +425,25 @@ module Groonga
|
|
423
425
|
|
424
426
|
private
|
425
427
|
def build_attributes(record)
|
426
|
-
|
427
|
-
|
428
|
-
add_key(attributes, record)
|
429
|
-
add_score(attributes, record)
|
430
|
-
add_n_sub_records(attributes, record)
|
431
|
-
add_columns(attributes, record)
|
432
|
-
|
433
|
-
attributes
|
428
|
+
if @all_built_attributes.has_key?(record)
|
429
|
+
return @all_built_attributes[record]
|
434
430
|
end
|
435
|
-
end
|
436
431
|
|
437
|
-
|
438
|
-
|
439
|
-
|
432
|
+
attributes = {}
|
433
|
+
@all_built_attributes[record] = attributes
|
434
|
+
|
435
|
+
add_id(attributes, record)
|
440
436
|
add_key(attributes, record)
|
437
|
+
add_score(attributes, record)
|
438
|
+
add_n_sub_records(attributes, record)
|
439
|
+
add_columns(attributes, record)
|
441
440
|
|
442
441
|
attributes
|
443
442
|
end
|
444
443
|
|
445
444
|
def build_value(value)
|
446
445
|
if value.is_a?(Record)
|
447
|
-
|
448
|
-
build_recursive_attributes(value)
|
449
|
-
else
|
450
|
-
build_attributes(value)
|
451
|
-
end
|
446
|
+
build_attributes(value)
|
452
447
|
else
|
453
448
|
value
|
454
449
|
end
|
@@ -460,8 +455,8 @@ module Groonga
|
|
460
455
|
end
|
461
456
|
end
|
462
457
|
|
463
|
-
def
|
464
|
-
|
458
|
+
def add_id(attributes, record)
|
459
|
+
attributes["_id"] = record.id
|
465
460
|
end
|
466
461
|
|
467
462
|
def add_table(attributes, record)
|
@@ -502,18 +497,6 @@ module Groonga
|
|
502
497
|
attributes["_nsubrecs"] = record.n_sub_records
|
503
498
|
end
|
504
499
|
end
|
505
|
-
|
506
|
-
def building(record)
|
507
|
-
@built_records.push(record)
|
508
|
-
returned_object = yield
|
509
|
-
@built_records.pop
|
510
|
-
|
511
|
-
returned_object
|
512
|
-
end
|
513
|
-
|
514
|
-
def recursive?(record)
|
515
|
-
@built_records.include?(record)
|
516
|
-
end
|
517
500
|
end
|
518
501
|
end
|
519
502
|
end
|
data/test/test-record.rb
CHANGED
@@ -325,20 +325,55 @@ class RecordTest < Test::Unit::TestCase
|
|
325
325
|
"user" => nil,
|
326
326
|
"uri" => "http://groonga.org/document.html",
|
327
327
|
"rate" => 8,
|
328
|
-
"next" => {
|
329
|
-
"_table" => "Bookmarks",
|
330
|
-
"_id" => 1,
|
331
|
-
},
|
332
328
|
"content" => nil,
|
333
329
|
"comment" => "Informative"
|
334
330
|
},
|
335
331
|
"content" => nil,
|
336
332
|
"comment" => "Great!"
|
337
333
|
}
|
334
|
+
expected["next"]["next"] = expected
|
338
335
|
|
339
336
|
assert_equal(expected, top_page_record.attributes)
|
340
337
|
end
|
341
338
|
|
339
|
+
def test_duplicate_records_attributes
|
340
|
+
@bookmarks.define_column("next1", @bookmarks)
|
341
|
+
@bookmarks.define_column("next2", @bookmarks)
|
342
|
+
|
343
|
+
top_page_record = @bookmarks.add(top_page)
|
344
|
+
doc_page_record = @bookmarks.add(doc_page)
|
345
|
+
|
346
|
+
top_page_record["next1"] = doc_page_record
|
347
|
+
top_page_record["next2"] = doc_page_record
|
348
|
+
doc_page_record["next1"] = top_page_record
|
349
|
+
|
350
|
+
doc_page_attributes = {
|
351
|
+
"_id" => 2,
|
352
|
+
"user" => nil,
|
353
|
+
"uri" => "http://groonga.org/document.html",
|
354
|
+
"rate" => 8,
|
355
|
+
"content" => nil,
|
356
|
+
"comment" => "Informative",
|
357
|
+
"next2" => nil
|
358
|
+
}
|
359
|
+
top_page_attributes = {
|
360
|
+
"_id" => 1,
|
361
|
+
"user" => nil,
|
362
|
+
"uri" => "http://groonga.org/",
|
363
|
+
"rate" => 5,
|
364
|
+
"next1" => doc_page_attributes,
|
365
|
+
"next2" => doc_page_attributes,
|
366
|
+
"content" => nil,
|
367
|
+
"comment" => "Great!"
|
368
|
+
}
|
369
|
+
doc_page_attributes["next1"] = top_page_attributes
|
370
|
+
|
371
|
+
actual_records = top_page_record.attributes
|
372
|
+
assert_equal(top_page_attributes, actual_records)
|
373
|
+
assert_equal(actual_records["next1"].object_id,
|
374
|
+
actual_records["next2"].object_id)
|
375
|
+
end
|
376
|
+
|
342
377
|
def test_select_result_attributes
|
343
378
|
top_page_record = @bookmarks.add(top_page)
|
344
379
|
select_result = @bookmarks.select
|
@@ -372,13 +407,10 @@ class RecordTest < Test::Unit::TestCase
|
|
372
407
|
"user" => nil,
|
373
408
|
"uri" => "http://groonga.org/",
|
374
409
|
"rate" => 5,
|
375
|
-
"next" => {
|
376
|
-
"_table" => "Bookmarks",
|
377
|
-
"_id" => 1
|
378
|
-
},
|
379
410
|
"content" => nil,
|
380
411
|
"comment" => "Great!"
|
381
412
|
}
|
413
|
+
expected["next"] = expected
|
382
414
|
|
383
415
|
assert_equal(expected, top_page_record.attributes)
|
384
416
|
end
|
@@ -423,31 +455,28 @@ class RecordTest < Test::Unit::TestCase
|
|
423
455
|
doc_page_record
|
424
456
|
]
|
425
457
|
|
426
|
-
|
458
|
+
top_page_attributes = {
|
427
459
|
"_id" => 1,
|
428
460
|
"user" => nil,
|
429
461
|
"uri" => "http://groonga.org/",
|
430
462
|
"rate" => 5,
|
431
|
-
"related_bookmarks" => [
|
432
|
-
{
|
433
|
-
"_table" => "Bookmarks",
|
434
|
-
"_id" => 1
|
435
|
-
},
|
436
|
-
{
|
437
|
-
"_id" => 2,
|
438
|
-
"comment" => "Informative",
|
439
|
-
"content" => nil,
|
440
|
-
"rate" => 8,
|
441
|
-
"related_bookmarks" => [],
|
442
|
-
"uri" => "http://groonga.org/document.html",
|
443
|
-
"user" => nil,
|
444
|
-
}
|
445
|
-
],
|
446
463
|
"content" => nil,
|
447
464
|
"comment" => "Great!"
|
448
465
|
}
|
449
|
-
|
450
|
-
|
466
|
+
doc_page_attributes = {
|
467
|
+
"_id" => 2,
|
468
|
+
"comment" => "Informative",
|
469
|
+
"content" => nil,
|
470
|
+
"rate" => 8,
|
471
|
+
"related_bookmarks" => [],
|
472
|
+
"uri" => "http://groonga.org/document.html",
|
473
|
+
"user" => nil,
|
474
|
+
}
|
475
|
+
top_page_attributes["related_bookmarks"] = [
|
476
|
+
top_page_attributes,
|
477
|
+
doc_page_attributes
|
478
|
+
]
|
479
|
+
assert_equal(top_page_attributes, top_page_record.attributes)
|
451
480
|
end
|
452
481
|
|
453
482
|
def test_dynamic_accessor
|
metadata
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rroonga
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.2
|
5
5
|
segments:
|
6
6
|
- 1
|
7
7
|
- 2
|
8
|
-
-
|
8
|
+
- 2
|
9
9
|
prerelease: false
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
@@ -17,7 +17,7 @@ authors:
|
|
17
17
|
autorequire: !!null
|
18
18
|
bindir: bin
|
19
19
|
cert_chain: []
|
20
|
-
date: 2011-06-
|
20
|
+
date: 2011-06-27 00:00:00.000000000 +09:00
|
21
21
|
default_executable: grndump
|
22
22
|
dependencies: []
|
23
23
|
description: ! 'rroonga is an extension library to use groonga''s DB-API
|
@@ -51,47 +51,88 @@ files:
|
|
51
51
|
- ext/groonga/Makefile
|
52
52
|
- ext/groonga/extconf.rb
|
53
53
|
- ext/groonga/groonga.def
|
54
|
+
- ext/groonga/groonga.so
|
54
55
|
- ext/groonga/rb-grn-accessor.c
|
56
|
+
- ext/groonga/rb-grn-accessor.o
|
55
57
|
- ext/groonga/rb-grn-array-cursor.c
|
58
|
+
- ext/groonga/rb-grn-array-cursor.o
|
56
59
|
- ext/groonga/rb-grn-array.c
|
60
|
+
- ext/groonga/rb-grn-array.o
|
57
61
|
- ext/groonga/rb-grn-column.c
|
62
|
+
- ext/groonga/rb-grn-column.o
|
58
63
|
- ext/groonga/rb-grn-context.c
|
64
|
+
- ext/groonga/rb-grn-context.o
|
59
65
|
- ext/groonga/rb-grn-database.c
|
66
|
+
- ext/groonga/rb-grn-database.o
|
60
67
|
- ext/groonga/rb-grn-encoding-support.c
|
68
|
+
- ext/groonga/rb-grn-encoding-support.o
|
61
69
|
- ext/groonga/rb-grn-encoding.c
|
70
|
+
- ext/groonga/rb-grn-encoding.o
|
62
71
|
- ext/groonga/rb-grn-exception.c
|
72
|
+
- ext/groonga/rb-grn-exception.o
|
63
73
|
- ext/groonga/rb-grn-expression-builder.c
|
74
|
+
- ext/groonga/rb-grn-expression-builder.o
|
64
75
|
- ext/groonga/rb-grn-expression.c
|
76
|
+
- ext/groonga/rb-grn-expression.o
|
65
77
|
- ext/groonga/rb-grn-fix-size-column.c
|
78
|
+
- ext/groonga/rb-grn-fix-size-column.o
|
66
79
|
- ext/groonga/rb-grn-hash-cursor.c
|
80
|
+
- ext/groonga/rb-grn-hash-cursor.o
|
67
81
|
- ext/groonga/rb-grn-hash.c
|
82
|
+
- ext/groonga/rb-grn-hash.o
|
68
83
|
- ext/groonga/rb-grn-index-column.c
|
84
|
+
- ext/groonga/rb-grn-index-column.o
|
69
85
|
- ext/groonga/rb-grn-index-cursor.c
|
86
|
+
- ext/groonga/rb-grn-index-cursor.o
|
70
87
|
- ext/groonga/rb-grn-logger.c
|
88
|
+
- ext/groonga/rb-grn-logger.o
|
71
89
|
- ext/groonga/rb-grn-object.c
|
90
|
+
- ext/groonga/rb-grn-object.o
|
72
91
|
- ext/groonga/rb-grn-operator.c
|
92
|
+
- ext/groonga/rb-grn-operator.o
|
73
93
|
- ext/groonga/rb-grn-patricia-trie-cursor.c
|
94
|
+
- ext/groonga/rb-grn-patricia-trie-cursor.o
|
74
95
|
- ext/groonga/rb-grn-patricia-trie.c
|
96
|
+
- ext/groonga/rb-grn-patricia-trie.o
|
75
97
|
- ext/groonga/rb-grn-plugin.c
|
98
|
+
- ext/groonga/rb-grn-plugin.o
|
76
99
|
- ext/groonga/rb-grn-posting.c
|
100
|
+
- ext/groonga/rb-grn-posting.o
|
77
101
|
- ext/groonga/rb-grn-procedure.c
|
102
|
+
- ext/groonga/rb-grn-procedure.o
|
78
103
|
- ext/groonga/rb-grn-query.c
|
104
|
+
- ext/groonga/rb-grn-query.o
|
79
105
|
- ext/groonga/rb-grn-record.c
|
106
|
+
- ext/groonga/rb-grn-record.o
|
80
107
|
- ext/groonga/rb-grn-snippet.c
|
108
|
+
- ext/groonga/rb-grn-snippet.o
|
81
109
|
- ext/groonga/rb-grn-table-cursor-key-support.c
|
110
|
+
- ext/groonga/rb-grn-table-cursor-key-support.o
|
82
111
|
- ext/groonga/rb-grn-table-cursor.c
|
112
|
+
- ext/groonga/rb-grn-table-cursor.o
|
83
113
|
- ext/groonga/rb-grn-table-key-support.c
|
114
|
+
- ext/groonga/rb-grn-table-key-support.o
|
84
115
|
- ext/groonga/rb-grn-table.c
|
116
|
+
- ext/groonga/rb-grn-table.o
|
85
117
|
- ext/groonga/rb-grn-type.c
|
118
|
+
- ext/groonga/rb-grn-type.o
|
86
119
|
- ext/groonga/rb-grn-utils.c
|
120
|
+
- ext/groonga/rb-grn-utils.o
|
87
121
|
- ext/groonga/rb-grn-variable-size-column.c
|
122
|
+
- ext/groonga/rb-grn-variable-size-column.o
|
88
123
|
- ext/groonga/rb-grn-variable.c
|
124
|
+
- ext/groonga/rb-grn-variable.o
|
89
125
|
- ext/groonga/rb-grn-view-accessor.c
|
126
|
+
- ext/groonga/rb-grn-view-accessor.o
|
90
127
|
- ext/groonga/rb-grn-view-cursor.c
|
128
|
+
- ext/groonga/rb-grn-view-cursor.o
|
91
129
|
- ext/groonga/rb-grn-view-record.c
|
130
|
+
- ext/groonga/rb-grn-view-record.o
|
92
131
|
- ext/groonga/rb-grn-view.c
|
132
|
+
- ext/groonga/rb-grn-view.o
|
93
133
|
- ext/groonga/rb-grn.h
|
94
134
|
- ext/groonga/rb-groonga.c
|
135
|
+
- ext/groonga/rb-groonga.o
|
95
136
|
- extconf.rb
|
96
137
|
- lib/groonga.rb
|
97
138
|
- lib/groonga/context.rb
|