rroonga 3.0.5 → 3.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. data/AUTHORS +5 -0
  2. data/Gemfile +20 -0
  3. data/Rakefile +187 -0
  4. data/doc/text/news.textile +10 -2
  5. data/doc/text/tutorial.textile +0 -2
  6. data/ext/groonga/extconf.rb +7 -1
  7. data/ext/groonga/rb-grn-accessor.c +11 -11
  8. data/ext/groonga/rb-grn-array.c +25 -25
  9. data/ext/groonga/rb-grn-column.c +106 -106
  10. data/ext/groonga/rb-grn-context.c +121 -121
  11. data/ext/groonga/rb-grn-database.c +78 -78
  12. data/ext/groonga/rb-grn-double-array-trie.c +92 -92
  13. data/ext/groonga/rb-grn-encoding-support.c +1 -1
  14. data/ext/groonga/rb-grn-encoding.c +28 -28
  15. data/ext/groonga/rb-grn-exception.c +9 -9
  16. data/ext/groonga/rb-grn-expression-builder.c +6 -6
  17. data/ext/groonga/rb-grn-expression.c +87 -87
  18. data/ext/groonga/rb-grn-fix-size-column.c +12 -12
  19. data/ext/groonga/rb-grn-geo-point.c +2 -2
  20. data/ext/groonga/rb-grn-hash.c +38 -38
  21. data/ext/groonga/rb-grn-index-column.c +191 -191
  22. data/ext/groonga/rb-grn-index-cursor.c +29 -29
  23. data/ext/groonga/rb-grn-logger.c +36 -36
  24. data/ext/groonga/rb-grn-normalizer.c +10 -10
  25. data/ext/groonga/rb-grn-patricia-trie.c +196 -196
  26. data/ext/groonga/rb-grn-plugin.c +5 -5
  27. data/ext/groonga/rb-grn-posting.c +2 -2
  28. data/ext/groonga/rb-grn-procedure.c +2 -2
  29. data/ext/groonga/rb-grn-query-logger.c +1 -1
  30. data/ext/groonga/rb-grn-record.c +1 -1
  31. data/ext/groonga/rb-grn-snippet.c +14 -14
  32. data/ext/groonga/rb-grn-table-cursor-key-support.c +4 -4
  33. data/ext/groonga/rb-grn-table-cursor.c +52 -52
  34. data/ext/groonga/rb-grn-table-key-support.c +209 -209
  35. data/ext/groonga/rb-grn-type.c +18 -18
  36. data/ext/groonga/rb-grn-utils.c +332 -314
  37. data/ext/groonga/rb-grn-variable-size-column.c +34 -34
  38. data/ext/groonga/rb-grn-variable.c +2 -2
  39. data/ext/groonga/rb-grn.h +240 -232
  40. data/ext/groonga/rb-groonga.c +10 -10
  41. data/rroonga-build.rb +7 -0
  42. data/rroonga.gemspec +1 -1
  43. data/test/test-hash.rb +4 -4
  44. data/test/test-index-column.rb +271 -257
  45. data/test/test-table-key-support.rb +78 -0
  46. data/test/test-table.rb +78 -51
  47. metadata +195 -164
  48. checksums.yaml +0 -7
@@ -163,61 +163,61 @@ rb_grn_hash_s_create (int argc, VALUE *argv, VALUE klass)
163
163
  rb_scan_args(argc, argv, "01", &options);
164
164
 
165
165
  rb_grn_scan_options(options,
166
- "context", &rb_context,
167
- "name", &rb_name,
166
+ "context", &rb_context,
167
+ "name", &rb_name,
168
168
  "path", &rb_path,
169
- "persistent", &rb_persistent,
170
- "key_normalize", &rb_key_normalize,
171
- "key_type", &rb_key_type,
172
- "value_type", &rb_value_type,
173
- "default_tokenizer", &rb_default_tokenizer,
174
- "sub_records", &rb_sub_records,
175
- "normalizer", &rb_normalizer,
176
- NULL);
169
+ "persistent", &rb_persistent,
170
+ "key_normalize", &rb_key_normalize,
171
+ "key_type", &rb_key_type,
172
+ "value_type", &rb_value_type,
173
+ "default_tokenizer", &rb_default_tokenizer,
174
+ "sub_records", &rb_sub_records,
175
+ "normalizer", &rb_normalizer,
176
+ NULL);
177
177
 
178
178
  context = rb_grn_context_ensure(&rb_context);
179
179
 
180
180
  if (!NIL_P(rb_name)) {
181
181
  name = StringValuePtr(rb_name);
182
- name_size = RSTRING_LEN(rb_name);
183
- flags |= GRN_OBJ_PERSISTENT;
182
+ name_size = RSTRING_LEN(rb_name);
183
+ flags |= GRN_OBJ_PERSISTENT;
184
184
  }
185
185
 
186
186
  if (!NIL_P(rb_path)) {
187
187
  path = StringValueCStr(rb_path);
188
- flags |= GRN_OBJ_PERSISTENT;
188
+ flags |= GRN_OBJ_PERSISTENT;
189
189
  }
190
190
 
