rroonga 1.0.5 → 1.0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/NEWS.ja.rdoc +12 -0
- data/NEWS.rdoc +12 -0
- data/README.ja.rdoc +3 -2
- data/README.rdoc +2 -1
- data/Rakefile +2 -1
- data/ext/groonga/extconf.rb +6 -6
- data/ext/groonga/rb-grn-accessor.c +1 -1
- data/ext/groonga/rb-grn-array.c +1 -1
- data/ext/groonga/rb-grn-column.c +4 -4
- data/ext/groonga/rb-grn-context.c +3 -3
- data/ext/groonga/rb-grn-database.c +3 -3
- data/ext/groonga/rb-grn-expression.c +3 -3
- data/ext/groonga/rb-grn-hash.c +2 -2
- data/ext/groonga/rb-grn-index-column.c +2 -2
- data/ext/groonga/rb-grn-logger.c +2 -2
- data/ext/groonga/rb-grn-object.c +14 -14
- data/ext/groonga/rb-grn-patricia-trie.c +5 -5
- data/ext/groonga/rb-grn-procedure.c +1 -1
- data/ext/groonga/rb-grn-query.c +3 -3
- data/ext/groonga/rb-grn-snippet.c +3 -3
- data/ext/groonga/rb-grn-table-cursor.c +1 -1
- data/ext/groonga/rb-grn-table-key-support.c +5 -5
- data/ext/groonga/rb-grn-table.c +36 -40
- data/ext/groonga/rb-grn-type.c +1 -1
- data/ext/groonga/rb-grn-utils.c +16 -16
- data/ext/groonga/rb-grn-variable.c +1 -1
- data/ext/groonga/rb-grn-view-accessor.c +1 -1
- data/ext/groonga/rb-grn-view.c +1 -1
- data/ext/groonga/rb-grn.h +12 -16
- data/ext/groonga/rb-groonga.c +2 -2
- data/extconf.rb +9 -3
- data/html/index.html +7 -3
- data/test-unit/COPYING +56 -0
- data/test-unit/GPL +340 -0
- data/test-unit/PSFL +271 -0
- data/test-unit/Rakefile +18 -5
- data/test-unit/html/bar.svg +153 -0
- data/test-unit/html/developer.svg +469 -0
- data/test-unit/html/favicon.ico +0 -0
- data/test-unit/html/favicon.svg +82 -0
- data/test-unit/html/heading-mark.svg +393 -0
- data/test-unit/html/index.html +235 -13
- data/test-unit/html/index.html.ja +258 -15
- data/test-unit/html/install.svg +636 -0
- data/test-unit/html/logo.svg +483 -0
- data/test-unit/html/test-unit.css +339 -0
- data/test-unit/html/tutorial.svg +559 -0
- data/test-unit/lib/test/unit/assertions.rb +115 -11
- data/test-unit/lib/test/unit/autorunner.rb +5 -2
- data/test-unit/lib/test/unit/collector/load.rb +1 -1
- data/test-unit/lib/test/unit/color-scheme.rb +6 -2
- data/test-unit/lib/test/unit/diff.rb +17 -1
- data/test-unit/lib/test/unit/testcase.rb +7 -0
- data/test-unit/lib/test/unit/testresult.rb +34 -2
- data/test-unit/lib/test/unit/ui/console/testrunner.rb +9 -45
- data/test-unit/lib/test/unit/ui/tap/testrunner.rb +2 -12
- data/test-unit/lib/test/unit/ui/testrunner.rb +25 -0
- data/test-unit/lib/test/unit/util/backtracefilter.rb +1 -0
- data/test-unit/lib/test/unit/util/output.rb +31 -0
- data/test-unit/lib/test/unit/version.rb +1 -1
- data/test-unit/lib/test/unit.rb +6 -1
- data/test-unit/test/test-color-scheme.rb +4 -2
- data/test-unit/test/test_assertions.rb +51 -5
- data/test-unit/test/ui/test_tap.rb +33 -0
- data/test-unit/test/util/test-output.rb +11 -0
- data/test-unit-notify/Rakefile +47 -0
- data/test-unit-notify/lib/test/unit/notify.rb +104 -0
- metadata +40 -9
- data/ext/groonga/mkmf.log +0 -99
- data/test-unit/html/classic.html +0 -15
data/NEWS.ja.rdoc
CHANGED
data/NEWS.rdoc
CHANGED
@@ -1,5 +1,17 @@
|
|
1
1
|
= NEWS
|
2
2
|
|
3
|
+
== 1.0.7: 2010-12-19
|
4
|
+
|
5
|
+
=== Fixes
|
6
|
+
|
7
|
+
* Supported pkg-config installed by RubyGems on Ruby 1.8.
|
8
|
+
[Reported by @kamipo]
|
9
|
+
* Fixed a memory leak in Groonga::Table#columns.
|
10
|
+
|
11
|
+
=== Thanks
|
12
|
+
|
13
|
+
* @kamipo
|
14
|
+
|
3
15
|
== 1.0.5: 2010-11-29
|
4
16
|
|
5
17
|
=== Improvements
|
data/README.ja.rdoc
CHANGED
@@ -36,7 +36,7 @@ LGPL 2.1です。詳しくはlicense/LGPLを見てください。
|
|
36
36
|
== 依存ソフトウェア
|
37
37
|
|
38
38
|
* Ruby >= 1.8 (1.9.1, 1.9.2対応)
|
39
|
-
* groonga >= 1.0.
|
39
|
+
* groonga >= 1.0.4
|
40
40
|
|
41
41
|
== インストール
|
42
42
|
|
@@ -61,6 +61,7 @@ http://lists.sourceforge.jp/mailman/listinfo/groonga-dev
|
|
61
61
|
* テストを書いてくれました。
|
62
62
|
* バグを直してくれました。
|
63
63
|
* id:mat_akiさん: チュートリアルのバグを教えてくれました。
|
64
|
-
* @yune_kotomi
|
64
|
+
* @yune_kotomiさん: バグレポートしてくれました。
|
65
65
|
* 咳さん: バグレポートしてくれました。
|
66
66
|
* 小野マトペさん: バグレポートしてくれました。
|
67
|
+
* @kamipoさん: バグレポートしてくれました。
|
data/README.rdoc
CHANGED
@@ -36,7 +36,7 @@ inclidng contributed patches.)
|
|
36
36
|
== Dependencies
|
37
37
|
|
38
38
|
* Ruby >= 1.8 (including 1.9.1 and 1.9.2)
|
39
|
-
* groonga >= 1.0.
|
39
|
+
* groonga >= 1.0.4
|
40
40
|
|
41
41
|
== Install
|
42
42
|
|
@@ -64,3 +64,4 @@ http://rubyforge.org/mailman/listinfo/groonga-users-en
|
|
64
64
|
* @yune_kotomi: sent a bug report.
|
65
65
|
* m_seki: sent bug reports.
|
66
66
|
* ono matope: sent bug reports.
|
67
|
+
* @kamipo: send a bug report.
|
data/Rakefile
CHANGED
@@ -138,7 +138,8 @@ ObjectSpace.each_object(Rake::RDocTask) do |rdoc_task|
|
|
138
138
|
rdoc_task.options[t_option_index, 2] = nil
|
139
139
|
rdoc_task.title = "rroonga - #{version}"
|
140
140
|
|
141
|
-
rdoc_task.rdoc_files = ["ext/rb-groonga.c"]
|
141
|
+
rdoc_task.rdoc_files = ["ext/groonga/rb-groonga.c"]
|
142
|
+
rdoc_task.rdoc_files += Dir.glob("ext/groonga/rb-grn-*.c")
|
142
143
|
rdoc_task.rdoc_files += Dir.glob("lib/**/*.rb")
|
143
144
|
rdoc_task.rdoc_files += Dir.glob("**/*.rdoc")
|
144
145
|
end
|
data/ext/groonga/extconf.rb
CHANGED
@@ -15,14 +15,9 @@
|
|
15
15
|
# License along with this library; if not, write to the Free Software
|
16
16
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
17
17
|
|
18
|
-
require 'pathname'
|
19
|
-
|
20
|
-
base_dir = Pathname(__FILE__).dirname.parent.parent
|
21
|
-
$LOAD_PATH.unshift(base_dir.to_s)
|
22
|
-
|
23
18
|
require 'English'
|
19
|
+
require 'pathname'
|
24
20
|
require 'mkmf'
|
25
|
-
require 'rroonga-build'
|
26
21
|
|
27
22
|
begin
|
28
23
|
require 'pkg-config'
|
@@ -31,6 +26,11 @@ rescue LoadError
|
|
31
26
|
require 'pkg-config'
|
32
27
|
end
|
33
28
|
|
29
|
+
base_dir = Pathname(__FILE__).dirname.parent.parent
|
30
|
+
$LOAD_PATH.unshift(base_dir.to_s)
|
31
|
+
|
32
|
+
require 'rroonga-build'
|
33
|
+
|
34
34
|
include RroongaBuild
|
35
35
|
|
36
36
|
package_name = "groonga"
|
data/ext/groonga/rb-grn-array.c
CHANGED
@@ -139,7 +139,7 @@ rb_grn_array_s_create (int argc, VALUE *argv, VALUE klass)
|
|
139
139
|
flags, NULL, value_type);
|
140
140
|
if (!table)
|
141
141
|
rb_grn_context_check(context, rb_ary_new4(argc, argv));
|
142
|
-
rb_table = GRNOBJECT2RVAL(klass, context, table,
|
142
|
+
rb_table = GRNOBJECT2RVAL(klass, context, table, GRN_TRUE);
|
143
143
|
rb_grn_context_check(context, rb_table);
|
144
144
|
rb_iv_set(rb_table, "@context", rb_context);
|
145
145
|
|
data/ext/groonga/rb-grn-column.c
CHANGED
@@ -60,7 +60,7 @@ rb_grn_column_from_ruby_object (VALUE object, grn_ctx **context)
|
|
60
60
|
|
61
61
|
VALUE
|
62
62
|
rb_grn_column_to_ruby_object (VALUE klass, grn_ctx *context, grn_obj *column,
|
63
|
-
|
63
|
+
grn_bool owner)
|
64
64
|
{
|
65
65
|
return GRNOBJECT2RVAL(klass, context, column, owner);
|
66
66
|
}
|
@@ -128,7 +128,7 @@ rb_grn_column_get_table (VALUE self)
|
|
128
128
|
table = grn_column_table(context, column);
|
129
129
|
rb_grn_context_check(context, self);
|
130
130
|
|
131
|
-
return GRNOBJECT2RVAL(Qnil, context, table,
|
131
|
+
return GRNOBJECT2RVAL(Qnil, context, table, GRN_FALSE);
|
132
132
|
}
|
133
133
|
|
134
134
|
/*
|
@@ -333,7 +333,7 @@ rb_grn_column_select (int argc, VALUE *argv, VALUE self)
|
|
333
333
|
GRN_TABLE_HASH_KEY | GRN_OBJ_WITH_SUBREC,
|
334
334
|
table,
|
335
335
|
0);
|
336
|
-
rb_result = GRNTABLE2RVAL(context, result,
|
336
|
+
rb_result = GRNTABLE2RVAL(context, result, GRN_TRUE);
|
337
337
|
} else {
|
338
338
|
result = RVAL2GRNTABLE(rb_result, &context);
|
339
339
|
}
|
@@ -355,7 +355,7 @@ rb_grn_column_select (int argc, VALUE *argv, VALUE self)
|
|
355
355
|
|
356
356
|
rb_attr(rb_singleton_class(rb_result),
|
357
357
|
rb_intern("expression"),
|
358
|
-
|
358
|
+
GRN_TRUE, GRN_FALSE, GRN_FALSE);
|
359
359
|
rb_iv_set(rb_result, "@expression", rb_expression);
|
360
360
|
|
361
361
|
return rb_result;
|
@@ -376,7 +376,7 @@ rb_grn_context_inspect (VALUE self)
|
|
376
376
|
|
377
377
|
rb_str_cat2(inspected, "database: <");
|
378
378
|
database = grn_ctx_db(context);
|
379
|
-
rb_database = GRNDB2RVAL(context, database,
|
379
|
+
rb_database = GRNDB2RVAL(context, database, GRN_FALSE);
|
380
380
|
rb_str_concat(inspected, rb_inspect(rb_database));
|
381
381
|
rb_str_cat2(inspected, ">");
|
382
382
|
|
@@ -474,7 +474,7 @@ rb_grn_context_get_database (VALUE self)
|
|
474
474
|
grn_ctx *context;
|
475
475
|
|
476
476
|
context = SELF(self);
|
477
|
-
return GRNDB2RVAL(context, grn_ctx_db(context),
|
477
|
+
return GRNDB2RVAL(context, grn_ctx_db(context), GRN_FALSE);
|
478
478
|
}
|
479
479
|
|
480
480
|
/*
|
@@ -693,7 +693,7 @@ rb_grn_context_array_reference (VALUE self, VALUE name_or_id)
|
|
693
693
|
break;
|
694
694
|
}
|
695
695
|
|
696
|
-
return GRNOBJECT2RVAL(Qnil, context, object,
|
696
|
+
return GRNOBJECT2RVAL(Qnil, context, object, GRN_FALSE);
|
697
697
|
}
|
698
698
|
|
699
699
|
void
|
@@ -45,7 +45,7 @@ rb_grn_database_from_ruby_object (VALUE object)
|
|
45
45
|
|
46
46
|
VALUE
|
47
47
|
rb_grn_database_to_ruby_object (grn_ctx *context, grn_obj *database,
|
48
|
-
|
48
|
+
grn_bool owner)
|
49
49
|
{
|
50
50
|
return GRNOBJECT2RVAL(rb_cGrnDatabase, context, database, owner);
|
51
51
|
}
|
@@ -195,7 +195,7 @@ rb_grn_database_s_create (int argc, VALUE *argv, VALUE klass)
|
|
195
195
|
grn_obj_unlink(context, old_database);
|
196
196
|
database = grn_db_create(context, path, &create_args);
|
197
197
|
rb_grn_context_check(context, rb_ary_new4(argc, argv));
|
198
|
-
rb_database = GRNOBJECT2RVAL(klass, context, database,
|
198
|
+
rb_database = GRNOBJECT2RVAL(klass, context, database, GRN_TRUE);
|
199
199
|
rb_iv_set(rb_database, "@context", rb_context);
|
200
200
|
if (!NIL_P(rb_context))
|
201
201
|
rb_iv_set(rb_context, "database", rb_database);
|
@@ -315,7 +315,7 @@ rb_grn_database_each (VALUE self)
|
|
315
315
|
|
316
316
|
object = grn_ctx_at(context, id);
|
317
317
|
if (object)
|
318
|
-
rb_yield(GRNOBJECT2RVAL(Qnil, context, object,
|
318
|
+
rb_yield(GRNOBJECT2RVAL(Qnil, context, object, GRN_FALSE));
|
319
319
|
}
|
320
320
|
rb_grn_object_close(rb_cursor);
|
321
321
|
rb_iv_set(self, "cursor", Qnil);
|
@@ -334,7 +334,7 @@ rb_grn_expression_parse (int argc, VALUE *argv, VALUE self)
|
|
334
334
|
{
|
335
335
|
grn_ctx *context = NULL;
|
336
336
|
grn_obj *expression, *default_column;
|
337
|
-
|
337
|
+
grn_bool default_column_is_created = GRN_FALSE;
|
338
338
|
grn_operator default_operator = GRN_OP_AND;
|
339
339
|
grn_operator default_mode = GRN_OP_MATCH;
|
340
340
|
grn_rc rc;
|
@@ -370,7 +370,7 @@ rb_grn_expression_parse (int argc, VALUE *argv, VALUE self)
|
|
370
370
|
default_column = RVAL2GRNOBJECT(rb_default_column, &context);
|
371
371
|
} else {
|
372
372
|
default_column = RVAL2GRNBULK(rb_default_column, context, NULL);
|
373
|
-
default_column_is_created =
|
373
|
+
default_column_is_created = GRN_TRUE;
|
374
374
|
}
|
375
375
|
|
376
376
|
if (!NIL_P(rb_default_mode))
|
@@ -701,7 +701,7 @@ rb_grn_expression_snippet (int argc, VALUE *argv, VALUE self)
|
|
701
701
|
rb_grn_context_check(context,
|
702
702
|
rb_ary_new3(2, self, rb_ary_new4(argc, argv)));
|
703
703
|
|
704
|
-
return GRNSNIPPET2RVAL(context, snippet,
|
704
|
+
return GRNSNIPPET2RVAL(context, snippet, GRN_TRUE);
|
705
705
|
}
|
706
706
|
|
707
707
|
void
|
data/ext/groonga/rb-grn-hash.c
CHANGED
@@ -207,7 +207,7 @@ rb_grn_hash_s_create (int argc, VALUE *argv, VALUE klass)
|
|
207
207
|
flags, key_type, value_type);
|
208
208
|
if (!table)
|
209
209
|
rb_grn_context_check(context, rb_ary_new4(argc, argv));
|
210
|
-
rb_table = GRNOBJECT2RVAL(klass, context, table,
|
210
|
+
rb_table = GRNOBJECT2RVAL(klass, context, table, GRN_TRUE);
|
211
211
|
|
212
212
|
if (!NIL_P(rb_default_tokenizer))
|
213
213
|
rb_funcall(rb_table, rb_intern("default_tokenizer="), 1,
|
@@ -275,7 +275,7 @@ rb_grn_hash_search (int argc, VALUE *argv, VALUE self)
|
|
275
275
|
GRN_OBJ_TABLE_HASH_KEY | GRN_OBJ_WITH_SUBREC,
|
276
276
|
table, 0);
|
277
277
|
rb_grn_context_check(context, self);
|
278
|
-
rb_result = GRNOBJECT2RVAL(Qnil, context, result,
|
278
|
+
rb_result = GRNOBJECT2RVAL(Qnil, context, result, GRN_TRUE);
|
279
279
|
} else {
|
280
280
|
result = RVAL2GRNOBJECT(rb_result, &context);
|
281
281
|
}
|
@@ -257,7 +257,7 @@ rb_grn_index_column_get_sources (VALUE self)
|
|
257
257
|
VALUE rb_source;
|
258
258
|
|
259
259
|
source = grn_ctx_at(context, *source_ids);
|
260
|
-
rb_source = GRNOBJECT2RVAL(Qnil, context, source,
|
260
|
+
rb_source = GRNOBJECT2RVAL(Qnil, context, source, GRN_FALSE);
|
261
261
|
rb_ary_push(rb_sources, rb_source);
|
262
262
|
source_ids++;
|
263
263
|
}
|
@@ -470,7 +470,7 @@ rb_grn_index_column_search (int argc, VALUE *argv, VALUE self)
|
|
470
470
|
GRN_OBJ_TABLE_HASH_KEY | GRN_OBJ_WITH_SUBREC,
|
471
471
|
range, 0);
|
472
472
|
rb_grn_context_check(context, self);
|
473
|
-
rb_result = GRNOBJECT2RVAL(Qnil, context, result,
|
473
|
+
rb_result = GRNOBJECT2RVAL(Qnil, context, result, GRN_TRUE);
|
474
474
|
} else {
|
475
475
|
result = RVAL2GRNOBJECT(rb_result, &context);
|
476
476
|
}
|
data/ext/groonga/rb-grn-logger.c
CHANGED
@@ -368,7 +368,7 @@ static VALUE
|
|
368
368
|
rb_grn_logger_s_set_path (VALUE klass, VALUE rb_path,
|
369
369
|
const char **path, const char *class_variable_name)
|
370
370
|
{
|
371
|
-
|
371
|
+
grn_bool need_reopen = GRN_FALSE;
|
372
372
|
|
373
373
|
if (NIL_P(rb_path)) {
|
374
374
|
need_reopen = *path != NULL;
|
@@ -377,7 +377,7 @@ rb_grn_logger_s_set_path (VALUE klass, VALUE rb_path,
|
|
377
377
|
const char *current_path = *path;
|
378
378
|
*path = RSTRING_PTR(rb_path);
|
379
379
|
if (!current_path || strcmp(*path, current_path) != 0) {
|
380
|
-
need_reopen =
|
380
|
+
need_reopen = GRN_TRUE;
|
381
381
|
}
|
382
382
|
}
|
383
383
|
rb_cv_set(klass, class_variable_name, rb_path);
|
data/ext/groonga/rb-grn-object.c
CHANGED
@@ -248,7 +248,7 @@ rb_grn_object_to_ruby_class (grn_obj *object)
|
|
248
248
|
|
249
249
|
VALUE
|
250
250
|
rb_grn_object_to_ruby_object (VALUE klass, grn_ctx *context, grn_obj *object,
|
251
|
-
|
251
|
+
grn_bool owner)
|
252
252
|
{
|
253
253
|
RbGrnContext *rb_grn_context;
|
254
254
|
VALUE rb_object, rb_context = Qnil;
|
@@ -290,8 +290,8 @@ rb_grn_object_bind_common (VALUE klass, VALUE self, VALUE rb_context,
|
|
290
290
|
rb_grn_object->context = context;
|
291
291
|
rb_grn_object->object = object;
|
292
292
|
rb_grn_object->self = self;
|
293
|
-
rb_grn_object->need_close =
|
294
|
-
rb_grn_object->have_finalizer =
|
293
|
+
rb_grn_object->need_close = GRN_TRUE;
|
294
|
+
rb_grn_object->have_finalizer = GRN_FALSE;
|
295
295
|
|
296
296
|
user_data = grn_obj_user_data(context, object);
|
297
297
|
if (user_data) {
|
@@ -300,17 +300,17 @@ rb_grn_object_bind_common (VALUE klass, VALUE self, VALUE rb_context,
|
|
300
300
|
object->header.type);
|
301
301
|
user_data->ptr = rb_grn_object;
|
302
302
|
grn_obj_set_finalizer(context, object, rb_grn_object_finalizer);
|
303
|
-
rb_grn_object->have_finalizer =
|
303
|
+
rb_grn_object->have_finalizer = GRN_TRUE;
|
304
304
|
}
|
305
305
|
|
306
306
|
switch (object->header.type) {
|
307
307
|
case GRN_PROC:
|
308
308
|
case GRN_TYPE:
|
309
|
-
rb_grn_object->need_close =
|
309
|
+
rb_grn_object->need_close = GRN_FALSE;
|
310
310
|
break;
|
311
311
|
default:
|
312
312
|
if (klass == rb_cGrnVariable)
|
313
|
-
rb_grn_object->need_close =
|
313
|
+
rb_grn_object->need_close = GRN_FALSE;
|
314
314
|
break;
|
315
315
|
}
|
316
316
|
|
@@ -529,7 +529,7 @@ rb_grn_object_inspect_object (VALUE inspected, grn_ctx *context, grn_obj *object
|
|
529
529
|
{
|
530
530
|
VALUE rb_object;
|
531
531
|
|
532
|
-
rb_object = GRNOBJECT2RVAL(Qnil, context, object,
|
532
|
+
rb_object = GRNOBJECT2RVAL(Qnil, context, object, GRN_FALSE);
|
533
533
|
rb_str_concat(inspected, rb_inspect(rb_object));
|
534
534
|
|
535
535
|
return inspected;
|
@@ -997,7 +997,7 @@ rb_grn_object_get_domain (VALUE self)
|
|
997
997
|
|
998
998
|
domain_object = grn_ctx_at(context, domain);
|
999
999
|
if (domain_object)
|
1000
|
-
return GRNOBJECT2RVAL(Qnil, context, domain_object,
|
1000
|
+
return GRNOBJECT2RVAL(Qnil, context, domain_object, GRN_FALSE);
|
1001
1001
|
else
|
1002
1002
|
return UINT2NUM(domain);
|
1003
1003
|
}
|
@@ -1071,7 +1071,7 @@ rb_grn_object_get_range (VALUE self)
|
|
1071
1071
|
|
1072
1072
|
range_object = grn_ctx_at(context, range);
|
1073
1073
|
if (range_object)
|
1074
|
-
return GRNOBJECT2RVAL(Qnil, context, range_object,
|
1074
|
+
return GRNOBJECT2RVAL(Qnil, context, range_object, GRN_FALSE);
|
1075
1075
|
else
|
1076
1076
|
return UINT2NUM(range);
|
1077
1077
|
}
|
@@ -1181,7 +1181,7 @@ rb_grn_object_array_reference (VALUE self, VALUE rb_id)
|
|
1181
1181
|
return rb_value;
|
1182
1182
|
}
|
1183
1183
|
|
1184
|
-
static
|
1184
|
+
static grn_bool
|
1185
1185
|
rb_uvector_value_p (RbGrnObject *rb_grn_object, VALUE rb_value)
|
1186
1186
|
{
|
1187
1187
|
VALUE first_element;
|
@@ -1191,7 +1191,7 @@ rb_uvector_value_p (RbGrnObject *rb_grn_object, VALUE rb_value)
|
|
1191
1191
|
/* TODO: support not sizeof(grn_id) uvector. */
|
1192
1192
|
/*
|
1193
1193
|
if (!(rb_grn_object->range->header.flags | GRN_OBJ_KEY_VAR_SIZE)) {
|
1194
|
-
return
|
1194
|
+
return GRN_TRUE;
|
1195
1195
|
}
|
1196
1196
|
*/
|
1197
1197
|
break;
|
@@ -1201,14 +1201,14 @@ rb_uvector_value_p (RbGrnObject *rb_grn_object, VALUE rb_value)
|
|
1201
1201
|
case GRN_TABLE_VIEW:
|
1202
1202
|
first_element = rb_ary_entry(rb_value, 0);
|
1203
1203
|
if (rb_respond_to(first_element, rb_intern("record_raw_id"))) {
|
1204
|
-
return
|
1204
|
+
return GRN_TRUE;
|
1205
1205
|
}
|
1206
1206
|
break;
|
1207
1207
|
default:
|
1208
1208
|
break;
|
1209
1209
|
}
|
1210
1210
|
|
1211
|
-
return
|
1211
|
+
return GRN_FALSE;
|
1212
1212
|
}
|
1213
1213
|
|
1214
1214
|
VALUE
|
@@ -1345,7 +1345,7 @@ rb_grn_init_object (VALUE mGrn)
|
|
1345
1345
|
rb_cGrnObject = rb_define_class_under(mGrn, "Object", rb_cObject);
|
1346
1346
|
rb_define_alloc_func(rb_cGrnObject, rb_grn_object_alloc);
|
1347
1347
|
|
1348
|
-
rb_define_attr(rb_cGrnObject, "context",
|
1348
|
+
rb_define_attr(rb_cGrnObject, "context", GRN_TRUE, GRN_FALSE);
|
1349
1349
|
|
1350
1350
|
rb_define_method(rb_cGrnObject, "inspect", rb_grn_object_inspect, 0);
|
1351
1351
|
|
@@ -221,7 +221,7 @@ rb_grn_patricia_trie_s_create (int argc, VALUE *argv, VALUE klass)
|
|
221
221
|
flags, key_type, value_type);
|
222
222
|
if (!table)
|
223
223
|
rb_grn_context_check(context, rb_ary_new4(argc, argv));
|
224
|
-
rb_table = GRNOBJECT2RVAL(klass, context, table,
|
224
|
+
rb_table = GRNOBJECT2RVAL(klass, context, table, GRN_TRUE);
|
225
225
|
|
226
226
|
if (!NIL_P(rb_default_tokenizer))
|
227
227
|
rb_funcall(rb_table, rb_intern("default_tokenizer="), 1,
|
@@ -289,7 +289,7 @@ rb_grn_patricia_trie_search (int argc, VALUE *argv, VALUE self)
|
|
289
289
|
grn_obj *key, *domain, *result;
|
290
290
|
grn_operator operator;
|
291
291
|
grn_search_optarg search_options;
|
292
|
-
|
292
|
+
grn_bool search_options_is_set = GRN_FALSE;
|
293
293
|
VALUE rb_key, options, rb_result, rb_operator, rb_type;
|
294
294
|
|
295
295
|
rb_grn_table_key_support_deconstruct(SELF(self), &table, &context,
|
@@ -312,7 +312,7 @@ rb_grn_patricia_trie_search (int argc, VALUE *argv, VALUE self)
|
|
312
312
|
GRN_OBJ_TABLE_HASH_KEY | GRN_OBJ_WITH_SUBREC,
|
313
313
|
table, 0);
|
314
314
|
rb_grn_context_check(context, self);
|
315
|
-
rb_result = GRNOBJECT2RVAL(Qnil, context, result,
|
315
|
+
rb_result = GRNOBJECT2RVAL(Qnil, context, result, GRN_TRUE);
|
316
316
|
} else {
|
317
317
|
result = RVAL2GRNOBJECT(rb_result, &context);
|
318
318
|
}
|
@@ -381,7 +381,7 @@ rb_grn_patricia_trie_scan (VALUE self, VALUE rb_string)
|
|
381
381
|
grn_pat_scan_hit hits[1024];
|
382
382
|
const char *string;
|
383
383
|
long string_length;
|
384
|
-
|
384
|
+
grn_bool block_given;
|
385
385
|
|
386
386
|
string = StringValuePtr(rb_string);
|
387
387
|
string_length = RSTRING_LEN(rb_string);
|
@@ -459,7 +459,7 @@ rb_grn_patricia_trie_prefix_search (VALUE self, VALUE rb_prefix)
|
|
459
459
|
GRN_OBJ_TABLE_HASH_KEY,
|
460
460
|
table, 0);
|
461
461
|
rb_grn_context_check(context, self);
|
462
|
-
rb_result = GRNOBJECT2RVAL(Qnil, context, result,
|
462
|
+
rb_result = GRNOBJECT2RVAL(Qnil, context, result, GRN_TRUE);
|
463
463
|
|
464
464
|
GRN_BULK_REWIND(key);
|
465
465
|
RVAL2GRNKEY(rb_prefix, context, key, domain_id, domain, self);
|
data/ext/groonga/rb-grn-query.c
CHANGED
@@ -34,7 +34,7 @@ struct _RbGrnQuery
|
|
34
34
|
{
|
35
35
|
grn_ctx *context;
|
36
36
|
grn_query *query;
|
37
|
-
|
37
|
+
grn_bool owner;
|
38
38
|
};
|
39
39
|
|
40
40
|
VALUE rb_cGrnQuery;
|
@@ -86,7 +86,7 @@ rb_grn_query_to_ruby_object (grn_ctx *context, grn_query *query)
|
|
86
86
|
rb_grn_query = ALLOC(RbGrnQuery);
|
87
87
|
rb_grn_query->context = context;
|
88
88
|
rb_grn_query->query = query;
|
89
|
-
rb_grn_query->owner =
|
89
|
+
rb_grn_query->owner = GRN_FALSE;
|
90
90
|
|
91
91
|
return Data_Wrap_Struct(rb_cGrnQuery, NULL,
|
92
92
|
rb_rb_grn_query_free, rb_grn_query);
|
@@ -195,7 +195,7 @@ rb_grn_query_initialize (int argc, VALUE *argv, VALUE self)
|
|
195
195
|
DATA_PTR(self) = rb_grn_query;
|
196
196
|
rb_grn_query->context = context;
|
197
197
|
rb_grn_query->query = query;
|
198
|
-
rb_grn_query->owner =
|
198
|
+
rb_grn_query->owner = GRN_TRUE;
|
199
199
|
|
200
200
|
rb_iv_set(self, "@context", rb_context);
|
201
201
|
|
@@ -25,7 +25,7 @@ struct _RbGrnSnippet
|
|
25
25
|
{
|
26
26
|
grn_ctx *context;
|
27
27
|
grn_snip *snippet;
|
28
|
-
|
28
|
+
grn_bool owner;
|
29
29
|
};
|
30
30
|
|
31
31
|
VALUE rb_cGrnSnippet;
|
@@ -76,7 +76,7 @@ rb_rb_grn_snippet_free (void *object)
|
|
76
76
|
|
77
77
|
VALUE
|
78
78
|
rb_grn_snippet_to_ruby_object (grn_ctx *context, grn_snip *snippet,
|
79
|
-
|
79
|
+
grn_bool owner)
|
80
80
|
{
|
81
81
|
RbGrnSnippet *rb_grn_snippet;
|
82
82
|
|
@@ -201,7 +201,7 @@ rb_grn_snippet_initialize (int argc, VALUE *argv, VALUE self)
|
|
201
201
|
DATA_PTR(self) = rb_grn_snippet;
|
202
202
|
rb_grn_snippet->context = context;
|
203
203
|
rb_grn_snippet->snippet = snippet;
|
204
|
-
rb_grn_snippet->owner =
|
204
|
+
rb_grn_snippet->owner = GRN_TRUE;
|
205
205
|
|
206
206
|
rb_iv_set(self, "@context", rb_context);
|
207
207
|
|
@@ -42,7 +42,7 @@ rb_grn_table_cursor_from_ruby_object (VALUE object, grn_ctx **context)
|
|
42
42
|
VALUE
|
43
43
|
rb_grn_table_cursor_to_ruby_object (VALUE klass, grn_ctx *context,
|
44
44
|
grn_table_cursor *cursor,
|
45
|
-
|
45
|
+
grn_bool owner)
|
46
46
|
{
|
47
47
|
return GRNOBJECT2RVAL(klass, context, cursor, owner);
|
48
48
|
}
|
@@ -491,12 +491,12 @@ static VALUE
|
|
491
491
|
rb_grn_table_key_support_get_value (int argc, VALUE *argv, VALUE self)
|
492
492
|
{
|
493
493
|
VALUE rb_id_or_key, rb_options;
|
494
|
-
|
494
|
+
grn_bool use_key;
|
495
495
|
|
496
496
|
rb_scan_args(argc, argv, "11", &rb_id_or_key, &rb_options);
|
497
497
|
|
498
498
|
if (NIL_P(rb_options)) {
|
499
|
-
use_key =
|
499
|
+
use_key = GRN_TRUE;
|
500
500
|
} else {
|
501
501
|
VALUE rb_option_id;
|
502
502
|
|
@@ -562,12 +562,12 @@ static VALUE
|
|
562
562
|
rb_grn_table_key_support_set_value (int argc, VALUE *argv, VALUE self)
|
563
563
|
{
|
564
564
|
VALUE rb_id_or_key, rb_value, rb_options;
|
565
|
-
|
565
|
+
grn_bool use_key;
|
566
566
|
|
567
567
|
rb_scan_args(argc, argv, "21", &rb_id_or_key, &rb_value, &rb_options);
|
568
568
|
|
569
569
|
if (NIL_P(rb_options)) {
|
570
|
-
use_key =
|
570
|
+
use_key = GRN_TRUE;
|
571
571
|
} else {
|
572
572
|
VALUE rb_option_id;
|
573
573
|
|
@@ -608,7 +608,7 @@ rb_grn_table_key_support_get_default_tokenizer (VALUE self)
|
|
608
608
|
NULL);
|
609
609
|
rb_grn_context_check(context, self);
|
610
610
|
|
611
|
-
return GRNOBJECT2RVAL(Qnil, context, tokenizer,
|
611
|
+
return GRNOBJECT2RVAL(Qnil, context, tokenizer, GRN_FALSE);
|
612
612
|
}
|
613
613
|
|
614
614
|
/*
|