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/ext/groonga/rb-grn-table.c
CHANGED
@@ -51,7 +51,7 @@ rb_grn_table_from_ruby_object (VALUE object, grn_ctx **context)
|
|
51
51
|
|
52
52
|
VALUE
|
53
53
|
rb_grn_table_to_ruby_object (grn_ctx *context, grn_obj *table,
|
54
|
-
|
54
|
+
grn_bool owner)
|
55
55
|
{
|
56
56
|
return GRNOBJECT2RVAL(Qnil, context, table, owner);
|
57
57
|
}
|
@@ -243,20 +243,14 @@ rb_grn_table_inspect (VALUE self)
|
|
243
243
|
* カラムの値の格納方法について指定する。省略した場合は、
|
244
244
|
* +:scalar+になる。
|
245
245
|
*
|
246
|
-
* [+:scalar+]
|
247
|
-
*
|
248
|
-
*
|
249
|
-
* [+:vector+]
|
250
|
-
* 値の配列を格納する。
|
246
|
+
* [+:scalar+] スカラ値(単独の値)を格納する。
|
247
|
+
* [+:vector+] 値の配列を格納する。
|
251
248
|
*
|
252
249
|
* [+:compress+]
|
253
250
|
* 値の圧縮方法を指定する。省略した場合は、圧縮しない。
|
254
251
|
*
|
255
|
-
* [+:zlib+]
|
256
|
-
*
|
257
|
-
*
|
258
|
-
* [+:lzo+]
|
259
|
-
* 値をlzo圧縮して格納する。
|
252
|
+
* [+:zlib+] 値をzlib圧縮して格納する。
|
253
|
+
* [+:lzo+] 値をlzo圧縮して格納する。
|
260
254
|
*/
|
261
255
|
static VALUE
|
262
256
|
rb_grn_table_define_column (int argc, VALUE *argv, VALUE self)
|
@@ -337,7 +331,7 @@ rb_grn_table_define_column (int argc, VALUE *argv, VALUE self)
|
|
337
331
|
rb_ary_new3(2, self, rb_ary_new4(argc, argv)));
|
338
332
|
}
|
339
333
|
|
340
|
-
rb_column = GRNCOLUMN2RVAL(Qnil, context, column,
|
334
|
+
rb_column = GRNCOLUMN2RVAL(Qnil, context, column, GRN_TRUE);
|
341
335
|
rb_ary_push(columns, rb_column);
|
342
336
|
rb_grn_named_object_set_name(RB_GRN_NAMED_OBJECT(DATA_PTR(rb_column)),
|
343
337
|
name, name_size);
|
@@ -470,7 +464,7 @@ rb_grn_table_define_index_column (int argc, VALUE *argv, VALUE self)
|
|
470
464
|
rb_ary_new3(2, self, rb_ary_new4(argc, argv)));
|
471
465
|
}
|
472
466
|
|
473
|
-
rb_column = GRNCOLUMN2RVAL(Qnil, context, column,
|
467
|
+
rb_column = GRNCOLUMN2RVAL(Qnil, context, column, GRN_TRUE);
|
474
468
|
if (!NIL_P(rb_source))
|
475
469
|
rb_funcall(rb_column, rb_intern("source="), 1, rb_source);
|
476
470
|
if (!NIL_P(rb_sources))
|
@@ -520,7 +514,7 @@ rb_grn_table_get_column (VALUE self, VALUE rb_name)
|
|
520
514
|
grn_obj *column;
|
521
515
|
const char *name = NULL;
|
522
516
|
unsigned name_size = 0;
|
523
|
-
|
517
|
+
grn_bool owner;
|
524
518
|
VALUE rb_column;
|
525
519
|
VALUE columns;
|
526
520
|
VALUE *raw_columns;
|
@@ -623,8 +617,10 @@ rb_grn_table_get_columns (int argc, VALUE *argv, VALUE self)
|
|
623
617
|
rb_grn_context_check(context, self);
|
624
618
|
|
625
619
|
rb_columns = rb_ary_new2(n);
|
626
|
-
if (n == 0)
|
620
|
+
if (n == 0) {
|
621
|
+
grn_obj_unlink(context, columns);
|
627
622
|
return rb_columns;
|
623
|
+
}
|
628
624
|
|
629
625
|
cursor = grn_table_cursor_open(context, columns, NULL, 0, NULL, 0,
|
630
626
|
0, -1, GRN_CURSOR_ASCENDING);
|
@@ -638,10 +634,11 @@ rb_grn_table_get_columns (int argc, VALUE *argv, VALUE self)
|
|
638
634
|
grn_table_cursor_get_key(context, cursor, &key);
|
639
635
|
column_id = key;
|
640
636
|
column = grn_ctx_at(context, *column_id);
|
641
|
-
rb_column = GRNOBJECT2RVAL(Qnil, context, column,
|
637
|
+
rb_column = GRNOBJECT2RVAL(Qnil, context, column, GRN_FALSE);
|
642
638
|
rb_ary_push(rb_columns, rb_column);
|
643
639
|
}
|
644
640
|
rc = grn_table_cursor_close(context, cursor);
|
641
|
+
grn_obj_unlink(context, columns);
|
645
642
|
if (rc != GRN_SUCCESS) {
|
646
643
|
rb_grn_context_check(context, self);
|
647
644
|
rb_grn_rc_check(rc, self);
|
@@ -780,7 +777,7 @@ rb_grn_table_open_grn_cursor (int argc, VALUE *argv, VALUE self,
|
|
780
777
|
/*
|
781
778
|
* call-seq:
|
782
779
|
* table.open_cursor(options={}) -> Groonga::TableCursor
|
783
|
-
* table.open_cursor(options={}) {|cursor|
|
780
|
+
* table.open_cursor(options={}) {|cursor| }
|
784
781
|
*
|
785
782
|
* カーソルを生成して返す。ブロックを指定すると、そのブロッ
|
786
783
|
* クに生成したカーソルが渡され、ブロックを抜けると自動的に
|
@@ -933,7 +930,7 @@ rb_grn_table_truncate (VALUE self)
|
|
933
930
|
|
934
931
|
/*
|
935
932
|
* call-seq:
|
936
|
-
* table.each {|record|
|
933
|
+
* table.each {|record| } -> nil
|
937
934
|
*
|
938
935
|
* テーブルに登録されているレコードを順番にブロックに渡す。
|
939
936
|
*/
|
@@ -1137,8 +1134,8 @@ rb_grn_table_sort (int argc, VALUE *argv, VALUE self)
|
|
1137
1134
|
|
1138
1135
|
/*
|
1139
1136
|
* call-seq:
|
1140
|
-
* table.group(key, options={}) -> Groonga::Hash
|
1141
1137
|
* table.group([key1, key2, ...], options={}) -> [Groonga::Hash, ...]
|
1138
|
+
* table.group(key, options={}) -> Groonga::Hash
|
1142
1139
|
*
|
1143
1140
|
* _table_のレコードを_key1_, _key2_, _..._で指定したキーの
|
1144
1141
|
* 値でグループ化する。多くの場合、キーにはカラムを指定する。
|
@@ -1221,7 +1218,7 @@ rb_grn_table_group (int argc, VALUE *argv, VALUE self)
|
|
1221
1218
|
results[i].flags = 0;
|
1222
1219
|
results[i].op = GRN_OP_OR;
|
1223
1220
|
|
1224
|
-
rb_result = GRNOBJECT2RVAL(Qnil, context, result,
|
1221
|
+
rb_result = GRNOBJECT2RVAL(Qnil, context, result, GRN_TRUE);
|
1225
1222
|
rb_ary_push(rb_results, rb_result);
|
1226
1223
|
}
|
1227
1224
|
|
@@ -1538,7 +1535,7 @@ rb_grn_table_unlock_ensure (VALUE self)
|
|
1538
1535
|
*
|
1539
1536
|
* call-seq:
|
1540
1537
|
* table.lock(options={})
|
1541
|
-
* table.lock(options={}) {
|
1538
|
+
* table.lock(options={}) {}
|
1542
1539
|
*
|
1543
1540
|
* _table_をロックする。ロックに失敗した場合は
|
1544
1541
|
* Groonga::ResourceDeadlockAvoided例外が発生する。
|
@@ -1714,19 +1711,19 @@ rb_grn_table_is_locked (int argc, VALUE *argv, VALUE self)
|
|
1714
1711
|
* 指定する。演算子は以下の通り。
|
1715
1712
|
*
|
1716
1713
|
* [なし]
|
1717
|
-
* [カラム値] == [値]
|
1714
|
+
* \[カラム値] == [値]
|
1718
1715
|
* [<tt>!</tt>]
|
1719
|
-
* [カラム値] != [値]
|
1716
|
+
* \[カラム値] != [値]
|
1720
1717
|
* [<tt><</tt>]
|
1721
|
-
* [カラム値] < [値]
|
1718
|
+
* \[カラム値] < [値]
|
1722
1719
|
* [<tt>></tt>]
|
1723
|
-
* [カラム値] > [値]
|
1720
|
+
* \[カラム値] > [値]
|
1724
1721
|
* [<tt><=</tt>]
|
1725
|
-
* [カラム値] <= [値]
|
1722
|
+
* \[カラム値] <= [値]
|
1726
1723
|
* [<tt>>=</tt>]
|
1727
|
-
* [カラム値] >= [値]
|
1724
|
+
* \[カラム値] >= [値]
|
1728
1725
|
* [<tt>@</tt>]
|
1729
|
-
* [カラム値]が[値]を含んでいるかどうか
|
1726
|
+
* \[カラム値]が[値]を含んでいるかどうか
|
1730
1727
|
*
|
1731
1728
|
* 例:
|
1732
1729
|
* "name:daijiro" # "name"カラムの値が"daijiro"のレコードにマッチ
|
@@ -1748,16 +1745,15 @@ rb_grn_table_is_locked (int argc, VALUE *argv, VALUE self)
|
|
1748
1745
|
* マッチしたレコードをどのように扱うか。指定可能な値は以
|
1749
1746
|
* 下の通り。省略した場合はGroonga::Operation::OR。
|
1750
1747
|
*
|
1751
|
-
* [Groonga::Operation::OR]
|
1752
|
-
*
|
1753
|
-
*
|
1754
|
-
* [Groonga::Operation::AND]
|
1755
|
-
*
|
1756
|
-
*
|
1757
|
-
* [Groonga::Operation::BUT]
|
1758
|
-
*
|
1759
|
-
*
|
1760
|
-
* マッチしたレコードのスコアを増加。
|
1748
|
+
* [Groonga::Operation::OR] マッチしたレコードを追加。すで
|
1749
|
+
* にレコードが追加されている場合
|
1750
|
+
* は何もしない。
|
1751
|
+
* [Groonga::Operation::AND] マッチしたレコードのスコアを増
|
1752
|
+
* 加。マッチしなかったレコード
|
1753
|
+
* を削除。
|
1754
|
+
* [Groonga::Operation::BUT] マッチしたレコードを削除。
|
1755
|
+
* [Groonga::Operation::ADJUST] マッチしたレコードのスコア
|
1756
|
+
* を増加。
|
1761
1757
|
*
|
1762
1758
|
* [+:result+]
|
1763
1759
|
* 検索結果を格納するテーブル。マッチしたレコードが追加さ
|
@@ -1842,7 +1838,7 @@ rb_grn_table_select (int argc, VALUE *argv, VALUE self)
|
|
1842
1838
|
GRN_TABLE_HASH_KEY | GRN_OBJ_WITH_SUBREC,
|
1843
1839
|
table,
|
1844
1840
|
NULL);
|
1845
|
-
rb_result = GRNTABLE2RVAL(context, result,
|
1841
|
+
rb_result = GRNTABLE2RVAL(context, result, GRN_TRUE);
|
1846
1842
|
} else {
|
1847
1843
|
result = RVAL2GRNTABLE(rb_result, &context);
|
1848
1844
|
}
|
@@ -1866,7 +1862,7 @@ rb_grn_table_select (int argc, VALUE *argv, VALUE self)
|
|
1866
1862
|
|
1867
1863
|
rb_attr(rb_singleton_class(rb_result),
|
1868
1864
|
rb_intern("expression"),
|
1869
|
-
|
1865
|
+
GRN_TRUE, GRN_FALSE, GRN_FALSE);
|
1870
1866
|
rb_iv_set(rb_result, "@expression", rb_expression);
|
1871
1867
|
|
1872
1868
|
return rb_result;
|
data/ext/groonga/rb-grn-type.c
CHANGED
data/ext/groonga/rb-grn-utils.c
CHANGED
@@ -69,20 +69,20 @@ rb_grn_scan_options (VALUE options, ...)
|
|
69
69
|
rb_grn_inspect(available_keys));
|
70
70
|
}
|
71
71
|
|
72
|
-
|
72
|
+
grn_bool
|
73
73
|
rb_grn_equal_option (VALUE option, const char *key)
|
74
74
|
{
|
75
75
|
VALUE key_string, key_symbol;
|
76
76
|
|
77
77
|
key_string = rb_str_new2(key);
|
78
78
|
if (RVAL2CBOOL(rb_funcall(option, rb_intern("=="), 1, key_string)))
|
79
|
-
return
|
79
|
+
return GRN_TRUE;
|
80
80
|
|
81
81
|
key_symbol = rb_str_intern(key_string);
|
82
82
|
if (RVAL2CBOOL(rb_funcall(option, rb_intern("=="), 1, key_symbol)))
|
83
|
-
return
|
83
|
+
return GRN_TRUE;
|
84
84
|
|
85
|
-
return
|
85
|
+
return GRN_FALSE;
|
86
86
|
}
|
87
87
|
|
88
88
|
static VALUE
|
@@ -90,7 +90,7 @@ rb_grn_bulk_to_ruby_object_by_range_id (grn_ctx *context, grn_obj *bulk,
|
|
90
90
|
grn_id range_id,
|
91
91
|
VALUE related_object, VALUE *rb_value)
|
92
92
|
{
|
93
|
-
|
93
|
+
grn_bool success = GRN_TRUE;
|
94
94
|
|
95
95
|
switch (range_id) {
|
96
96
|
case GRN_DB_VOID:
|
@@ -132,7 +132,7 @@ rb_grn_bulk_to_ruby_object_by_range_id (grn_ctx *context, grn_obj *bulk,
|
|
132
132
|
GRN_TEXT_LEN(bulk));
|
133
133
|
break;
|
134
134
|
default:
|
135
|
-
success =
|
135
|
+
success = GRN_FALSE;
|
136
136
|
break;
|
137
137
|
}
|
138
138
|
|
@@ -144,14 +144,14 @@ rb_grn_bulk_to_ruby_object_by_range_type (grn_ctx *context, grn_obj *bulk,
|
|
144
144
|
grn_obj *range, grn_id range_id,
|
145
145
|
VALUE related_object, VALUE *rb_value)
|
146
146
|
{
|
147
|
-
|
147
|
+
grn_bool success = GRN_TRUE;
|
148
148
|
|
149
149
|
if (!range && range_id != GRN_ID_NIL) {
|
150
150
|
range = grn_ctx_at(context, range_id);
|
151
151
|
}
|
152
152
|
|
153
153
|
if (!range)
|
154
|
-
return
|
154
|
+
return GRN_FALSE;
|
155
155
|
|
156
156
|
switch (range->header.type) {
|
157
157
|
case GRN_TABLE_HASH_KEY:
|
@@ -166,7 +166,7 @@ rb_grn_bulk_to_ruby_object_by_range_type (grn_ctx *context, grn_obj *bulk,
|
|
166
166
|
} else {
|
167
167
|
VALUE rb_range;
|
168
168
|
|
169
|
-
rb_range = GRNOBJECT2RVAL(Qnil, context, range,
|
169
|
+
rb_range = GRNOBJECT2RVAL(Qnil, context, range, GRN_FALSE);
|
170
170
|
*rb_value = rb_grn_record_new(rb_range, id, Qnil);
|
171
171
|
}
|
172
172
|
}
|
@@ -188,13 +188,13 @@ rb_grn_bulk_to_ruby_object_by_range_type (grn_ctx *context, grn_obj *bulk,
|
|
188
188
|
*rb_value = rb_float_new(GRN_FLOAT_VALUE(bulk));
|
189
189
|
break;
|
190
190
|
default:
|
191
|
-
success =
|
191
|
+
success = GRN_FALSE;
|
192
192
|
}
|
193
193
|
break;
|
194
194
|
}
|
195
195
|
break;
|
196
196
|
default:
|
197
|
-
success =
|
197
|
+
success = GRN_FALSE;
|
198
198
|
break;
|
199
199
|
}
|
200
200
|
|
@@ -332,7 +332,7 @@ rb_grn_bulk_from_ruby_object_with_type (VALUE object, grn_ctx *context,
|
|
332
332
|
grn_id record_id, range;
|
333
333
|
VALUE rb_type_object;
|
334
334
|
grn_obj_flags flags = 0;
|
335
|
-
|
335
|
+
grn_bool string_p, table_type_p;
|
336
336
|
|
337
337
|
string_p = rb_type(object) == T_STRING;
|
338
338
|
table_type_p = (GRN_TABLE_HASH_KEY <= type->header.type &&
|
@@ -420,7 +420,7 @@ rb_grn_bulk_from_ruby_object_with_type (VALUE object, grn_ctx *context,
|
|
420
420
|
case GRN_DB_BIGRAM:
|
421
421
|
case GRN_DB_TRIGRAM:
|
422
422
|
case GRN_DB_MECAB:
|
423
|
-
rb_type_object = GRNOBJECT2RVAL(Qnil, context, type,
|
423
|
+
rb_type_object = GRNOBJECT2RVAL(Qnil, context, type, GRN_FALSE);
|
424
424
|
rb_raise(rb_eArgError,
|
425
425
|
"unbulkable type: %s",
|
426
426
|
rb_grn_inspect(rb_type_object));
|
@@ -603,7 +603,7 @@ rb_grn_value_to_ruby_object (grn_ctx *context,
|
|
603
603
|
|
604
604
|
rb_value = rb_ary_new();
|
605
605
|
if (range)
|
606
|
-
rb_range = GRNTABLE2RVAL(context, range,
|
606
|
+
rb_range = GRNTABLE2RVAL(context, range, GRN_FALSE);
|
607
607
|
uvector = (grn_id *)GRN_BULK_HEAD(value);
|
608
608
|
uvector_end = (grn_id *)GRN_BULK_CURR(value);
|
609
609
|
for (; uvector < uvector_end; uvector++) {
|
@@ -626,7 +626,7 @@ rb_grn_value_to_ruby_object (grn_ctx *context,
|
|
626
626
|
}
|
627
627
|
|
628
628
|
if (!range)
|
629
|
-
return GRNOBJECT2RVAL(Qnil, context, value,
|
629
|
+
return GRNOBJECT2RVAL(Qnil, context, value, GRN_FALSE);
|
630
630
|
|
631
631
|
return Qnil;
|
632
632
|
}
|
@@ -647,7 +647,7 @@ rb_grn_id_from_ruby_object (VALUE object, grn_ctx *context, grn_obj *table,
|
|
647
647
|
VALUE rb_expected_table;
|
648
648
|
|
649
649
|
rb_expected_table =
|
650
|
-
GRNOBJECT2RVAL(Qnil, context, table,
|
650
|
+
GRNOBJECT2RVAL(Qnil, context, table, GRN_FALSE);
|
651
651
|
rb_raise(rb_eGrnError,
|
652
652
|
"wrong table: expected <%s>: actual <%s>",
|
653
653
|
rb_grn_inspect(rb_expected_table),
|
@@ -34,7 +34,7 @@ rb_grn_view_accessor_from_ruby_object (VALUE object)
|
|
34
34
|
|
35
35
|
VALUE
|
36
36
|
rb_grn_view_accessor_to_ruby_object (grn_ctx *context, grn_obj *table,
|
37
|
-
|
37
|
+
grn_bool owner)
|
38
38
|
{
|
39
39
|
return GRNOBJECT2RVAL(rb_cGrnViewAccessor, context, table, owner);
|
40
40
|
}
|
data/ext/groonga/rb-grn-view.c
CHANGED
@@ -129,7 +129,7 @@ rb_grn_view_s_create (int argc, VALUE *argv, VALUE klass)
|
|
129
129
|
table = grn_table_create(context, name, name_size, path, flags, NULL, NULL);
|
130
130
|
if (!table)
|
131
131
|
rb_grn_context_check(context, rb_ary_new4(argc, argv));
|
132
|
-
rb_table = GRNOBJECT2RVAL(klass, context, table,
|
132
|
+
rb_table = GRNOBJECT2RVAL(klass, context, table, GRN_TRUE);
|
133
133
|
|
134
134
|
if (rb_block_given_p())
|
135
135
|
return rb_ensure(rb_yield, rb_table, rb_grn_object_close, rb_table);
|
data/ext/groonga/rb-grn.h
CHANGED
@@ -69,11 +69,7 @@ RB_GRN_BEGIN_DECLS
|
|
69
69
|
|
70
70
|
#define RB_GRN_MAJOR_VERSION 1
|
71
71
|
#define RB_GRN_MINOR_VERSION 0
|
72
|
-
#define RB_GRN_MICRO_VERSION
|
73
|
-
|
74
|
-
typedef int rb_grn_boolean;
|
75
|
-
#define RB_GRN_FALSE (0)
|
76
|
-
#define RB_GRN_TRUE (!RB_GRN_FALSE)
|
72
|
+
#define RB_GRN_MICRO_VERSION 7
|
77
73
|
|
78
74
|
#define RB_GRN_QUERY_DEFAULT_MAX_EXPRESSIONS 32
|
79
75
|
|
@@ -110,8 +106,8 @@ struct _RbGrnObject
|
|
110
106
|
grn_id domain_id;
|
111
107
|
grn_obj *range;
|
112
108
|
grn_id range_id;
|
113
|
-
|
114
|
-
|
109
|
+
grn_bool need_close;
|
110
|
+
grn_bool have_finalizer;
|
115
111
|
};
|
116
112
|
|
117
113
|
typedef struct _RbGrnNamedObject RbGrnNamedObject;
|
@@ -178,7 +174,7 @@ struct _RbGrnExpression
|
|
178
174
|
grn_obj *value;
|
179
175
|
};
|
180
176
|
|
181
|
-
RB_GRN_VAR
|
177
|
+
RB_GRN_VAR grn_bool rb_grn_exited;
|
182
178
|
|
183
179
|
RB_GRN_VAR VALUE rb_eGrnError;
|
184
180
|
RB_GRN_VAR VALUE rb_eGrnObjectClosed;
|
@@ -275,7 +271,7 @@ grn_obj *rb_grn_context_get_backward_compatibility
|
|
275
271
|
const char *rb_grn_inspect (VALUE object);
|
276
272
|
void rb_grn_scan_options (VALUE options, ...)
|
277
273
|
RB_GRN_GNUC_NULL_TERMINATED;
|
278
|
-
|
274
|
+
grn_bool rb_grn_equal_option (VALUE option,
|
279
275
|
const char *key);
|
280
276
|
|
281
277
|
VALUE rb_grn_object_alloc (VALUE klass);
|
@@ -504,7 +500,7 @@ VALUE rb_grn_column_expression_builder_build
|
|
504
500
|
|
505
501
|
#define RVAL2GRNTABLECURSOR(object) (rb_grn_table_cursor_from_ruby_object(object))
|
506
502
|
#define GRNTABLECURSOR2RVAL(klass, context, cursor) \
|
507
|
-
(rb_grn_table_cursor_to_ruby_object(klass, context, cursor,
|
503
|
+
(rb_grn_table_cursor_to_ruby_object(klass, context, cursor, GRN_TRUE))
|
508
504
|
#define GRNTABLECURSOR2RCLASS(object) (rb_grn_table_cursor_to_ruby_class(object))
|
509
505
|
|
510
506
|
#define RVAL2GRNCOLUMN(object, context) \
|
@@ -582,19 +578,19 @@ grn_obj *rb_grn_object_from_ruby_object (VALUE object,
|
|
582
578
|
VALUE rb_grn_object_to_ruby_object (VALUE klass,
|
583
579
|
grn_ctx *context,
|
584
580
|
grn_obj *object,
|
585
|
-
|
581
|
+
grn_bool owner);
|
586
582
|
VALUE rb_grn_object_to_ruby_class (grn_obj *object);
|
587
583
|
|
588
584
|
grn_obj *rb_grn_database_from_ruby_object (VALUE object);
|
589
585
|
VALUE rb_grn_database_to_ruby_object (grn_ctx *context,
|
590
586
|
grn_obj *db,
|
591
|
-
|
587
|
+
grn_bool owner);
|
592
588
|
|
593
589
|
grn_obj *rb_grn_table_from_ruby_object (VALUE object,
|
594
590
|
grn_ctx **context);
|
595
591
|
VALUE rb_grn_table_to_ruby_object (grn_ctx *context,
|
596
592
|
grn_obj *table,
|
597
|
-
|
593
|
+
grn_bool owner);
|
598
594
|
|
599
595
|
grn_table_cursor *
|
600
596
|
rb_grn_table_cursor_from_ruby_object (VALUE object,
|
@@ -602,7 +598,7 @@ grn_table_cursor *
|
|
602
598
|
VALUE rb_grn_table_cursor_to_ruby_object (VALUE klass,
|
603
599
|
grn_ctx *context,
|
604
600
|
grn_table_cursor *cursor,
|
605
|
-
|
601
|
+
grn_bool owner);
|
606
602
|
VALUE rb_grn_table_cursor_to_ruby_class (grn_table_cursor *cursor);
|
607
603
|
void rb_grn_table_cursor_deconstruct (RbGrnTableCursor *rb_grn_table_cursor,
|
608
604
|
grn_table_cursor **cursor,
|
@@ -617,7 +613,7 @@ grn_obj *rb_grn_column_from_ruby_object (VALUE object,
|
|
617
613
|
VALUE rb_grn_column_to_ruby_object (VALUE klass,
|
618
614
|
grn_ctx *context,
|
619
615
|
grn_obj *column,
|
620
|
-
|
616
|
+
grn_bool owner);
|
621
617
|
|
622
618
|
grn_query *rb_grn_query_from_ruby_object (VALUE object);
|
623
619
|
VALUE rb_grn_query_to_ruby_object (grn_ctx *context,
|
@@ -691,7 +687,7 @@ VALUE rb_grn_obj_to_ruby_object (VALUE klass,
|
|
691
687
|
grn_snip *rb_grn_snippet_from_ruby_object (VALUE rb_snippet);
|
692
688
|
VALUE rb_grn_snippet_to_ruby_object (grn_ctx *context,
|
693
689
|
grn_snip *snippet,
|
694
|
-
|
690
|
+
grn_bool owner);
|
695
691
|
|
696
692
|
RB_GRN_END_DECLS
|
697
693
|
|
data/ext/groonga/rb-groonga.c
CHANGED
@@ -18,14 +18,14 @@
|
|
18
18
|
|
19
19
|
#include "rb-grn.h"
|
20
20
|
|
21
|
-
|
21
|
+
grn_bool rb_grn_exited = GRN_FALSE;
|
22
22
|
|
23
23
|
static void
|
24
24
|
finish_groonga (VALUE data)
|
25
25
|
{
|
26
26
|
debug("finish\n");
|
27
27
|
grn_fin();
|
28
|
-
rb_grn_exited =
|
28
|
+
rb_grn_exited = GRN_TRUE;
|
29
29
|
debug("finish: done\n");
|
30
30
|
}
|
31
31
|
|
data/extconf.rb
CHANGED
@@ -15,15 +15,21 @@
|
|
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 'English'
|
18
19
|
require 'pathname'
|
20
|
+
require 'fileutils'
|
21
|
+
|
22
|
+
begin
|
23
|
+
require 'pkg-config'
|
24
|
+
rescue LoadError
|
25
|
+
require 'rubygems'
|
26
|
+
require 'pkg-config'
|
27
|
+
end
|
19
28
|
|
20
29
|
base_dir = Pathname(__FILE__).dirname.realpath
|
21
30
|
$LOAD_PATH.unshift(base_dir.to_s)
|
22
31
|
|
23
|
-
require 'English'
|
24
|
-
require 'pkg-config'
|
25
32
|
require 'rroonga-build'
|
26
|
-
require 'fileutils'
|
27
33
|
|
28
34
|
include RroongaBuild
|
29
35
|
|
data/html/index.html
CHANGED
@@ -21,7 +21,7 @@
|
|
21
21
|
</div>
|
22
22
|
<ul class="menu">
|
23
23
|
<li id="menu-reference"><a href="rroonga/">リファレンスマニュアル</a></li>
|
24
|
-
<li id="menu-tutorial"><a href="rroonga/text/
|
24
|
+
<li id="menu-tutorial"><a href="rroonga/text/tutorial_ja_rdoc.html">チュートリアル</a></li>
|
25
25
|
<li id="menu-install"><a href="#install-rroonga">インストール</a></li>
|
26
26
|
<li id="menu-developer"><a href="developer.html">開発者向け情報</a></li>
|
27
27
|
</ul>
|
@@ -49,7 +49,7 @@
|
|
49
49
|
|
50
50
|
<h3>rroongaの最新リリース</h3>
|
51
51
|
<p>
|
52
|
-
2010-
|
52
|
+
2010-12-19にリリースされた1.0.7が最新です。
|
53
53
|
</p>
|
54
54
|
|
55
55
|
<h3 id="install-rroonga">rroongaのインストール</h3>
|
@@ -135,8 +135,12 @@
|
|
135
135
|
|
136
136
|
<h3>ChupaTextの最新リリース</h3>
|
137
137
|
<p>
|
138
|
-
2010-
|
138
|
+
2010-12-19にリリースされた0.7.0が最新です。
|
139
139
|
</p>
|
140
|
+
<p>
|
141
|
+
[<a href="http://rubyforge.org/frs/download.php/73656/chupatext-0.7.0.tar.gz">ダウンロード</a>]
|
142
|
+
[<a href="chupatext/ja/news.html#news.release-0-7-0">変更点</a>]
|
143
|
+
</p>
|
140
144
|
|
141
145
|
<h3 id="install-chupatext">ChupaTextのインストール</h3>
|
142
146
|
<p>
|
data/test-unit/COPYING
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
Ruby is copyrighted free software by Yukihiro Matsumoto <matz@netlab.jp>.
|
2
|
+
You can redistribute it and/or modify it under either the terms of the GPL
|
3
|
+
version 2 (see the file GPL), or the conditions below:
|
4
|
+
|
5
|
+
1. You may make and give away verbatim copies of the source form of the
|
6
|
+
software without restriction, provided that you duplicate all of the
|
7
|
+
original copyright notices and associated disclaimers.
|
8
|
+
|
9
|
+
2. You may modify your copy of the software in any way, provided that
|
10
|
+
you do at least ONE of the following:
|
11
|
+
|
12
|
+
a) place your modifications in the Public Domain or otherwise
|
13
|
+
make them Freely Available, such as by posting said
|
14
|
+
modifications to Usenet or an equivalent medium, or by allowing
|
15
|
+
the author to include your modifications in the software.
|
16
|
+
|
17
|
+
b) use the modified software only within your corporation or
|
18
|
+
organization.
|
19
|
+
|
20
|
+
c) give non-standard binaries non-standard names, with
|
21
|
+
instructions on where to get the original software distribution.
|
22
|
+
|
23
|
+
d) make other distribution arrangements with the author.
|
24
|
+
|
25
|
+
3. You may distribute the software in object code or binary form,
|
26
|
+
provided that you do at least ONE of the following:
|
27
|
+
|
28
|
+
a) distribute the binaries and library files of the software,
|
29
|
+
together with instructions (in the manual page or equivalent)
|
30
|
+
on where to get the original distribution.
|
31
|
+
|
32
|
+
b) accompany the distribution with the machine-readable source of
|
33
|
+
the software.
|
34
|
+
|
35
|
+
c) give non-standard binaries non-standard names, with
|
36
|
+
instructions on where to get the original software distribution.
|
37
|
+
|
38
|
+
d) make other distribution arrangements with the author.
|
39
|
+
|
40
|
+
4. You may modify and include the part of the software into any other
|
41
|
+
software (possibly commercial). But some files in the distribution
|
42
|
+
are not written by the author, so that they are not under these terms.
|
43
|
+
|
44
|
+
For the list of those files and their copying conditions, see the
|
45
|
+
file LEGAL.
|
46
|
+
|
47
|
+
5. The scripts and library files supplied as input to or produced as
|
48
|
+
output from the software do not automatically fall under the
|
49
|
+
copyright of the software, but belong to whomever generated them,
|
50
|
+
and may be sold commercially, and may be aggregated with this
|
51
|
+
software.
|
52
|
+
|
53
|
+
6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
|
54
|
+
IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
|
55
|
+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
56
|
+
PURPOSE.
|