191
191
  if (RVAL2CBOOL(rb_persistent))
192
- flags |= GRN_OBJ_PERSISTENT;
192
+ flags |= GRN_OBJ_PERSISTENT;
193
193
 
194
194
  if (RVAL2CBOOL(rb_key_normalize))
195
- flags |= GRN_OBJ_KEY_NORMALIZE;
195
+ flags |= GRN_OBJ_KEY_NORMALIZE;
196
196
 
197
197
  if (NIL_P(rb_key_type)) {
198
- key_type = grn_ctx_at(context, GRN_DB_SHORT_TEXT);
198
+ key_type = grn_ctx_at(context, GRN_DB_SHORT_TEXT);
199
199
  } else {
200
- key_type = RVAL2GRNOBJECT(rb_key_type, &context);
200
+ key_type = RVAL2GRNOBJECT(rb_key_type, &context);
201
201
  }
202
202
 
203
203
  if (!NIL_P(rb_value_type))
204
- value_type = RVAL2GRNOBJECT(rb_value_type, &context);
204
+ value_type = RVAL2GRNOBJECT(rb_value_type, &context);
205
205
 
206
206
  if (RVAL2CBOOL(rb_sub_records))
207
- flags |= GRN_OBJ_WITH_SUBREC;
207
+ flags |= GRN_OBJ_WITH_SUBREC;
208
208
 
209
209
  table = grn_table_create(context, name, name_size, path,
210
- flags, key_type, value_type);
210
+ flags, key_type, value_type);
211
211
  if (!table)
212
- rb_grn_context_check(context, rb_ary_new4(argc, argv));
212
+ rb_grn_context_check(context, rb_ary_new4(argc, argv));
213
213
  rb_table = GRNOBJECT2RVAL(klass, context, table, GRN_TRUE);
214
214
 
215
215
  if (!NIL_P(rb_default_tokenizer))
216
- rb_funcall(rb_table, rb_intern("default_tokenizer="), 1,
217
- rb_default_tokenizer);
216
+ rb_funcall(rb_table, rb_intern("default_tokenizer="), 1,
217
+ rb_default_tokenizer);
218
218
  if (!NIL_P(rb_normalizer))
219
- rb_funcall(rb_table, rb_intern("normalizer="), 1,
220
- rb_normalizer);
219
+ rb_funcall(rb_table, rb_intern("normalizer="), 1,
220
+ rb_normalizer);
221
221
 
222
222
  if (rb_block_given_p())
223
223
  return rb_ensure(rb_yield, rb_table, rb_grn_object_close, rb_table);
@@ -263,30 +263,30 @@ rb_grn_hash_search (int argc, VALUE *argv, VALUE self)
263
263
  VALUE rb_key, options, rb_result;
264
264
 
265
265
  rb_grn_table_key_support_deconstruct(SELF(self), &table, &context,
266
- &key, &domain_id, &domain,
267
- NULL, NULL, NULL,
268
- NULL);
266
+ &key, &domain_id, &domain,
267
+ NULL, NULL, NULL,
268
+ NULL);
269
269
 
270
270
  rb_scan_args(argc, argv, "11", &rb_key, &options);
271
271
 
272
272
  RVAL2GRNKEY(rb_key, context, key, domain_id, domain, self);
273
273
 
274
274
  rb_grn_scan_options(options,
275
- "result", &rb_result,
276
- NULL);
275
+ "result", &rb_result,
276
+ NULL);
277
277
 
278
278
  if (NIL_P(rb_result)) {
279
- result = grn_table_create(context, NULL, 0, NULL,
280
- GRN_OBJ_TABLE_HASH_KEY | GRN_OBJ_WITH_SUBREC,
281
- table, 0);
282
- rb_grn_context_check(context, self);
283
- rb_result = GRNOBJECT2RVAL(Qnil, context, result, GRN_TRUE);
279
+ result = grn_table_create(context, NULL, 0, NULL,
280
+ GRN_OBJ_TABLE_HASH_KEY | GRN_OBJ_WITH_SUBREC,
281
+ table, 0);
282
+ rb_grn_context_check(context, self);
283
+ rb_result = GRNOBJECT2RVAL(Qnil, context, result, GRN_TRUE);
284
284
  } else {
285
- result = RVAL2GRNOBJECT(rb_result, &context);
285
+ result = RVAL2GRNOBJECT(rb_result, &context);
286
286
  }
287
287
 
288
288
  rc = grn_obj_search(context, table, key,
289
- result, GRN_OP_OR, NULL);
289
+ result, GRN_OP_OR, NULL);
290
290
  rb_grn_rc_check(rc, self);
291
291
 
292
292
  return rb_result;
@@ -300,7 +300,7 @@ rb_grn_init_hash (VALUE mGrn)
300
300
  rb_include_module(rb_cGrnHash, rb_mGrnTableKeySupport);
301
301
 
302
302
  rb_define_singleton_method(rb_cGrnHash, "create",
303
- rb_grn_hash_s_create, -1);
303
+ rb_grn_hash_s_create, -1);
304
304
 
305
305
  rb_define_method(rb_cGrnHash, "search", rb_grn_hash_search, -1);
306
306
  }