From null at cozmixng.org Tue Jun 2 09:45:28 2009 From: null at cozmixng.org (null at cozmixng.org) Date: Tue, 02 Jun 2009 22:45:28 +0900 Subject: [groonga-commit:348] groonga [groonga (trunk) r360] * document Groonga::Array. Message-ID: <20090602134528.D37111D1C7F@mail.cozmixng.org> retro 2009-06-02 22:45:28 +0900 (Tue, 02 Jun 2009) New Revision: 360 Modified files: groonga/trunk/ext/rb-grn-array.c Log: * document Groonga::Array. Modified: groonga/trunk/ext/rb-grn-array.c (+26 -3) =================================================================== --- groonga/trunk/ext/rb-grn-array.c 2009-06-01 00:24:50 -15:00 (rev 359) +++ groonga/trunk/ext/rb-grn-array.c 2009-06-02 22:45:28 +09:00 (rev 360) @@ -65,6 +65,8 @@ * [+:value_size+] * ????????????????0???? * + * ???: + * * ?????????????? * Groonga::Array.create * @@ -134,10 +136,31 @@ /* * call-seq: - * array.add -> Groonga::Record???nil + * array.add(values=nil) -> Groonga::Record???nil * - * ???????????????????????????? - * ?????????+nil+?????? + * ????????????????????????????? + * ??????+nil+???? + * + * _values_???????????????????????? + * ???????+nil+??????????????????? + * ?????{:????1 => ?1, :????2 => ?2, + * ...}?????? + * + * ????????????????????Groonga::Array? + * ????????????? + * users = Groonga::Array.create(:name => "") + * users.define_column("name", "") + * users.define_column("uri", "") + * + * ????????? + * user = users.add + * + * daijiro????????? + * daijiro = users.add(:name => "daijiro") + * + * gunyara-kun????????? + * gunyara_kun = users.add(:name => "gunyara-kun", + * :uri => "http://d.hatena.ne.jp/tasukuchan/") */ static VALUE rb_grn_array_add (int argc, VALUE *argv, VALUE self) From null at cozmixng.org Tue Jun 2 10:00:34 2009 From: null at cozmixng.org (null at cozmixng.org) Date: Tue, 02 Jun 2009 23:00:34 +0900 Subject: [groonga-commit:349] groonga [groonga (trunk) r361] * document Groonga::ArrayCursor. Message-ID: <20090602140034.C92D41D1C89@mail.cozmixng.org> retro 2009-06-02 23:00:34 +0900 (Tue, 02 Jun 2009) New Revision: 361 Modified files: groonga/trunk/ext/rb-grn-array-cursor.c Log: * document Groonga::ArrayCursor. Modified: groonga/trunk/ext/rb-grn-array-cursor.c (+7 -0) =================================================================== --- groonga/trunk/ext/rb-grn-array-cursor.c 2009-06-02 22:45:16 +09:00 (rev 360) +++ groonga/trunk/ext/rb-grn-array-cursor.c 2009-06-02 23:00:34 +09:00 (rev 361) @@ -20,6 +20,13 @@ VALUE rb_cGrnArrayCursor; +/* + * Document-class: Groonga::ArrayCursor < Groonga::TableCursor + * + * Groonga::Array????????????????????? + * ????????? + */ + void rb_grn_init_array_cursor (VALUE mGrn) { From null at cozmixng.org Tue Jun 2 10:00:36 2009 From: null at cozmixng.org (null at cozmixng.org) Date: Tue, 02 Jun 2009 23:00:36 +0900 Subject: [groonga-commit:350] groonga [groonga (trunk) r362] * document Groonga::ArrayCursor. Message-ID: <20090602140036.17A141D1C8B@mail.cozmixng.org> retro 2009-06-02 23:00:35 +0900 (Tue, 02 Jun 2009) New Revision: 362 Modified files: groonga/trunk/ext/rb-grn-array-cursor.c Log: * document Groonga::ArrayCursor. Modified: groonga/trunk/ext/rb-grn-array-cursor.c (+3 -2) =================================================================== --- groonga/trunk/ext/rb-grn-array-cursor.c 2009-06-02 22:47:27 +09:00 (rev 361) +++ groonga/trunk/ext/rb-grn-array-cursor.c 2009-06-02 23:00:35 +09:00 (rev 362) @@ -23,8 +23,9 @@ /* * Document-class: Groonga::ArrayCursor < Groonga::TableCursor * - * Groonga::Array????????????????????? - * ????????? + * Groonga::Array?????????????????????? + * ??????????????????Groonga::TableCursor? + * ??? */ void From null at cozmixng.org Tue Jun 2 10:15:48 2009 From: null at cozmixng.org (null at cozmixng.org) Date: Tue, 02 Jun 2009 23:15:48 +0900 Subject: [groonga-commit:350] groonga [groonga (trunk) r363] * document Groonga::Column. Message-ID: <20090602141548.573121D1C7C@mail.cozmixng.org> retro 2009-06-02 23:15:47 +0900 (Tue, 02 Jun 2009) New Revision: 363 Modified files: groonga/trunk/ext/rb-grn-column.c Log: * document Groonga::Column. Modified: groonga/trunk/ext/rb-grn-column.c (+25 -0) =================================================================== --- groonga/trunk/ext/rb-grn-column.c 2009-06-02 22:48:03 +09:00 (rev 362) +++ groonga/trunk/ext/rb-grn-column.c 2009-06-02 23:15:47 +09:00 (rev 363) @@ -23,6 +23,31 @@ VALUE rb_cGrnColumn; VALUE rb_cGrnVarSizeColumn; +/* + * Document-class: Groonga::Column < Groonga::Object + * + * ???????????????????????????? + * ???????????????????????????? + * ?????????? + * + * ???????????3????? + * [Groonga::FixSizeColumn] + * ???????????????? + * [Groonga::VarSizeColumn] + * ???????????????? + * [Groonga::IndexColumn] + * ???????????????????????????? + * ????????????????????? + * + * ??????????????????????1?????? + * ????????????????????????????? + * 1???????????????????????????? + * ?????????? + * + * ??????????1?????????????????? + * ????????????????? + */ + grn_obj * rb_grn_column_from_ruby_object (VALUE object, grn_ctx **context) { From null at cozmixng.org Wed Jun 3 09:45:25 2009 From: null at cozmixng.org (null at cozmixng.org) Date: Wed, 03 Jun 2009 22:45:25 +0900 Subject: [groonga-commit:351] groonga [groonga (trunk) r364] * document Groonga::Column. Message-ID: <20090603134525.C04DB1D1C87@mail.cozmixng.org> retro 2009-06-03 22:45:25 +0900 (Wed, 03 Jun 2009) New Revision: 364 Modified files: groonga/trunk/ext/rb-grn-column.c Log: * document Groonga::Column. Modified: groonga/trunk/ext/rb-grn-column.c (+6 -0) =================================================================== --- groonga/trunk/ext/rb-grn-column.c 2009-06-02 23:09:43 +09:00 (rev 363) +++ groonga/trunk/ext/rb-grn-column.c 2009-06-03 22:45:25 +09:00 (rev 364) @@ -65,6 +65,12 @@ return GRNOBJECT2RVAL(klass, context, column, owner); } +/* + * call-seq: + * column.table -> Groonga::Table + * + * ???????????????? + */ static VALUE rb_grn_column_get_table (VALUE self) { From null at cozmixng.org Wed Jun 3 09:45:27 2009 From: null at cozmixng.org (null at cozmixng.org) Date: Wed, 03 Jun 2009 22:45:27 +0900 Subject: [groonga-commit:352] groonga [groonga (trunk) r365] * remove QL related methods. Message-ID: <20090603134527.1B2B81D1C89@mail.cozmixng.org> retro 2009-06-03 22:45:26 +0900 (Wed, 03 Jun 2009) New Revision: 365 Modified files: groonga/trunk/ext/rb-grn-context.c groonga/trunk/test/test-context.rb Log: * remove QL related methods. Modified: groonga/trunk/ext/rb-grn-context.c (+66 -22) =================================================================== --- groonga/trunk/ext/rb-grn-context.c 2009-06-03 22:31:30 +09:00 (rev 364) +++ groonga/trunk/ext/rb-grn-context.c 2009-06-03 22:45:26 +09:00 (rev 365) @@ -24,6 +24,25 @@ static VALUE cGrnContext; +/* + * Document-class: Groonga::Context + * + * groonga????????????????????????? + * ???????1????????????????????? + * ???????????????????? + * + * ?????????????????? + * Groonga::Context#default???????????????? + * ???????????????????????+nil+??? + * ?????Groonga::Context.default??????? + * + * ???????????????????????????? + * ????????????????????????????? + * + * ???????????????????????????? + * ???Groonga::Context.default_options=?????? + */ + grn_ctx * rb_grn_context_from_ruby_object (VALUE object) { @@ -188,6 +207,17 @@ return SELF(*context); } +/* + * call-seq: + * Groonga::Context.default -> Groonga::Context + * + * ???????????????????????????? + * ???????????????????????????? + * + * ????????????????????? + * Groonga::Context.default_options???????????? + * ??????? + */ static VALUE rb_grn_context_s_get_default (VALUE self) { @@ -207,6 +237,15 @@ return rb_grn_context_s_get_default(cGrnContext); } +/* + * call-seq: + * Groonga::Context.default=(context) + * + * ??????????????????+nil+???????? + * ???????????????????????????? + * ?Groonga::Context.default??????????????? + * ?????????? + */ static VALUE rb_grn_context_s_set_default (VALUE self, VALUE context) { @@ -214,12 +253,27 @@ return Qnil; } +/* + * call-seq: + * Groonga::Context.default_options -> Hash or nil + * + * ???????????????????????????? + * ???? + */ static VALUE rb_grn_context_s_get_default_options (VALUE self) { return rb_cv_get(self, "@@default_options"); } +/* + * call-seq: + * Groonga::Context.default_options=(options) + * + * ???????????????????????????? + * ????????????????? + * Groonga::Context#initialize???? + */ static VALUE rb_grn_context_s_set_default_options (VALUE self, VALUE options) { @@ -227,6 +281,17 @@ return Qnil; } +/* + * call-seq: + * Groonga::Context.new(options=nil) + * + * ????????????_options_???????????? + * ?? + * + * [+:encoding] + * ??????????????????????????? + * ?Groonga::Encoding???? + */ static VALUE rb_grn_context_initialize (int argc, VALUE *argv, VALUE self) { @@ -234,7 +299,7 @@ int flags = 0; grn_rc rc; VALUE options, default_options; - VALUE use_ql, batch_mode, rb_encoding; + VALUE rb_encoding; rb_scan_args(argc, argv, "01", &options); default_options = rb_grn_context_s_get_default_options(rb_obj_class(self)); @@ -246,16 +311,9 @@ options = rb_funcall(default_options, rb_intern("merge"), 1, options); rb_grn_scan_options(options, - "use_ql", &use_ql, - "batch_mode", &batch_mode, "encoding", &rb_encoding, NULL); - if (RVAL2CBOOL(use_ql)) - flags |= GRN_CTX_USE_QL; - if (RVAL2CBOOL(batch_mode)) - flags |= GRN_CTX_BATCH_MODE; - context = ALLOC(grn_ctx); DATA_PTR(self) = context; rc = grn_ctx_init(context, flags); @@ -285,20 +343,6 @@ rb_str_concat(inspected, rb_inspect(rb_obj_class(self))); rb_str_cat2(inspected, " "); - rb_str_cat2(inspected, "use_ql: <"); - if (context->flags & GRN_CTX_USE_QL) - rb_str_cat2(inspected, "true"); - else - rb_str_cat2(inspected, "false"); - rb_str_cat2(inspected, ">, "); - - rb_str_cat2(inspected, "batch_mode: <"); - if (context->flags & GRN_CTX_BATCH_MODE) - rb_str_cat2(inspected, "true"); - else - rb_str_cat2(inspected, "false"); - rb_str_cat2(inspected, ">, "); - rb_str_cat2(inspected, "encoding: <"); rb_str_concat(inspected, rb_inspect(GRNENCODING2RVAL(context->encoding))); rb_str_cat2(inspected, ">, "); Modified: groonga/trunk/test/test-context.rb (+1 -27) =================================================================== --- groonga/trunk/test/test-context.rb 2009-06-03 22:31:30 +09:00 (rev 364) +++ groonga/trunk/test/test-context.rb 2009-06-03 22:45:26 +09:00 (rev 365) @@ -25,32 +25,12 @@ def test_default_options Groonga::Context.default_options = { - :use_ql => true, - :batch_mode => true, :encoding => :utf8, } context = Groonga::Context.default - assert_predicate(context, :use_ql?) - assert_predicate(context, :batch_mode?) assert_equal(Groonga::Encoding::UTF8, context.encoding) end - def test_use_ql? - context = Groonga::Context.new - assert_not_predicate(context, :use_ql?) - - context = Groonga::Context.new(:use_ql => true) - assert_predicate(context, :use_ql?) - end - - def test_batch_mode? - context = Groonga::Context.new - assert_not_predicate(context, :batch_mode?) - - context = Groonga::Context.new(:batch_mode => true) - assert_predicate(context, :batch_mode?) - end - def test_encoding context = Groonga::Context.new assert_equal(Groonga::Encoding.default, context.encoding) @@ -60,12 +40,8 @@ end def test_inspect - context = Groonga::Context.new(:use_ql => true, - :batch_mode => true, - :encoding => Groonga::Encoding::UTF8) + context = Groonga::Context.new(:encoding => Groonga::Encoding::UTF8) assert_equal("#, " + - "batch_mode: , " + "encoding: <:utf8>, " + "database: >", context.inspect) @@ -75,8 +51,6 @@ db = Groonga::Database.create context = Groonga::Context.default assert_equal("#, " + - "batch_mode: , " + "encoding: <#{Groonga::Encoding.default.inspect}>, " + "database: <#{db.inspect}>>", context.inspect) From null at cozmixng.org Wed Jun 3 09:45:28 2009 From: null at cozmixng.org (null at cozmixng.org) Date: Wed, 03 Jun 2009 22:45:28 +0900 Subject: [groonga-commit:353] groonga [groonga (trunk) r366] * remove QL related methods. Message-ID: <20090603134528.BDF1D1D1C8B@mail.cozmixng.org> retro 2009-06-03 22:45:28 +0900 (Wed, 03 Jun 2009) New Revision: 366 Modified files: groonga/trunk/ext/rb-grn-context.c Log: * remove QL related methods. Modified: groonga/trunk/ext/rb-grn-context.c (+0 -14) =================================================================== --- groonga/trunk/ext/rb-grn-context.c 2009-06-03 22:31:50 +09:00 (rev 365) +++ groonga/trunk/ext/rb-grn-context.c 2009-06-03 22:45:28 +09:00 (rev 366) @@ -358,18 +358,6 @@ } static VALUE -rb_grn_context_use_ql_p (VALUE self) -{ - return CBOOL2RVAL(SELF(self)->flags & GRN_CTX_USE_QL); -} - -static VALUE -rb_grn_context_batch_mode_p (VALUE self) -{ - return CBOOL2RVAL(SELF(self)->flags & GRN_CTX_BATCH_MODE); -} - -static VALUE rb_grn_context_get_encoding (VALUE self) { return GRNENCODING2RVAL(GRN_CTX_GET_ENCODING(SELF(self))); @@ -445,8 +433,6 @@ rb_define_method(cGrnContext, "inspect", rb_grn_context_inspect, 0); - rb_define_method(cGrnContext, "use_ql?", rb_grn_context_use_ql_p, 0); - rb_define_method(cGrnContext, "batch_mode?", rb_grn_context_batch_mode_p, 0); rb_define_method(cGrnContext, "encoding", rb_grn_context_get_encoding, 0); rb_define_method(cGrnContext, "encoding=", rb_grn_context_set_encoding, 1); From null at cozmixng.org Wed Jun 3 10:15:28 2009 From: null at cozmixng.org (null at cozmixng.org) Date: Wed, 03 Jun 2009 23:15:28 +0900 Subject: [groonga-commit:353] groonga [groonga (trunk) r367] * document Groonga::Context. Message-ID: <20090603141528.31DBD1D1C7A@mail.cozmixng.org> retro 2009-06-03 23:15:27 +0900 (Wed, 03 Jun 2009) New Revision: 367 Modified files: groonga/trunk/ext/rb-grn-context.c Log: * document Groonga::Context. Modified: groonga/trunk/ext/rb-grn-context.c (+40 -2) =================================================================== --- groonga/trunk/ext/rb-grn-context.c 2009-06-03 22:42:54 +09:00 (rev 366) +++ groonga/trunk/ext/rb-grn-context.c 2009-06-03 23:15:27 +09:00 (rev 367) @@ -272,7 +272,7 @@ * * ???????????????????????????? * ????????????????? - * Groonga::Context#initialize???? + * Groonga::Context.new???? */ static VALUE rb_grn_context_s_set_default_options (VALUE self, VALUE options) @@ -288,7 +288,7 @@ * ????????????_options_???????????? * ?? * - * [+:encoding] + * [+:encoding+] * ??????????????????????????? * ?Groonga::Encoding???? */ @@ -329,6 +329,12 @@ return Qnil; } +/* + * call-seq: + * context.inspect -> String + * + * ??????????????????????? + */ static VALUE rb_grn_context_inspect (VALUE self) { @@ -357,12 +363,25 @@ return inspected; } +/* + * call-seq: + * context.encoding -> Groonga::Encoding + * + * ????????????????????? + */ static VALUE rb_grn_context_get_encoding (VALUE self) { return GRNENCODING2RVAL(GRN_CTX_GET_ENCODING(SELF(self))); } +/* + * call-seq: + * context.encoding=(encoding) + * + * ????????????????????????????? + * ??????????Groonga::Encoding???? + */ static VALUE rb_grn_context_set_encoding (VALUE self, VALUE rb_encoding) { @@ -376,6 +395,12 @@ return rb_encoding; } +/* + * call-seq: + * context.database -> Groonga::Database + * + * ??????????????????? + */ static VALUE rb_grn_context_get_database (VALUE self) { @@ -385,6 +410,19 @@ return GRNDB2RVAL(context, grn_ctx_db(context), RB_GRN_FALSE); } +/* + * call-seq: + * context[name] -> Groonga::Object or nil + * context[id] -> Groonga::Object or nil + * + * ?????????????????????? + * + * _name_?????????????????????????? + * ???????? + * + * _id_???????????????????ID?????? + * ??????? + */ static VALUE rb_grn_context_array_reference (VALUE self, VALUE name_or_id) { From null at cozmixng.org Wed Jun 3 10:30:37 2009 From: null at cozmixng.org (null at cozmixng.org) Date: Wed, 03 Jun 2009 23:30:37 +0900 Subject: [groonga-commit:354] groonga [groonga (trunk) r368] * document Groonga::Database. Message-ID: <20090603143037.5EF711D1C7A@mail.cozmixng.org> retro 2009-06-03 23:30:37 +0900 (Wed, 03 Jun 2009) New Revision: 368 Modified files: groonga/trunk/ext/rb-grn-database.c Log: * document Groonga::Database. Modified: groonga/trunk/ext/rb-grn-database.c (+66 -0) =================================================================== --- groonga/trunk/ext/rb-grn-database.c 2009-06-03 23:03:27 +09:00 (rev 367) +++ groonga/trunk/ext/rb-grn-database.c 2009-06-03 23:30:37 +09:00 (rev 368) @@ -22,6 +22,17 @@ VALUE rb_cGrnDatabase; +/* + * Document-class: Groonga::Database + * + * ?????????????????????? + * + * ???????????????????????????? + * ??1???????????????????????1?? + * ???????????????????????????? + * ??????????????????????? + */ + grn_obj * rb_grn_database_from_ruby_object (VALUE object) { @@ -39,6 +50,23 @@ return GRNOBJECT2RVAL(rb_cGrnDatabase, context, database, owner); } +/* + * call-seq: + * Groonga::Database.create(options=nil) -> Groonga::Database + * + * ??????????????? + * + * _options_???????????????????????? + * ??????????? + * + * [+:path+] + * ??????????????????????????? + * ???? + * + * [+:context+] + * ???????????????????????? + * Groonga::Context.default?????? + */ static VALUE rb_grn_database_s_create (int argc, VALUE *argv, VALUE klass) { @@ -79,6 +107,22 @@ return rb_database; } +/* + * call-seq: + * Groonga::Database.new(path, options=nil) -> Groonga::Database + * Groonga::Database.new(path, options=nil) {|database| ...} + * + * ???????????????????????????? + * ???????????????????????????? + * ?? + * + * _options_???????????????????????? + * ??????????? + * + * [+:context+] + * ???????????????????????? + * Groonga::Context.default?????? + */ static VALUE rb_grn_database_initialize (int argc, VALUE *argv, VALUE self) { @@ -103,6 +147,22 @@ return Qnil; } +/* + * call-seq: + * Groonga::Database.open(path, options=nil) -> Groonga::Database + * Groonga::Database.open(path, options=nil) {|database| ...} + * + * ???????????????????????????? + * ???????????????????????????? + * ?? + * + * _options_???????????????????????? + * ??????????? + * + * [+:context+] + * ???????????????????????? + * Groonga::Context.default?????? + */ static VALUE rb_grn_database_s_open (int argc, VALUE *argv, VALUE klass) { @@ -116,6 +176,12 @@ return database; } +/* + * call-seq: + * database.each {|object| ...} + * + * ?????????????????????????? + */ static VALUE rb_grn_database_each (VALUE self) { From null at cozmixng.org Wed Jun 3 10:30:38 2009 From: null at cozmixng.org (null at cozmixng.org) Date: Wed, 03 Jun 2009 23:30:38 +0900 Subject: [groonga-commit:355] groonga [groonga (trunk) r369] * use Hoe 2.0.0. Message-ID: <20090603143038.AC4651D1C8F@mail.cozmixng.org> retro 2009-06-03 23:30:38 +0900 (Wed, 03 Jun 2009) New Revision: 369 Modified files: groonga/trunk/Rakefile Log: * use Hoe 2.0.0. Modified: groonga/trunk/Rakefile (+1 -1) =================================================================== --- groonga/trunk/Rakefile 2009-06-03 23:17:42 +09:00 (rev 368) +++ groonga/trunk/Rakefile 2009-06-03 23:30:38 +09:00 (rev 369) @@ -27,7 +27,7 @@ ENV["NODOT"] = "yes" -Hoe::SUPPORTED_TEST_FRAMEWORKS[:testunit2] = "test/run-test.rb" +Hoe::Test::SUPPORTED_TEST_FRAMEWORKS[:testunit2] = "test/run-test.rb" base_dir = File.join(File.dirname(__FILE__)) truncate_base_dir = Proc.new do |x| From null at cozmixng.org Wed Jun 3 10:30:40 2009 From: null at cozmixng.org (null at cozmixng.org) Date: Wed, 03 Jun 2009 23:30:40 +0900 Subject: [groonga-commit:356] groonga [groonga (trunk) r370] * document Groonga::Database. Message-ID: <20090603143040.1914C1D1C8E@mail.cozmixng.org> retro 2009-06-03 23:30:39 +0900 (Wed, 03 Jun 2009) New Revision: 370 Modified files: groonga/trunk/ext/rb-grn-database.c Log: * document Groonga::Database. Modified: groonga/trunk/ext/rb-grn-database.c (+13 -0) =================================================================== --- groonga/trunk/ext/rb-grn-database.c 2009-06-03 23:20:11 +09:00 (rev 369) +++ groonga/trunk/ext/rb-grn-database.c 2009-06-03 23:30:39 +09:00 (rev 370) @@ -66,6 +66,14 @@ * [+:context+] * ???????????????????????? * Groonga::Context.default?????? + * + * ?????????? + * + * ???????????: + * Groonga::Database.create + * + * ???????????: + * Groonga::Database.create(:path => "/tmp/db.groonga") */ static VALUE rb_grn_database_s_create (int argc, VALUE *argv, VALUE klass) @@ -181,6 +189,11 @@ * database.each {|object| ...} * * ?????????????????????????? + * + * ??????????????????: + * database.each do |object| + * p object.name + * end */ static VALUE rb_grn_database_each (VALUE self) From null at cozmixng.org Wed Jun 3 10:45:44 2009 From: null at cozmixng.org (null at cozmixng.org) Date: Wed, 03 Jun 2009 23:45:44 +0900 Subject: [groonga-commit:356] groonga [groonga (trunk) r371] * document Groonga::Encoding. Message-ID: <20090603144545.1C5AD1D1C7F@mail.cozmixng.org> retro 2009-06-03 23:45:44 +0900 (Wed, 03 Jun 2009) New Revision: 371 Modified files: groonga/trunk/ext/rb-grn-encoding.c Log: * document Groonga::Encoding. Modified: groonga/trunk/ext/rb-grn-encoding.c (+45 -1) =================================================================== --- groonga/trunk/ext/rb-grn-encoding.c 2009-06-03 23:25:32 +09:00 (rev 370) +++ groonga/trunk/ext/rb-grn-encoding.c 2009-06-03 23:45:44 +09:00 (rev 371) @@ -22,7 +22,51 @@ * Document-module: Groonga::Encoding * * groonga??????????????????????? - * ????????? + * ??????? + * + * ???????????????????? + * + * [+nil+] + * ??????????????????????????? + * ????????????????????????? + * + * ??????????????????????????? + * groonga?????????????????? + * ?Groonga::Encoding::DEFAULT???? + * + * [+:default+] + * groonga?????????????????????? + * Groonga::Encoding::DEFAULT + * + * [+:none+] + * ???????????????Groonga::Encoding::NONE + * + * [+:euc_jp+] + * EUC-JP????Groonga::Encoding::EUC_JP + * + * [+"euc-jp"+] + * +:euc_jp+???? + * + * [+:utf8+] + * UTF-8????Groonga::Encoding::UTF8 + * + * [+"utf-8"+] + * +:utf8+???? + * + * [+:sjis+] + * Shift_JIS????Groonga::Encoding::SJIS + * + * [+:shift_jis+] + * +:sjis+???? + * + * [+"shift-jis"+] + * +:sjis+???? + * + * [+:latin1+] + * Latin-1????Groonga::Encoding::LATIN1 + * + * [+:koi8r+] + * KOI8-R????Groonga::Encoding::KOI8R */ static VALUE mGrnEncoding; From null at cozmixng.org Wed Jun 3 10:45:46 2009 From: null at cozmixng.org (null at cozmixng.org) Date: Wed, 03 Jun 2009 23:45:46 +0900 Subject: [groonga-commit:357] groonga [groonga (trunk) r372] * document Groonga::Encoding. Message-ID: <20090603144546.8C8AF1D1C7A@mail.cozmixng.org> retro 2009-06-03 23:45:46 +0900 (Wed, 03 Jun 2009) New Revision: 372 Modified files: groonga/trunk/ext/rb-grn-encoding.c Log: * document Groonga::Encoding. Modified: groonga/trunk/ext/rb-grn-encoding.c (+16 -3) =================================================================== --- groonga/trunk/ext/rb-grn-encoding.c 2009-06-03 23:32:22 +09:00 (rev 371) +++ groonga/trunk/ext/rb-grn-encoding.c 2009-06-03 23:45:46 +09:00 (rev 372) @@ -44,13 +44,13 @@ * [+:euc_jp+] * EUC-JP????Groonga::Encoding::EUC_JP * - * [+"euc-jp"+] + * ["euc-jp"] * +:euc_jp+???? * * [+:utf8+] * UTF-8????Groonga::Encoding::UTF8 * - * [+"utf-8"+] + * ["utf-8"] * +:utf8+???? * * [+:sjis+] @@ -59,7 +59,7 @@ * [+:shift_jis+] * +:sjis+???? * - * [+"shift-jis"+] + * ["shift-jis"] * +:sjis+???? * * [+:latin1+] @@ -148,12 +148,25 @@ return rb_encoding; } +/* + * call-seq: + * Groonga::Encoding.default -> ???????? + * + * ?????????????????? + */ static VALUE rb_grn_encoding_s_get_default (VALUE self) { return GRNENCODING2RVAL(grn_get_default_encoding()); } +/* + * call-seq: + * Groonga::Encoding.default(encoding) + * + * ???????????????????????????? + * ??????Groonga::Encoding???? + */ static VALUE rb_grn_encoding_s_set_default (VALUE self, VALUE rb_encoding) { From null at cozmixng.org Wed Jun 3 10:45:48 2009 From: null at cozmixng.org (null at cozmixng.org) Date: Wed, 03 Jun 2009 23:45:48 +0900 Subject: [groonga-commit:357] groonga [groonga (trunk) r373] * document Groonga::EncodingSupport. Message-ID: <20090603144548.0C40A1D1C8F@mail.cozmixng.org> retro 2009-06-03 23:45:47 +0900 (Wed, 03 Jun 2009) New Revision: 373 Modified files: groonga/trunk/ext/rb-grn-encoding-support.c Log: * document Groonga::EncodingSupport. Modified: groonga/trunk/ext/rb-grn-encoding-support.c (+13 -0) =================================================================== --- groonga/trunk/ext/rb-grn-encoding-support.c 2009-06-03 23:35:57 +09:00 (rev 372) +++ groonga/trunk/ext/rb-grn-encoding-support.c 2009-06-03 23:45:47 +09:00 (rev 373) @@ -22,6 +22,19 @@ VALUE rb_mGrnEncodingSupport; +/* + * Document-module: Groonga::EncodingSupport + * + * ????????????????????????????? + * ?? + */ + +/* + * call-seq: + * object.encoding -> ???????? + * + * ??????????????????? + */ static VALUE rb_grn_encoding_support_get_encoding (VALUE self) { From null at cozmixng.org Wed Jun 3 10:45:49 2009 From: null at cozmixng.org (null at cozmixng.org) Date: Wed, 03 Jun 2009 23:45:49 +0900 Subject: [groonga-commit:358] groonga [groonga (trunk) r374] * document Groonga::FixSizeColumn. Message-ID: <20090603144549.F03CD1D1C90@mail.cozmixng.org> retro 2009-06-03 23:45:49 +0900 (Wed, 03 Jun 2009) New Revision: 374 Modified files: groonga/trunk/ext/rb-grn-fix-size-column.c Log: * document Groonga::FixSizeColumn. Modified: groonga/trunk/ext/rb-grn-fix-size-column.c (+12 -2) =================================================================== --- groonga/trunk/ext/rb-grn-fix-size-column.c 2009-06-03 23:38:55 +09:00 (rev 373) +++ groonga/trunk/ext/rb-grn-fix-size-column.c 2009-06-03 23:45:49 +09:00 (rev 374) @@ -22,6 +22,12 @@ VALUE rb_cGrnFixSizeColumn; +/* + * Document-class: Groonga::FixSizeColumn < Groonga::Column + * + * ???????????? + */ + void rb_grn_fix_size_column_unbind (RbGrnFixSizeColumn *rb_grn_fix_size_column) { @@ -104,8 +110,6 @@ } /* - * Document-method: [] - * * call-seq: * column[id] -> ? * @@ -132,6 +136,12 @@ return GRNVALUE2RVAL(context, value, range, self); } +/* + * call-seq: + * column[id] = value + * + * _column_?_id_???????????? + */ static VALUE rb_grn_fix_size_column_array_set (VALUE self, VALUE rb_id, VALUE rb_value) { From null at cozmixng.org Thu Jun 4 03:15:29 2009 From: null at cozmixng.org (null at cozmixng.org) Date: Thu, 04 Jun 2009 16:15:29 +0900 Subject: [groonga-commit:359] groonga [groonga (trunk) r375] * remove QL related test. Message-ID: <20090604071529.130691D1C89@mail.cozmixng.org> retro 2009-06-04 16:15:28 +0900 (Thu, 04 Jun 2009) New Revision: 375 Modified files: groonga/trunk/test/test-context.rb Log: * remove QL related test. Modified: groonga/trunk/test/test-context.rb (+0 -2) =================================================================== --- groonga/trunk/test/test-context.rb 2009-06-03 23:41:42 +09:00 (rev 374) +++ groonga/trunk/test/test-context.rb 2009-06-04 16:15:28 +09:00 (rev 375) @@ -18,8 +18,6 @@ def test_default context = Groonga::Context.default - assert_not_predicate(context, :use_ql?) - assert_not_predicate(context, :batch_mode?) assert_equal(Groonga::Encoding.default, context.encoding) end From null at cozmixng.org Thu Jun 4 03:15:30 2009 From: null at cozmixng.org (null at cozmixng.org) Date: Thu, 04 Jun 2009 16:15:30 +0900 Subject: [groonga-commit:360] groonga [groonga (trunk) r376] * improve document. Message-ID: <20090604071530.670A71D1C8B@mail.cozmixng.org> retro 2009-06-04 16:15:30 +0900 (Thu, 04 Jun 2009) New Revision: 376 Modified files: groonga/trunk/ext/rb-grn-array.c Log: * improve document. Modified: groonga/trunk/ext/rb-grn-array.c (+3 -3) =================================================================== --- groonga/trunk/ext/rb-grn-array.c 2009-06-04 16:08:01 +09:00 (rev 375) +++ groonga/trunk/ext/rb-grn-array.c 2009-06-04 16:15:30 +09:00 (rev 376) @@ -25,8 +25,8 @@ /* * Document-class: Groonga::Array < Groonga::Table * - * ????????????????????????ID??? - * ??? + * ????????????????????????????? + * ID?????? */ /* @@ -51,7 +51,7 @@ * * [+:path+] * ???????????????????????????? - * ?????????????????????????? + * ??????????????????????????? * Groonga::Array.open?????????????????? * ???????????????????????????? * ???????????? From null at cozmixng.org Thu Jun 4 03:15:31 2009 From: null at cozmixng.org (null at cozmixng.org) Date: Thu, 04 Jun 2009 16:15:31 +0900 Subject: [groonga-commit:361] groonga [groonga (trunk) r377] * document Groonga::Hash. Message-ID: <20090604071531.DE2771D1C8D@mail.cozmixng.org> retro 2009-06-04 16:15:31 +0900 (Thu, 04 Jun 2009) New Revision: 377 Modified files: groonga/trunk/ext/rb-grn-hash.c Log: * document Groonga::Hash. Modified: groonga/trunk/ext/rb-grn-hash.c (+139 -0) =================================================================== --- groonga/trunk/ext/rb-grn-hash.c 2009-06-04 16:08:10 +09:00 (rev 376) +++ groonga/trunk/ext/rb-grn-hash.c 2009-06-04 16:15:31 +09:00 (rev 377) @@ -22,6 +22,117 @@ VALUE rb_cGrnHash; +/* + * Document-class: Groonga::Hash < Groonga::Table + * + * ???????????????????????????? + * ???????????????? + */ + +/* + * call-seq: + * Groonga::Hash.create(options={}) -> Groonga::Hash + * Groonga::Hash.create(options={}) {|table| ... } + * + * ????????????????????????????? + * ????????????????????????????? + * ???????????????????? + * + * _options_?????????????? + * + * [+:context+] + * ?????????Groonga::Context?????? + * Groonga::Context.default????? + * + * [+:name+] + * ????????????????Groonga::Context#[]?? + * ??????????????????????????? + * ??????????????ID????????? + * + * [+:path+] + * ???????????????????????????? + * ??????????????????????????? + * Groonga::Hash.open?????????????????? + * ???????????????????????????? + * ???????????? + * + * [+:persistent+] + * +true+????????????????+path+????? + * ????????????????+:context+????? + * Groonga::Context??????????????????? + * ???????????????? + * + * [+:key_type+] + * ??????????????????????????? + * Groonga::Type????????Groonga::Array? + * Groonga::Hash?Groonga::PatriciaTrie??????????? + * + * Groonga::Type?????????????????????? + * ?????????????????????4096???? + * ?????Groonga::Type::TEXT?Groonga::Type::LONG_TEXT + * ???????? + * + * ????????????????ID??????????? + * ?????????Groonga::Record??????????? + * ??????????????Groonga::Record?????? + * ID?????? + * + * ?????????????????????????? + * 4096????????????? + * + * [+:value_size+] + * ????????????????0???? + * + * [+:default_tokenizer+] + * Groonga::IndexColumn????????????????? + * ????????????????????????? + * Groonga::IndexColumn???????? + * ""????????????? + * + * ???: + * + * ?????????????? + * Groonga::Hash.create + * + * ?????????????? + * Groonga::Hash.create(:path => "/tmp/hash.grn") + * + * ???????????????????????????? + * ???? + * Groonga::Hash.create(:name => "", + * :persistent => true) + * + * ??????????512????????????????? + * ???????? + * Groonga::Hash.create(:value => 512) + * + * ??????????????????????????? + * Groonga::Hash.create(:key_type => Groonga::Type::TEXT) + * + * ??????????????????????????? + * ???????????????????????? + * Groonga::Hash.create(:key_type => "") + * + * ?????????????????? + * ??????????????? + * bookmarks = Groonga::Hash.create(:name => "") + * Groonga::Hash.create(:key_type => bookmarks) + * + * ?????????????????? + * ??????????????? + * ?????????????? + * Groonga::Hash.create(:name => "") + * Groonga::Hash.create(:key_type => "") + * + * ???????????????????????????? + * ??????? + * bookmarks = Groonga::Hash.create(:name => "") + * bookmarks.define_column("comment", "") + * terms = Groonga::Hash.create(:name => "", + * :default_tokenizer => "") + * terms.define_index_column("content", bookmarks, + * :source => ".comment") + */ static VALUE rb_grn_hash_s_create (int argc, VALUE *argv, VALUE self) { @@ -87,6 +198,34 @@ return rb_table; } +/* + * call-seq: + * hash.search(key, options=nil) -> Groonga::Hash + * + * _key_???????????ID????????? + * Groonga::Hash????????????????????? + * Groonga::Hash??? + * + * _options_?+:result+???????????????????? + * ???????ID???????????????????? + * +:result+???????????????????????? + * + * _options_?????????????? + * + * [+:result+] + * ???????????? + * + * ?????????????1??????????? + * result = nil + * keys = ["morita", "gunyara-kun", "yu"] + * keys.each do |key| + * result = users.search(key, :result => result) + * end + * result.each do |record| + * user = record.key + * p user.key # -> "morita"???"gunyara-kun"???"yu" + * end + */ static VALUE rb_grn_hash_search (int argc, VALUE *argv, VALUE self) { From null at cozmixng.org Thu Jun 4 03:15:33 2009 From: null at cozmixng.org (null at cozmixng.org) Date: Thu, 04 Jun 2009 16:15:33 +0900 Subject: [groonga-commit:362] groonga [groonga (trunk) r378] * document Groonga::HashCursor. Message-ID: <20090604071533.90A341D1C89@mail.cozmixng.org> retro 2009-06-04 16:15:32 +0900 (Thu, 04 Jun 2009) New Revision: 378 Modified files: groonga/trunk/ext/rb-grn-hash-cursor.c Log: * document Groonga::HashCursor. Modified: groonga/trunk/ext/rb-grn-hash-cursor.c (+8 -0) =================================================================== --- groonga/trunk/ext/rb-grn-hash-cursor.c 2009-06-04 16:08:18 +09:00 (rev 377) +++ groonga/trunk/ext/rb-grn-hash-cursor.c 2009-06-04 16:15:32 +09:00 (rev 378) @@ -20,6 +20,14 @@ VALUE rb_cGrnHashCursor; +/* + * Document-class: Groonga::HashCursor < Groonga::TableCursor + * + * Groonga::Hash?????????????????????? + * ??????????????????Groonga::TableCursor + * ?Groonga::TableCursorKeySupport???? + */ + void rb_grn_init_hash_cursor (VALUE mGrn) { From null at cozmixng.org Thu Jun 4 03:15:34 2009 From: null at cozmixng.org (null at cozmixng.org) Date: Thu, 04 Jun 2009 16:15:34 +0900 Subject: [groonga-commit:363] groonga [groonga (trunk) r379] * document Groonga::IndexColumn. Message-ID: <20090604071534.DBAAF1D1C92@mail.cozmixng.org> retro 2009-06-04 16:15:34 +0900 (Thu, 04 Jun 2009) New Revision: 379 Modified files: groonga/trunk/ext/rb-grn-index-column.c Log: * document Groonga::IndexColumn. Modified: groonga/trunk/ext/rb-grn-index-column.c (+75 -0) =================================================================== --- groonga/trunk/ext/rb-grn-index-column.c 2009-06-04 16:08:27 +09:00 (rev 378) +++ groonga/trunk/ext/rb-grn-index-column.c 2009-06-04 16:15:34 +09:00 (rev 379) @@ -22,6 +22,16 @@ VALUE rb_cGrnIndexColumn; +/* + * Document-class: Groonga::IndexColumn < Groonga::Column + * + * ???????????????????????????? + * ?????????????????? + * + * ?????Groonga::IndexColumn???????? + * Groonga::Table#define_index_column???? + */ + void rb_grn_index_column_unbind (RbGrnIndexColumn *rb_grn_index_column) { @@ -123,6 +133,71 @@ *string_query = rb_grn_index_column->string_query; } +/* + * call-seq: + * column[id] = value + * column[id] = options + * + * ID?_id_????????????????????????? + * ??????????Groonga::Table#define_index_column? + * +:source+???????????????????????? + * ???????????????????????????? + * ????? + * + * _value_??????????? + * + * _options_????????????????????????? + * _options_?????????????? + * + * [+:section+] + * ?????????????????1?????????? + * ?? + * + * Groonga::Table#define_index_column ?{:with_section + * => true}??????????????? + * + * [+:old_value+] + * ???????????????????????????? + * ????????????? + * + * [+:value+] + * ??????????_value_????????_options_? + * {:value => value}?????????????? + * ?? + * + * ??????????????? + * articles = Groonga::Array.create(:name => "") + * articles.define_column("title", "") + * articles.define_column("content", "") + * + * terms = Groonga::Hash.create(:name => "", + * :with_section => true, + * :default_tokenizer => "") + * content_index = terms.define_index_column("content", articles) + * + * content = <<-EOC + * groonga ??????????????????????? + * DBMS?????????????????????????? + * ???????????????????????????? + * ????????????????????????groonga + * ???????????????????????????? + * ??? + * + * ??????? + * ????????????????????????????? + * ???????????????????????????? + * ???????????????????????????? + * ????????????? + * EOC + * + * groonga = articles.add(:title => "groonga", :content => content) + * + * content.split(/\n{2,}/).each_with_index do |sentence, i| + * content_index[groonga] = {:value => sentence, :section => i + 1} + * end + * + * p content.search("????").collect {|record| record.key["title"]} # -> ["groonga"] + */ static VALUE rb_grn_index_column_array_set (VALUE self, VALUE rb_id, VALUE rb_value) { From null at cozmixng.org Thu Jun 4 06:15:25 2009 From: null at cozmixng.org (null at cozmixng.org) Date: Thu, 04 Jun 2009 19:15:25 +0900 Subject: [groonga-commit:364] groonga [groonga (trunk) r380] * add missing error check. Message-ID: <20090604101525.D3B841D1C8E@mail.cozmixng.org> retro 2009-06-04 19:15:25 +0900 (Thu, 04 Jun 2009) New Revision: 380 Modified files: groonga/trunk/ext/rb-grn-array.c groonga/trunk/ext/rb-grn-hash.c groonga/trunk/ext/rb-grn-patricia-trie.c groonga/trunk/test/test-array.rb groonga/trunk/test/test-hash.rb groonga/trunk/test/test-patricia-trie.rb Log: * add missing error check. Modified: groonga/trunk/ext/rb-grn-patricia-trie.c (+2 -0) =================================================================== --- groonga/trunk/ext/rb-grn-patricia-trie.c 2009-06-04 16:08:35 +09:00 (rev 379) +++ groonga/trunk/ext/rb-grn-patricia-trie.c 2009-06-04 19:15:25 +09:00 (rev 380) @@ -81,6 +81,8 @@ table = grn_table_create(context, name, name_size, path, flags, key_type, value_size); + if (!table) + rb_grn_context_check(context, rb_ary_new4(argc, argv)); rb_table = rb_grn_table_key_support_alloc(self); rb_grn_table_key_support_assign(rb_table, rb_context, context, table, RB_GRN_TRUE); Modified: groonga/trunk/ext/rb-grn-hash.c (+2 -0) =================================================================== --- groonga/trunk/ext/rb-grn-hash.c 2009-06-04 16:08:35 +09:00 (rev 379) +++ groonga/trunk/ext/rb-grn-hash.c 2009-06-04 19:15:25 +09:00 (rev 380) @@ -183,6 +183,8 @@ table = grn_table_create(context, name, name_size, path, flags, key_type, value_size); + if (!table) + rb_grn_context_check(context, rb_ary_new4(argc, argv)); rb_table = rb_grn_table_key_support_alloc(self); rb_grn_table_key_support_assign(rb_table, rb_context, context, table, RB_GRN_TRUE); Modified: groonga/trunk/ext/rb-grn-array.c (+2 -0) =================================================================== --- groonga/trunk/ext/rb-grn-array.c 2009-06-04 16:08:35 +09:00 (rev 379) +++ groonga/trunk/ext/rb-grn-array.c 2009-06-04 19:15:25 +09:00 (rev 380) @@ -124,6 +124,8 @@ table = grn_table_create(context, name, name_size, path, flags, NULL, value_size); + if (!table) + rb_grn_context_check(context, rb_ary_new4(argc, argv)); rb_table = GRNOBJECT2RVAL(klass, context, table, RB_GRN_TRUE); rb_grn_context_check(context, rb_table); rb_iv_set(rb_table, "context", rb_context); Modified: groonga/trunk/test/test-patricia-trie.rb (+7 -0) =================================================================== --- groonga/trunk/test/test-patricia-trie.rb 2009-06-04 16:08:35 +09:00 (rev 379) +++ groonga/trunk/test/test-patricia-trie.rb 2009-06-04 19:15:25 +09:00 (rev 380) @@ -65,4 +65,11 @@ assert_equal(context[Groonga::Type::UNIGRAM], terms.default_tokenizer) end + + def test_duplicated_name + Groonga::PatriciaTrie.create(:name => "") + assert_raise(Groonga::InvalidArgument) do + Groonga::PatriciaTrie.create(:name => "") + end + end end Modified: groonga/trunk/test/test-hash.rb (+5 -13) =================================================================== --- groonga/trunk/test/test-hash.rb 2009-06-04 16:08:35 +09:00 (rev 379) +++ groonga/trunk/test/test-hash.rb 2009-06-04 19:15:25 +09:00 (rev 380) @@ -162,18 +162,10 @@ terms.default_tokenizer) end - def test_define_index_column_implicit_with_position - bookmarks = Groonga::Hash.create(:name => "") - bookmarks.define_column("comment", "") - terms = Groonga::Hash.create(:name => "", - :default_tokenizer => "") - index = terms.define_index_column("comment", bookmarks, - :source => ".comment") - groonga = bookmarks.add("groonga", :comment => "search engine by Brazil") - google = bookmarks.add("google", :comment => "search engine by Google") - ruby = bookmarks.add("ruby", :comment => "programing language") - - assert_equal(["groonga", "google"], - index.search("engine").collect {|record| record.key.key}) + def test_duplicated_name + Groonga::Hash.create(:name => "") + assert_raise(Groonga::InvalidArgument) do + Groonga::Hash.create(:name => "") + end end end Modified: groonga/trunk/test/test-array.rb (+7 -0) =================================================================== --- groonga/trunk/test/test-array.rb 2009-06-04 16:08:35 +09:00 (rev 379) +++ groonga/trunk/test/test-array.rb 2009-06-04 19:15:25 +09:00 (rev 380) @@ -64,4 +64,11 @@ assert_equal(["groonga", "google"], index.search(morita.id).collect {|record| record.key["title"]}) end + + def test_duplicated_name + Groonga::Array.create(:name => "") + assert_raise(Groonga::InvalidArgument) do + Groonga::Array.create(:name => "") + end + end end From null at cozmixng.org Thu Jun 4 06:15:27 2009 From: null at cozmixng.org (null at cozmixng.org) Date: Thu, 04 Jun 2009 19:15:27 +0900 Subject: [groonga-commit:365] groonga [groonga (trunk) r381] * support record as index column key. Message-ID: <20090604101527.75E171D1C8F@mail.cozmixng.org> retro 2009-06-04 19:15:27 +0900 (Thu, 04 Jun 2009) New Revision: 381 Added files: groonga/trunk/test/test-index-column.rb Modified files: groonga/trunk/ext/rb-grn-index-column.c groonga/trunk/test/test-hash.rb Log: * support record as index column key. Modified: groonga/trunk/ext/rb-grn-index-column.c (+3 -3) =================================================================== --- groonga/trunk/ext/rb-grn-index-column.c 2009-06-04 19:01:13 +09:00 (rev 380) +++ groonga/trunk/ext/rb-grn-index-column.c 2009-06-04 19:15:27 +09:00 (rev 381) @@ -202,7 +202,7 @@ rb_grn_index_column_array_set (VALUE self, VALUE rb_id, VALUE rb_value) { grn_ctx *context = NULL; - grn_obj *column; + grn_obj *column, *range; grn_rc rc; grn_id id; unsigned int section; @@ -214,10 +214,10 @@ rb_grn_index_column_deconstruct(SELF(self), &column, &context, NULL, NULL, &new_value, &old_value, - NULL, NULL, + NULL, &range, NULL, NULL); - id = NUM2UINT(rb_id); + id = RVAL2GRNID(rb_id, context, range, self); if (!RVAL2CBOOL(rb_obj_is_kind_of(rb_value, rb_cHash))) { VALUE hash_value; Added: groonga/trunk/test/test-index-column.rb (+57 -0) =================================================================== --- groonga/trunk/test/test-index-column.rb 2009-06-04 19:01:13 +09:00 (rev 380) +++ groonga/trunk/test/test-index-column.rb 2009-06-04 19:15:27 +09:00 (rev 381) @@ -0,0 +1,57 @@ +# -*- coding: utf-8 -*- +# +# Copyright (C) 2009 Kouhei Sutou +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License version 2.1 as published by the Free Software Foundation. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +class IndexColumnTest < Test::Unit::TestCase + include GroongaTestUtils + + def setup + setup_database + end + + def test_array_set_with_record + articles = Groonga::Array.create(:name => "") + articles.define_column("content", "") + + terms = Groonga::Hash.create(:name => "", + :default_tokenizer => "") + content_index = terms.define_index_column("content", articles, + :with_section => true) + + content = <<-EOC + groonga ??????????????????????? + DBMS?????????????????????????? + ???????????????????????????? + ????????????????????????groonga + ???????????????????????????? + ??? + + ??????? + ????????????????????????????? + ???????????????????????????? + ???????????????????????????? + ????????????? + EOC + + groonga = articles.add(:content => content) + + content.split(/\n{2,}/).each_with_index do |sentence, i| + content_index[groonga] = {:value => sentence, :section => i + 1} + end + assert_equal([groonga], + content_index.search("????").collect {|record| record.key}) + end +end Modified: groonga/trunk/test/test-hash.rb (+16 -0) =================================================================== --- groonga/trunk/test/test-hash.rb 2009-06-04 19:01:13 +09:00 (rev 380) +++ groonga/trunk/test/test-hash.rb 2009-06-04 19:15:27 +09:00 (rev 381) @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- # Copyright (C) 2009 Kouhei Sutou # # This library is free software; you can redistribute it and/or @@ -168,4 +169,19 @@ Groonga::Hash.create(:name => "") end end + + def test_define_index_column_implicit_with_position + bookmarks = Groonga::Hash.create(:name => "") + bookmarks.define_column("comment", "") + terms = Groonga::Hash.create(:name => "", + :default_tokenizer => "") + index = terms.define_index_column("comment", bookmarks, + :source => ".comment") + groonga = bookmarks.add("groonga", :comment => "search engine by Brazil") + google = bookmarks.add("google", :comment => "search engine by Google") + ruby = bookmarks.add("ruby", :comment => "programing language") + + assert_equal(["groonga", "google"], + index.search("engine").collect {|record| record.key.key}) + end end From null at cozmixng.org Thu Jun 4 06:15:28 2009 From: null at cozmixng.org (null at cozmixng.org) Date: Thu, 04 Jun 2009 19:15:28 +0900 Subject: [groonga-commit:366] groonga [groonga (trunk) r382] * use 0.0.8. Message-ID: <20090604101528.E9CD81D1C90@mail.cozmixng.org> retro 2009-06-04 19:15:28 +0900 (Thu, 04 Jun 2009) New Revision: 382 Modified files: groonga/trunk/extconf.rb Log: * use 0.0.8. Modified: groonga/trunk/extconf.rb (+1 -1) =================================================================== --- groonga/trunk/extconf.rb 2009-06-04 19:01:33 +09:00 (rev 381) +++ groonga/trunk/extconf.rb 2009-06-04 19:15:28 +09:00 (rev 382) @@ -35,7 +35,7 @@ module_name = "groonga" ext_dir_name = "ext" src_dir = File.join(File.expand_path(File.dirname(__FILE__)), ext_dir_name) -major, minor, micro = 0, 0, 7 +major, minor, micro = 0, 0, 8 def install_groonga_locally(major, minor, micro) require 'open-uri' From null at cozmixng.org Thu Jun 4 06:15:30 2009 From: null at cozmixng.org (null at cozmixng.org) Date: Thu, 04 Jun 2009 19:15:30 +0900 Subject: [groonga-commit:367] groonga [groonga (trunk) r383] * fix document. Message-ID: <20090604101530.3FCAF1D1C8E@mail.cozmixng.org> retro 2009-06-04 19:15:29 +0900 (Thu, 04 Jun 2009) New Revision: 383 Modified files: groonga/trunk/ext/rb-grn-index-column.c Log: * fix document. Modified: groonga/trunk/ext/rb-grn-index-column.c (+3 -1) =================================================================== --- groonga/trunk/ext/rb-grn-index-column.c 2009-06-04 19:01:48 +09:00 (rev 382) +++ groonga/trunk/ext/rb-grn-index-column.c 2009-06-04 19:15:29 +09:00 (rev 383) @@ -196,7 +196,9 @@ * content_index[groonga] = {:value => sentence, :section => i + 1} * end * - * p content.search("????").collect {|record| record.key["title"]} # -> ["groonga"] + * content.search("????").collect do |record| + * p record.key["title"] # -> "groonga" + * end */ static VALUE rb_grn_index_column_array_set (VALUE self, VALUE rb_id, VALUE rb_value) From null at cozmixng.org Thu Jun 4 06:45:29 2009 From: null at cozmixng.org (null at cozmixng.org) Date: Thu, 04 Jun 2009 19:45:29 +0900 Subject: [groonga-commit:368] groonga [groonga (trunk) r384] * fix [#26086]: Ruby aborts when I open same database twice. Message-ID: <20090604104529.6F3851D1C8B@mail.cozmixng.org> retro 2009-06-04 19:45:29 +0900 (Thu, 04 Jun 2009) New Revision: 384 Modified files: groonga/trunk/README.ja.rdoc groonga/trunk/README.rdoc groonga/trunk/ext/rb-grn-table.c groonga/trunk/test/test-array.rb groonga/trunk/test/test-hash.rb groonga/trunk/test/test-patricia-trie.rb Log: * fix [#26086]: Ruby aborts when I open same database twice. Modified: groonga/trunk/ext/rb-grn-table.c (+16 -3) =================================================================== --- groonga/trunk/ext/rb-grn-table.c 2009-06-04 19:02:02 +09:00 (rev 383) +++ groonga/trunk/ext/rb-grn-table.c 2009-06-04 19:45:29 +09:00 (rev 384) @@ -226,7 +226,13 @@ VALUE rb_context; table = rb_grn_table_open_raw(argc, argv, &context, &rb_context); - rb_grn_object_assign(self, rb_context, context, table, RB_GRN_TRUE); + /* FIXME!!!! */ + if (self == rb_cGrnArray) { + rb_grn_table_assign(self, rb_context, context, table, RB_GRN_TRUE); + } else { + rb_grn_table_key_support_assign(self, rb_context, context, + table, RB_GRN_TRUE); + } rb_grn_context_check(context, self); return Qnil; @@ -263,8 +269,15 @@ } } - rb_table = rb_grn_object_alloc(klass); - rb_grn_object_assign(rb_table, rb_context, context, table, RB_GRN_TRUE); + /* FIXME!!!! */ + if (klass == rb_cGrnArray) { + rb_table = rb_grn_table_alloc(klass); + rb_grn_table_assign(rb_table, rb_context, context, table, RB_GRN_TRUE); + } else { + rb_table = rb_grn_table_key_support_alloc(klass); + rb_grn_table_key_support_assign(rb_table, rb_context, context, + table, RB_GRN_TRUE); + } if (rb_block_given_p()) return rb_ensure(rb_yield, rb_table, rb_grn_object_close, rb_table); Modified: groonga/trunk/README.ja.rdoc (+1 -0) =================================================================== --- groonga/trunk/README.ja.rdoc 2009-06-04 19:02:02 +09:00 (rev 383) +++ groonga/trunk/README.ja.rdoc 2009-06-04 19:45:29 +09:00 (rev 384) @@ -51,3 +51,4 @@ == ?? * ???: ??groonga???????????? +* ??????: ?????????????? Modified: groonga/trunk/README.rdoc (+1 -0) =================================================================== --- groonga/trunk/README.rdoc 2009-06-04 19:02:02 +09:00 (rev 383) +++ groonga/trunk/README.rdoc 2009-06-04 19:45:29 +09:00 (rev 384) @@ -52,3 +52,4 @@ == Thanks * mori: sent patches to support the latest groonga. +* Tasuku SUENAGA: sent bug reports. Modified: groonga/trunk/test/test-patricia-trie.rb (+7 -0) =================================================================== --- groonga/trunk/test/test-patricia-trie.rb 2009-06-04 19:02:02 +09:00 (rev 383) +++ groonga/trunk/test/test-patricia-trie.rb 2009-06-04 19:45:29 +09:00 (rev 384) @@ -72,4 +72,11 @@ Groonga::PatriciaTrie.create(:name => "") end end + + def test_open_same_name + users_created = Groonga::PatriciaTrie.create(:name => "") + users_opened = Groonga::PatriciaTrie.open(:name => "") + users_opened.add("morita") + assert_equal(1, users_created.size) + end end Modified: groonga/trunk/test/test-hash.rb (+7 -0) =================================================================== --- groonga/trunk/test/test-hash.rb 2009-06-04 19:02:02 +09:00 (rev 383) +++ groonga/trunk/test/test-hash.rb 2009-06-04 19:45:29 +09:00 (rev 384) @@ -184,4 +184,11 @@ assert_equal(["groonga", "google"], index.search("engine").collect {|record| record.key.key}) end + + def test_open_same_name + users_created = Groonga::Hash.create(:name => "") + users_opened = Groonga::Hash.open(:name => "") + users_opened.add("morita") + assert_equal(1, users_created.size) + end end Modified: groonga/trunk/test/test-array.rb (+8 -1) =================================================================== --- groonga/trunk/test/test-array.rb 2009-06-04 19:02:02 +09:00 (rev 383) +++ groonga/trunk/test/test-array.rb 2009-06-04 19:45:29 +09:00 (rev 384) @@ -65,10 +65,17 @@ index.search(morita.id).collect {|record| record.key["title"]}) end - def test_duplicated_name + def test_create_duplicated_name Groonga::Array.create(:name => "") assert_raise(Groonga::InvalidArgument) do Groonga::Array.create(:name => "") end end + + def test_open_same_name + users_created = Groonga::Array.create(:name => "") + users_opened = Groonga::Array.open(:name => "") + users_opened.add + assert_equal(1, users_created.size) + end end From null at cozmixng.org Thu Jun 4 07:00:30 2009 From: null at cozmixng.org (null at cozmixng.org) Date: Thu, 04 Jun 2009 20:00:30 +0900 Subject: [groonga-commit:369] groonga [groonga (trunk) r385] * add a 0.0.2 entry. Message-ID: <20090604110030.671F91D1C8B@mail.cozmixng.org> retro 2009-06-04 20:00:30 +0900 (Thu, 04 Jun 2009) New Revision: 385 Modified files: groonga/trunk/NEWS.ja.rdoc groonga/trunk/NEWS.rdoc Log: * add a 0.0.2 entry. Modified: groonga/trunk/NEWS.rdoc (+11 -0) =================================================================== --- groonga/trunk/NEWS.rdoc 2009-06-04 19:36:46 +09:00 (rev 384) +++ groonga/trunk/NEWS.rdoc 2009-06-04 20:00:30 +09:00 (rev 385) @@ -1,5 +1,16 @@ = NEWS +== 0.0.2: 2009-06-04 + +* Supported groonga 0.0.9 [mori] +* Improved preformance: cache key, value, domain and range +* Improved API +* Added documents +* Supported Ruby 1.9 +* Bug fixes: +** Fixed install process [Tasuku SUENAGA] +** Fixed memory leaks + == 0.0.1: 2009-04-30 * Initial release! Modified: groonga/trunk/NEWS.ja.rdoc (+11 -0) =================================================================== --- groonga/trunk/NEWS.ja.rdoc 2009-06-04 19:36:46 +09:00 (rev 384) +++ groonga/trunk/NEWS.ja.rdoc 2009-06-04 20:00:30 +09:00 (rev 385) @@ -1,5 +1,16 @@ = ???? +== 0.0.2: 2009-06-04 + +* groonga 0.0.9?? [mori] +* ????: ??????????????????? +* API?? +* ????????? +* Ruby 1.9?? +* ????: +** ??????????? [Tasuku SUENAGA] +** ???????? + == 0.0.1: 2009-04-30 * ???????? From null at cozmixng.org Thu Jun 4 07:00:31 2009 From: null at cozmixng.org (null at cozmixng.org) Date: Thu, 04 Jun 2009 20:00:31 +0900 Subject: [groonga-commit:370] groonga [groonga (trunk) r386] * fix markup. Message-ID: <20090604110031.C0A961D1C8F@mail.cozmixng.org> retro 2009-06-04 20:00:31 +0900 (Thu, 04 Jun 2009) New Revision: 386 Modified files: groonga/trunk/ext/rb-grn-index-column.c Log: * fix markup. Modified: groonga/trunk/ext/rb-grn-index-column.c (+3 -2) =================================================================== --- groonga/trunk/ext/rb-grn-index-column.c 2009-06-04 19:48:29 +09:00 (rev 385) +++ groonga/trunk/ext/rb-grn-index-column.c 2009-06-04 20:00:31 +09:00 (rev 386) @@ -153,8 +153,9 @@ * ?????????????????1?????????? * ?? * - * Groonga::Table#define_index_column ?{:with_section - * => true}??????????????? + * Groonga::Table#define_index_column? + * {:with_section => true}??????????? + * ???? * * [+:old_value+] * ???????????????????????????? From null at cozmixng.org Thu Jun 4 21:00:28 2009 From: null at cozmixng.org (null at cozmixng.org) Date: Fri, 05 Jun 2009 10:00:28 +0900 Subject: [groonga-commit:371] groonga [groonga (trunk) r387] * 0.0.1 -> 0.0.2. Message-ID: <20090605010028.7FBDC1D1C91@mail.cozmixng.org> retro 2009-06-05 10:00:28 +0900 (Fri, 05 Jun 2009) New Revision: 387 Modified files: groonga/trunk/html/index.html Log: * 0.0.1 -> 0.0.2. Modified: groonga/trunk/html/index.html (+1 -1) =================================================================== --- groonga/trunk/html/index.html 2009-06-04 19:53:29 +09:00 (rev 386) +++ groonga/trunk/html/index.html 2009-06-05 10:00:28 +09:00 (rev 387) @@ -42,7 +42,7 @@

Ruby/groonga???????

- 2009-04-30????????0.0.1?????? + 2009-06-04????????0.0.2??????

Ruby/groonga???????

From null at cozmixng.org Thu Jun 4 21:00:29 2009 From: null at cozmixng.org (null at cozmixng.org) Date: Fri, 05 Jun 2009 10:00:29 +0900 Subject: [groonga-commit:372] groonga [groonga (trunk) r388] * fix typos. Message-ID: <20090605010029.C7ACF1D1C92@mail.cozmixng.org> retro 2009-06-05 10:00:29 +0900 (Fri, 05 Jun 2009) New Revision: 388 Modified files: groonga/trunk/NEWS.ja.rdoc groonga/trunk/NEWS.rdoc Log: * fix typos. Modified: groonga/trunk/NEWS.rdoc (+1 -1) =================================================================== --- groonga/trunk/NEWS.rdoc 2009-06-05 09:55:33 +09:00 (rev 387) +++ groonga/trunk/NEWS.rdoc 2009-06-05 10:00:29 +09:00 (rev 388) @@ -2,7 +2,7 @@ == 0.0.2: 2009-06-04 -* Supported groonga 0.0.9 [mori] +* Supported groonga 0.0.8 [mori] * Improved preformance: cache key, value, domain and range * Improved API * Added documents Modified: groonga/trunk/NEWS.ja.rdoc (+1 -1) =================================================================== --- groonga/trunk/NEWS.ja.rdoc 2009-06-05 09:55:33 +09:00 (rev 387) +++ groonga/trunk/NEWS.ja.rdoc 2009-06-05 10:00:29 +09:00 (rev 388) @@ -2,7 +2,7 @@ == 0.0.2: 2009-06-04 -* groonga 0.0.9?? [mori] +* groonga 0.0.8?? [mori] * ????: ??????????????????? * API?? * ????????? From null at cozmixng.org Thu Jun 4 21:00:31 2009 From: null at cozmixng.org (null at cozmixng.org) Date: Fri, 05 Jun 2009 10:00:31 +0900 Subject: [groonga-commit:373] groonga [groonga (trunk) r389] * add tag task. Message-ID: <20090605010031.201621D1C93@mail.cozmixng.org> retro 2009-06-05 10:00:30 +0900 (Fri, 05 Jun 2009) New Revision: 389 Modified files: groonga/trunk/Rakefile Log: * add tag task. Modified: groonga/trunk/Rakefile (+5 -0) =================================================================== --- groonga/trunk/Rakefile 2009-06-05 09:55:43 +09:00 (rev 388) +++ groonga/trunk/Rakefile 2009-06-05 10:00:30 +09:00 (rev 389) @@ -202,6 +202,11 @@ sh "rsync #{rsync_args} html/ #{host}:#{remote_dir}" end +task :tag do + repository = "svn+ssh://rubyforge.org/var/svn/groonga/groonga" + sh "svn cp #{repository}/trunk #{repository}/tags/#{version}" +end + # fix Hoe's incorrect guess. project.spec.executables.clear # project.lib_files = project.spec.files.grep(%r|^src/lib/|) From null at cozmixng.org Thu Jun 4 21:00:32 2009 From: null at cozmixng.org (null at cozmixng.org) Date: Fri, 05 Jun 2009 10:00:32 +0900 Subject: [groonga-commit:374] groonga [groonga (trunk) r390] * set release log message. Message-ID: <20090605010032.8C7BA1D1C91@mail.cozmixng.org> retro 2009-06-05 10:00:32 +0900 (Fri, 05 Jun 2009) New Revision: 390 Modified files: groonga/trunk/Rakefile Log: * set release log message. Modified: groonga/trunk/Rakefile (+2 -1) =================================================================== --- groonga/trunk/Rakefile 2009-06-05 09:55:51 +09:00 (rev 389) +++ groonga/trunk/Rakefile 2009-06-05 10:00:32 +09:00 (rev 390) @@ -204,7 +204,8 @@ task :tag do repository = "svn+ssh://rubyforge.org/var/svn/groonga/groonga" - sh "svn cp #{repository}/trunk #{repository}/tags/#{version}" + sh("svn cp -m 'release #{version}!!!' " + + "#{repository}/trunk #{repository}/tags/#{version}") end # fix Hoe's incorrect guess. From null at cozmixng.org Thu Jun 4 21:00:33 2009 From: null at cozmixng.org (null at cozmixng.org) Date: Fri, 05 Jun 2009 10:00:33 +0900 Subject: [groonga-commit:373] groonga [groonga (trunk) r391] * follow the recent Hoe changes. Message-ID: <20090605010033.D78DA1D1C92@mail.cozmixng.org> retro 2009-06-05 10:00:33 +0900 (Fri, 05 Jun 2009) New Revision: 391 Modified files: groonga/trunk/Rakefile Log: * follow the recent Hoe changes. Modified: groonga/trunk/Rakefile (+1 -1) =================================================================== --- groonga/trunk/Rakefile 2009-06-05 09:56:00 +09:00 (rev 390) +++ groonga/trunk/Rakefile 2009-06-05 10:00:33 +09:00 (rev 391) @@ -88,7 +88,7 @@ ENV["VERSION"] ||= guess_version version = ENV["VERSION"] -project = Hoe.new('groonga', version) do |project| +project = Hoe.spec('groonga', version) do |project| project.rubyforge_name = 'groonga' authors = File.join(base_dir, "AUTHORS") project.author = File.readlines(authors).collect do |line| From null at cozmixng.org Thu Jun 4 21:00:36 2009 From: null at cozmixng.org (null at cozmixng.org) Date: Fri, 05 Jun 2009 10:00:36 +0900 Subject: [groonga-commit:374] groonga [groonga (trunk) r393] * update ignore files. Message-ID: <20090605010036.73A5A1D1C96@mail.cozmixng.org> retro 2009-06-05 10:00:36 +0900 (Fri, 05 Jun 2009) New Revision: 393 Modified files: groonga/trunk/.gitignore Log: * update ignore files. Modified: groonga/trunk/.gitignore (+1 -0) =================================================================== --- groonga/trunk/.gitignore 2009-06-05 09:58:50 +09:00 (rev 392) +++ groonga/trunk/.gitignore 2009-06-05 10:00:36 +09:00 (rev 393) @@ -2,6 +2,7 @@ /.gdb_history /Makefile /doc +/email.txt /mkmf.log /pkg /test-unit From null at cozmixng.org Thu Jun 4 21:00:35 2009 From: null at cozmixng.org (null at cozmixng.org) Date: Fri, 05 Jun 2009 10:00:35 +0900 Subject: [groonga-commit:375] groonga [groonga (trunk) r392] * follow the recent Hoe changes. Message-ID: <20090605010035.2B0C11D1C93@mail.cozmixng.org> retro 2009-06-05 10:00:34 +0900 (Fri, 05 Jun 2009) New Revision: 392 Modified files: groonga/trunk/Rakefile Log: * follow the recent Hoe changes. Modified: groonga/trunk/Rakefile (+4 -1) =================================================================== --- groonga/trunk/Rakefile 2009-06-05 09:56:20 +09:00 (rev 391) +++ groonga/trunk/Rakefile 2009-06-05 10:00:34 +09:00 (rev 392) @@ -88,7 +88,10 @@ ENV["VERSION"] ||= guess_version version = ENV["VERSION"] -project = Hoe.spec('groonga', version) do |project| +project = nil +Hoe.spec('groonga') do |_project| + project = _project + project.version = version project.rubyforge_name = 'groonga' authors = File.join(base_dir, "AUTHORS") project.author = File.readlines(authors).collect do |line| From null at cozmixng.org Thu Jun 4 21:15:24 2009 From: null at cozmixng.org (null at cozmixng.org) Date: Fri, 05 Jun 2009 10:15:24 +0900 Subject: [groonga-commit:376] groonga [groonga (trunk) r395] * 0.0.2 -> 0.0.3. Message-ID: <20090605011524.096A71D1C7A@mail.cozmixng.org> retro 2009-06-05 10:15:23 +0900 (Fri, 05 Jun 2009) New Revision: 395 Modified files: groonga/trunk/ext/rb-grn.h Log: * 0.0.2 -> 0.0.3. Modified: groonga/trunk/ext/rb-grn.h (+1 -1) =================================================================== --- groonga/trunk/ext/rb-grn.h 2009-06-05 09:59:38 +09:00 (rev 394) +++ groonga/trunk/ext/rb-grn.h 2009-06-05 10:15:23 +09:00 (rev 395) @@ -59,7 +59,7 @@ #define RB_GRN_MAJOR_VERSION 0 #define RB_GRN_MINOR_VERSION 0 -#define RB_GRN_MICRO_VERSION 2 +#define RB_GRN_MICRO_VERSION 3 typedef int rb_grn_boolean; #define RB_GRN_FALSE (0) From null at cozmixng.org Thu Jun 4 21:00:37 2009 From: null at cozmixng.org (null at cozmixng.org) Date: Fri, 05 Jun 2009 10:00:37 +0900 Subject: [groonga-commit:377] groonga [groonga (0.0.2) r394] release 0.0.2!!! Message-ID: <20090605010037.DA4751D1C99@mail.cozmixng.org> retro 2009-06-05 10:00:37 +0900 (Fri, 05 Jun 2009) New Revision: 394 Copied directories: groonga/tags/0.0.2/ (from rev 393, groonga/trunk/) Log: release 0.0.2!!! Copied: groonga/tags/0.0.2/ (from rev 393, groonga/trunk/) From null at cozmixng.org Thu Jun 4 21:30:29 2009 From: null at cozmixng.org (null at cozmixng.org) Date: Fri, 05 Jun 2009 10:30:29 +0900 Subject: [groonga-commit:378] groonga [activegroonga (trunk) r396] * specify required libraries. Message-ID: <20090605013029.AD1551D1C7A@mail.cozmixng.org> retro 2009-06-05 10:30:29 +0900 (Fri, 05 Jun 2009) New Revision: 396 Modified files: activegroonga/trunk/Rakefile Log: * specify required libraries. Modified: activegroonga/trunk/Rakefile (+1 -0) =================================================================== --- activegroonga/trunk/Rakefile 2009-06-05 10:00:43 +09:00 (rev 395) +++ activegroonga/trunk/Rakefile 2009-06-05 10:30:29 +09:00 (rev 396) @@ -104,6 +104,7 @@ :extra_rdoc_files => Dir.glob("*.rdoc"), } project.readme_file = "README.ja.rdoc" + project.extra_deps = [["groonga", "=#{version}"], ["activerecord", "=2.3.2"]] news_of_current_release = File.read("NEWS.rdoc").split(/^==\s.*$/)[1] project.changes = cleanup_white_space(news_of_current_release) From null at cozmixng.org Thu Jun 4 21:30:30 2009 From: null at cozmixng.org (null at cozmixng.org) Date: Fri, 05 Jun 2009 10:30:30 +0900 Subject: [groonga-commit:379] groonga [activegroonga (trunk) r397] * follow the recent Hoe changes. Message-ID: <20090605013031.0074F1D1C8B@mail.cozmixng.org> retro 2009-06-05 10:30:30 +0900 (Fri, 05 Jun 2009) New Revision: 397 Modified files: activegroonga/trunk/Rakefile Log: * follow the recent Hoe changes. * add tag task. Modified: activegroonga/trunk/Rakefile (+11 -2) =================================================================== --- activegroonga/trunk/Rakefile 2009-06-05 10:20:16 +09:00 (rev 396) +++ activegroonga/trunk/Rakefile 2009-06-05 10:30:30 +09:00 (rev 397) @@ -27,7 +27,7 @@ ENV["NODOT"] = "yes" -Hoe::SUPPORTED_TEST_FRAMEWORKS[:testunit2] = "test/run-test.rb" +Hoe::Test::SUPPORTED_TEST_FRAMEWORKS[:testunit2] = "test/run-test.rb" base_dir = File.join(File.dirname(__FILE__)) truncate_base_dir = Proc.new do |x| @@ -85,7 +85,10 @@ ENV["VERSION"] ||= guess_version version = ENV["VERSION"] -project = Hoe.new('activegroonga', version) do |project| +project = nil +Hoe.spec('activegroonga') do |_project| + project = _project + project.version = version project.rubyforge_name = 'groonga' authors = File.join(base_dir, "AUTHORS") project.author = File.readlines(authors).collect do |line| @@ -173,3 +176,9 @@ end end end + +task :tag do + repository = "svn+ssh://rubyforge.org/var/svn/groonga/activegroonga" + sh("svn cp -m 'release #{version}!!!' " + + "#{repository}/trunk #{repository}/tags/#{version}") +end From null at cozmixng.org Thu Jun 4 21:30:32 2009 From: null at cozmixng.org (null at cozmixng.org) Date: Fri, 05 Jun 2009 10:30:32 +0900 Subject: [groonga-commit:380] groonga [activegroonga (trunk) r398] * add entries for 0.0.2. Message-ID: <20090605013032.47A6D1D1C8D@mail.cozmixng.org> retro 2009-06-05 10:30:31 +0900 (Fri, 05 Jun 2009) New Revision: 398 Modified files: activegroonga/trunk/NEWS.ja.rdoc activegroonga/trunk/NEWS.rdoc Log: * add entries for 0.0.2. Modified: activegroonga/trunk/NEWS.rdoc (+4 -0) =================================================================== --- activegroonga/trunk/NEWS.rdoc 2009-06-05 10:24:45 +09:00 (rev 397) +++ activegroonga/trunk/NEWS.rdoc 2009-06-05 10:30:31 +09:00 (rev 398) @@ -1,5 +1,9 @@ = NEWS +== 0.0.2: 2009-06-05 + +* Support Ruby/groonga 0.0.2. + == 0.0.1: 2009-04-30 * Initial release! Modified: activegroonga/trunk/NEWS.ja.rdoc (+4 -0) =================================================================== --- activegroonga/trunk/NEWS.ja.rdoc 2009-06-05 10:24:45 +09:00 (rev 397) +++ activegroonga/trunk/NEWS.ja.rdoc 2009-06-05 10:30:31 +09:00 (rev 398) @@ -1,5 +1,9 @@ = ???? +== 0.0.2: 2009-06-05 + +* Ruby/groonga 0.0.2?? + == 0.0.1: 2009-04-30 * ???????? From null at cozmixng.org Thu Jun 4 21:30:33 2009 From: null at cozmixng.org (null at cozmixng.org) Date: Fri, 05 Jun 2009 10:30:33 +0900 Subject: [groonga-commit:381] groonga [activegroonga (0.0.2) r399] release 0.0.2!!! Message-ID: <20090605013033.A4ACD1D1C91@mail.cozmixng.org> retro 2009-06-05 10:30:33 +0900 (Fri, 05 Jun 2009) New Revision: 399 Copied directories: activegroonga/tags/0.0.2/ (from rev 398, activegroonga/trunk/) Log: release 0.0.2!!! Copied: activegroonga/tags/0.0.2/ (from rev 398, activegroonga/trunk/) From null at cozmixng.org Thu Jun 4 21:45:40 2009 From: null at cozmixng.org (null at cozmixng.org) Date: Fri, 05 Jun 2009 10:45:40 +0900 Subject: [groonga-commit:381] groonga [activegroonga (trunk) r400] * 0.0.2 -> 0.0.3. Message-ID: <20090605014540.A7AA11D1C7A@mail.cozmixng.org> retro 2009-06-05 10:45:40 +0900 (Fri, 05 Jun 2009) New Revision: 400 Modified files: activegroonga/trunk/lib/active_groonga/version.rb Log: * 0.0.2 -> 0.0.3. Modified: activegroonga/trunk/lib/active_groonga/version.rb (+1 -1) =================================================================== --- activegroonga/trunk/lib/active_groonga/version.rb 2009-06-05 10:30:23 +09:00 (rev 399) +++ activegroonga/trunk/lib/active_groonga/version.rb 2009-06-05 10:45:40 +09:00 (rev 400) @@ -17,7 +17,7 @@ module VERSION MAJOR = 0 MINOR = 0 - TINY = 2 + TINY = 3 STRING = [MAJOR, MINOR, TINY].join(".") end From null at cozmixng.org Fri Jun 5 10:45:26 2009 From: null at cozmixng.org (null at cozmixng.org) Date: Fri, 05 Jun 2009 23:45:26 +0900 Subject: [groonga-commit:382] groonga [groonga (trunk) r401] * add Groonga::TableKeySupport#has_key? [#26145] Message-ID: <20090605144526.E08711D1C6D@mail.cozmixng.org> retro 2009-06-05 23:45:26 +0900 (Fri, 05 Jun 2009) New Revision: 401 Modified files: groonga/trunk/NEWS.ja.rdoc groonga/trunk/ext/rb-grn-table-key-support.c groonga/trunk/test/test-hash.rb groonga/trunk/test/test-patricia-trie.rb Log: * add Groonga::TableKeySupport#has_key? [#26145] Suggested by Tasuku SUENAGA. Thanks!!! Modified: groonga/trunk/ext/rb-grn-table-key-support.c (+20 -0) =================================================================== --- groonga/trunk/ext/rb-grn-table-key-support.c 2009-06-05 10:30:46 +09:00 (rev 400) +++ groonga/trunk/ext/rb-grn-table-key-support.c 2009-06-05 23:45:26 +09:00 (rev 401) @@ -183,6 +183,24 @@ } static VALUE +rb_grn_table_key_support_has_key (VALUE self, VALUE rb_key) +{ + grn_ctx *context; + grn_obj *table, *key, *domain; + grn_id id, domain_id; + + rb_grn_table_key_support_deconstruct(SELF(self), &table, &context, + &key, &domain_id, &domain, + NULL, NULL, NULL); + + GRN_BULK_REWIND(key); + RVAL2GRNKEY(rb_key, context, key, domain_id, domain, self); + id = grn_table_get(context, table, GRN_BULK_HEAD(key), GRN_BULK_VSIZE(key)); + + return id == GRN_ID_NIL ? Qfalse : Qtrue; +} + +static VALUE rb_grn_table_key_support_delete_by_key (VALUE self, VALUE rb_key) { grn_ctx *context; @@ -383,6 +401,8 @@ rb_grn_table_key_support_add, -1); rb_define_method(rb_mGrnTableKeySupport, "key", rb_grn_table_key_support_get_key, 1); + rb_define_method(rb_mGrnTableKeySupport, "has_key?", + rb_grn_table_key_support_has_key, 1); rb_define_method(rb_mGrnTableKeySupport, "delete", rb_grn_table_key_support_delete, 1); Modified: groonga/trunk/NEWS.ja.rdoc (+4 -0) =================================================================== --- groonga/trunk/NEWS.ja.rdoc 2009-06-05 10:30:46 +09:00 (rev 400) +++ groonga/trunk/NEWS.ja.rdoc 2009-06-05 23:45:26 +09:00 (rev 401) @@ -1,5 +1,9 @@ = ???? +== 0.0.3: 2009-XX-XX + +* [#26145] Groonga::TableKeySupport#has_key???? [Tasuku SUENAGA] + == 0.0.2: 2009-06-04 * groonga 0.0.8?? [mori] Modified: groonga/trunk/test/test-patricia-trie.rb (+7 -0) =================================================================== --- groonga/trunk/test/test-patricia-trie.rb 2009-06-05 10:30:46 +09:00 (rev 400) +++ groonga/trunk/test/test-patricia-trie.rb 2009-06-05 23:45:26 +09:00 (rev 401) @@ -79,4 +79,11 @@ users_opened.add("morita") assert_equal(1, users_created.size) end + + def test_has_key? + users = Groonga::PatriciaTrie.create(:name => "") + assert_false(users.has_key?("morita")) + users.add("morita") + assert_true(users.has_key?("morita")) + end end Modified: groonga/trunk/test/test-hash.rb (+7 -0) =================================================================== --- groonga/trunk/test/test-hash.rb 2009-06-05 10:30:46 +09:00 (rev 400) +++ groonga/trunk/test/test-hash.rb 2009-06-05 23:45:26 +09:00 (rev 401) @@ -191,4 +191,11 @@ users_opened.add("morita") assert_equal(1, users_created.size) end + + def test_has_key? + users = Groonga::Hash.create(:name => "") + assert_false(users.has_key?("morita")) + users.add("morita") + assert_true(users.has_key?("morita")) + end end From null at cozmixng.org Sat Jun 6 00:00:33 2009 From: null at cozmixng.org (null at cozmixng.org) Date: Sat, 06 Jun 2009 13:00:33 +0900 Subject: [groonga-commit:383] groonga [groonga (trunk) r402] * fix format. Message-ID: <20090606040033.7CFE31D1C91@mail.cozmixng.org> retro 2009-06-06 13:00:32 +0900 (Sat, 06 Jun 2009) New Revision: 402 Modified files: groonga/trunk/NEWS.ja.rdoc groonga/trunk/NEWS.rdoc Log: * fix format. Modified: groonga/trunk/NEWS.rdoc (+2 -2) =================================================================== --- groonga/trunk/NEWS.rdoc 2009-06-05 23:37:13 +09:00 (rev 401) +++ groonga/trunk/NEWS.rdoc 2009-06-06 13:00:32 +09:00 (rev 402) @@ -8,8 +8,8 @@ * Added documents * Supported Ruby 1.9 * Bug fixes: -** Fixed install process [Tasuku SUENAGA] -** Fixed memory leaks + * Fixed install process [Tasuku SUENAGA] + * Fixed memory leaks == 0.0.1: 2009-04-30 Modified: groonga/trunk/NEWS.ja.rdoc (+2 -2) =================================================================== --- groonga/trunk/NEWS.ja.rdoc 2009-06-05 23:37:13 +09:00 (rev 401) +++ groonga/trunk/NEWS.ja.rdoc 2009-06-06 13:00:32 +09:00 (rev 402) @@ -12,8 +12,8 @@ * ????????? * Ruby 1.9?? * ????: -** ??????????? [Tasuku SUENAGA] -** ???????? + * ??????????? [Tasuku SUENAGA] + * ???????? == 0.0.1: 2009-04-30 From null at cozmixng.org Sat Jun 6 06:45:44 2009 From: null at cozmixng.org (null at cozmixng.org) Date: Sat, 06 Jun 2009 19:45:44 +0900 Subject: [groonga-commit:384] groonga [groonga (trunk) r403] * fix format. Message-ID: <20090606104544.7A0611D1C8B@mail.cozmixng.org> retro 2009-06-06 19:45:43 +0900 (Sat, 06 Jun 2009) New Revision: 403 Modified files: groonga/trunk/TUTORIAL.ja.rdoc Log: * fix format. Modified: groonga/trunk/TUTORIAL.ja.rdoc (+3 -3) =================================================================== --- groonga/trunk/TUTORIAL.ja.rdoc 2009-06-06 12:45:47 +09:00 (rev 402) +++ groonga/trunk/TUTORIAL.ja.rdoc 2009-06-06 19:45:43 +09:00 (rev 403) @@ -261,9 +261,9 @@ +add_bookmark+?????????????????? - * ?????????????????????????? - * ?????????????? - * ??????????????? +* ?????????????????????????? +* ?????????????? +* ??????????????? ?????????????????????????????? ????? From null at cozmixng.org Sat Jun 6 06:45:46 2009 From: null at cozmixng.org (null at cozmixng.org) Date: Sat, 06 Jun 2009 19:45:46 +0900 Subject: [groonga-commit:385] groonga [groonga (trunk) r404] * omit inspection. Message-ID: <20090606104547.028681D1C8E@mail.cozmixng.org> retro 2009-06-06 19:45:45 +0900 (Sat, 06 Jun 2009) New Revision: 404 Modified files: groonga/trunk/TUTORIAL.ja.rdoc Log: * omit inspection. Modified: groonga/trunk/TUTORIAL.ja.rdoc (+2 -2) =================================================================== --- groonga/trunk/TUTORIAL.ja.rdoc 2009-06-06 19:38:28 +09:00 (rev 403) +++ groonga/trunk/TUTORIAL.ja.rdoc 2009-06-06 19:45:45 +09:00 (rev 404) @@ -28,7 +28,7 @@ ??????????????????????????? >> Groonga::Database.create(:path => "/tmp/bookmark.db") - => #, name: (anonymous), path: , domain: , range: > + => # ?????????????????????????????? ?????????????????????????????? @@ -54,7 +54,7 @@ ????????? >> items = Groonga::Hash.create(:name => "", :persistent => true) - => #, name: <>, path: , domain: , range: , encoding: <:utf8>, size: <0>> + => # ?????????????????????? From null at cozmixng.org Sat Jun 6 06:45:49 2009 From: null at cozmixng.org (null at cozmixng.org) Date: Sat, 06 Jun 2009 19:45:49 +0900 Subject: [groonga-commit:386] groonga [groonga (trunk) r405] * Groonga::Record#[] raises an exception for nonexistent Message-ID: <20090606104550.1E48D1D1C92@mail.cozmixng.org> retro 2009-06-06 19:45:49 +0900 (Sat, 06 Jun 2009) New Revision: 405 Modified files: groonga/trunk/lib/groonga/record.rb groonga/trunk/test/test-record.rb Log: * Groonga::Record#[] raises an exception for nonexistent column name. [#26146] Suggested by Tasuku SUENAGA. Thanks!!! Modified: groonga/trunk/test/test-record.rb (+3 -1) =================================================================== --- groonga/trunk/test/test-record.rb 2009-06-06 19:39:10 +09:00 (rev 404) +++ groonga/trunk/test/test-record.rb 2009-06-06 19:45:49 +09:00 (rev 405) @@ -117,7 +117,9 @@ def test_get_nonexistent_column groonga = @bookmarks.add - assert_nil(groonga["nonexistent"]) + assert_raise(Groonga::Error) do + groonga["nonexistent"] + end end def test_set_nonexistent_column Modified: groonga/trunk/lib/groonga/record.rb (+1 -1) =================================================================== --- groonga/trunk/lib/groonga/record.rb 2009-06-06 19:39:10 +09:00 (rev 404) +++ groonga/trunk/lib/groonga/record.rb 2009-06-06 19:45:49 +09:00 (rev 405) @@ -34,7 +34,7 @@ end def [](column_name) - (column(column_name) || {})[@id] + column(column_name, true)[@id] end def []=(column_name, value) From null at cozmixng.org Mon Jun 8 21:45:45 2009 From: null at cozmixng.org (null at cozmixng.org) Date: Tue, 09 Jun 2009 10:45:45 +0900 Subject: [groonga-commit:387] groonga [groonga (trunk) r406] * update to the latest ActiveGrooga. Message-ID: <20090609014545.4506D1D1C74@mail.cozmixng.org> retro 2009-06-09 10:45:44 +0900 (Tue, 09 Jun 2009) New Revision: 406 Modified files: groonga/trunk/html/index.html Log: * update to the latest ActiveGrooga. Modified: groonga/trunk/html/index.html (+1 -1) =================================================================== --- groonga/trunk/html/index.html 2009-06-06 19:44:16 +09:00 (rev 405) +++ groonga/trunk/html/index.html 2009-06-09 10:45:44 +09:00 (rev 406) @@ -79,7 +79,7 @@

ActiveGroonga???????

- 2009-04-30????????0.0.1?????? + 2009-06-05????????0.0.2??????

ActiveGroonga???????

From null at cozmixng.org Mon Jun 8 22:00:33 2009 From: null at cozmixng.org (null at cozmixng.org) Date: Tue, 09 Jun 2009 11:00:33 +0900 Subject: [groonga-commit:388] groonga [groonga (trunk) r407] * guard database from GC until context is alive. Message-ID: <20090609020033.BFD1F1D1C88@mail.cozmixng.org> retro 2009-06-09 11:00:33 +0900 (Tue, 09 Jun 2009) New Revision: 407 Modified files: groonga/trunk/ext/rb-grn-database.c Log: * guard database from GC until context is alive. Modified: groonga/trunk/ext/rb-grn-database.c (+32 -2) =================================================================== --- groonga/trunk/ext/rb-grn-database.c 2009-06-09 10:32:52 +09:00 (rev 406) +++ groonga/trunk/ext/rb-grn-database.c 2009-06-09 11:00:33 +09:00 (rev 407) @@ -51,7 +51,28 @@ } /* + * Document-method: close + * * call-seq: + * database.close + * + * _database_?????????????????????_database_? + * ?????????? + */ +static VALUE +rb_grn_database_close (VALUE self) +{ + VALUE rb_context; + + rb_context = rb_iv_get(self, "context"); + if (!NIL_P(rb_context)) + rb_iv_set(rb_context, "database", Qnil); + + return rb_grn_object_close(self); +} + +/* + * call-seq: * Groonga::Database.create(options=nil) -> Groonga::Database * * ??????????????? @@ -106,11 +127,13 @@ rb_grn_object_assign(rb_database, rb_context, context, database, RB_GRN_TRUE); rb_iv_set(rb_database, "context", rb_context); + if (!NIL_P(rb_context)) + rb_iv_set(rb_context, "database", rb_database); rb_grn_context_check(context, rb_ary_new4(argc, argv)); if (rb_block_given_p()) return rb_ensure(rb_yield, rb_database, - rb_grn_object_close, rb_database); + rb_grn_database_close, rb_database); else return rb_database; } @@ -152,6 +175,10 @@ rb_grn_object_assign(self, rb_context, context, database, RB_GRN_TRUE); rb_grn_context_check(context, self); + rb_iv_set(self, "context", rb_context); + if (!NIL_P(rb_context)) + rb_iv_set(rb_context, "database", self); + return Qnil; } @@ -179,7 +206,7 @@ database = rb_grn_object_alloc(klass); rb_grn_database_initialize(argc, argv, database); if (rb_block_given_p()) - return rb_ensure(rb_yield, database, rb_grn_object_close, database); + return rb_ensure(rb_yield, database, rb_grn_database_close, database); else return database; } @@ -239,4 +266,7 @@ rb_define_method(rb_cGrnDatabase, "each", rb_grn_database_each, 0); + + rb_define_method(rb_cGrnDatabase, "close", + rb_grn_database_close, 0); } From null at cozmixng.org Fri Jun 12 08:51:14 2009 From: null at cozmixng.org (null at cozmixng.org) Date: Fri, 12 Jun 2009 21:51:14 +0900 Subject: [groonga-commit:389] groonga [groonga (trunk) r408] * fix typos. Message-ID: <20090612125114.623F11D1C79@mail.cozmixng.org> retro 2009-06-12 21:51:13 +0900 (Fri, 12 Jun 2009) New Revision: 408 Log: * fix typos. Reported by Tasuku SUENAGA. Thanks!!! Modified files: groonga/trunk/TUTORIAL.ja.rdoc Modified: groonga/trunk/TUTORIAL.ja.rdoc (+5 -5) =================================================================== --- groonga/trunk/TUTORIAL.ja.rdoc 2009-06-09 10:46:08 +09:00 (rev 407) +++ groonga/trunk/TUTORIAL.ja.rdoc 2009-06-12 21:51:13 +09:00 (rev 408) @@ -93,7 +93,7 @@ ???????+title+???????????????? - >> title_colum = items.define_column("title", "", :persistent => true) + >> title_column = items.define_column("title", "", :persistent => true) => # 2??????????????????????????? @@ -125,9 +125,9 @@ ?????????????????????? ??+title+???????????????????? - >> terms.define_index_column("item_title", items, - :persistent => true, - :source => ".title") + >> title_index_column = terms.define_index_column("item_title", items, + :persistent => true, + :source => ".title") => # ?????????????????????? @@ -155,7 +155,7 @@ ???????????????????? - >> title_index_column.saerch("Ruby").collect {|record| record.key.key} + >> title_index_column.search("Ruby").collect {|record| record.key.key} ["http://ja.wikipedia.org/wiki/Ruby", "http://www.ruby-lang.org/"] ?????Groonga::Hash??????????????????? From null at cozmixng.org Sun Jun 21 22:00:41 2009 From: null at cozmixng.org (null at cozmixng.org) Date: Mon, 22 Jun 2009 11:00:41 +0900 Subject: [groonga-commit:390] groonga [groonga (trunk) r409] * Fixed typo. Message-ID: <20090622020041.21AF21D1C1C@mail.cozmixng.org> retro 2009-06-22 11:00:40 +0900 (Mon, 22 Jun 2009) New Revision: 409 Log: * Fixed typo. Modified files: groonga/trunk/ext/rb-grn-table-cursor.c Modified: groonga/trunk/ext/rb-grn-table-cursor.c (+1 -1) =================================================================== --- groonga/trunk/ext/rb-grn-table-cursor.c 2009-06-12 21:35:50 +09:00 (rev 408) +++ groonga/trunk/ext/rb-grn-table-cursor.c 2009-06-22 11:00:40 +09:00 (rev 409) @@ -259,7 +259,7 @@ void rb_grn_init_table_cursor (VALUE mGrn) { - rb_cGrnTableCursor = rb_define_class_under(mGrn, "TableCurosr", rb_cObject); + rb_cGrnTableCursor = rb_define_class_under(mGrn, "TableCursor", rb_cObject); rb_define_alloc_func(rb_cGrnTableCursor, rb_grn_table_cursor_alloc); rb_include_module(rb_cGrnTableCursor, rb_mEnumerable); From null at cozmixng.org Sun Jun 28 20:50:45 2009 From: null at cozmixng.org (null at cozmixng.org) Date: Mon, 29 Jun 2009 09:50:45 +0900 Subject: [groonga-commit:391] groonga [groonga (trunk) r410] * fix wrong key type on 32bit environment. Message-ID: <20090629005045.6F7631D1C1C@mail.cozmixng.org> retro 2009-06-29 09:50:44 +0900 (Mon, 29 Jun 2009) New Revision: 410 Log: * fix wrong key type on 32bit environment. Reported by niku. Thanks!!! Modified files: groonga/trunk/README.ja.rdoc groonga/trunk/README.rdoc groonga/trunk/ext/rb-grn-context.c Modified: groonga/trunk/README.ja.rdoc (+2 -0) =================================================================== --- groonga/trunk/README.ja.rdoc 2009-06-22 10:49:21 +09:00 (rev 409) +++ groonga/trunk/README.ja.rdoc 2009-06-29 09:50:44 +09:00 (rev 410) @@ -52,3 +52,5 @@ * ???: ??groonga???????????? * ??????: ?????????????? +* ????: ?????????????? + Modified: groonga/trunk/ext/rb-grn-context.c (+9 -2) =================================================================== --- groonga/trunk/ext/rb-grn-context.c 2009-06-22 10:49:21 +09:00 (rev 409) +++ groonga/trunk/ext/rb-grn-context.c 2009-06-29 09:50:44 +09:00 (rev 410) @@ -69,14 +69,21 @@ objects = grn_ctx_get(context, OBJECTS_TABLE_NAME, strlen(OBJECTS_TABLE_NAME)); - if (!objects) + if (!objects) { + grn_obj *key_type; + + if (sizeof(RbGrnObject *) == 4) + key_type = grn_ctx_at(context, GRN_DB_UINT32); + else + key_type = grn_ctx_at(context, GRN_DB_UINT64); objects = grn_table_create(context, OBJECTS_TABLE_NAME, strlen(OBJECTS_TABLE_NAME), NULL, GRN_OBJ_TABLE_HASH_KEY, - grn_ctx_at(context, GRN_DB_UINT64), + key_type, 0); + } grn_table_add(context, objects, &object, sizeof(RbGrnObject *), Modified: groonga/trunk/README.rdoc (+1 -0) =================================================================== --- groonga/trunk/README.rdoc 2009-06-22 10:49:21 +09:00 (rev 409) +++ groonga/trunk/README.rdoc 2009-06-29 09:50:44 +09:00 (rev 410) @@ -53,3 +53,4 @@ * mori: sent patches to support the latest groonga. * Tasuku SUENAGA: sent bug reports. +* niku: sent bug reports. From null at cozmixng.org Tue Jun 30 07:50:31 2009 From: null at cozmixng.org (null at cozmixng.org) Date: Tue, 30 Jun 2009 20:50:31 +0900 Subject: [groonga-commit:392] groonga [groonga (trunk) r411] * add a test for N-gram index search. Message-ID: <20090630115031.7F5E81D1C1C@mail.cozmixng.org> retro 2009-06-30 20:50:31 +0900 (Tue, 30 Jun 2009) New Revision: 411 Log: * add a test for N-gram index search. Patch by dara. Thanks!!! Modified files: groonga/trunk/README.ja.rdoc groonga/trunk/README.rdoc groonga/trunk/test/test-index-column.rb Modified: groonga/trunk/README.ja.rdoc (+1 -1) =================================================================== --- groonga/trunk/README.ja.rdoc 2009-06-29 09:45:59 +09:00 (rev 410) +++ groonga/trunk/README.ja.rdoc 2009-06-30 20:50:31 +09:00 (rev 411) @@ -53,4 +53,4 @@ * ???: ??groonga???????????? * ??????: ?????????????? * ????: ?????????????? - +* dara??: ????????????? Modified: groonga/trunk/test/test-index-column.rb (+24 -0) =================================================================== --- groonga/trunk/test/test-index-column.rb 2009-06-29 09:45:59 +09:00 (rev 410) +++ groonga/trunk/test/test-index-column.rb 2009-06-30 20:50:31 +09:00 (rev 411) @@ -54,4 +54,28 @@ assert_equal([groonga], content_index.search("????").collect {|record| record.key}) end + + def test_shorter_query_than_ngram + articles = Groonga::Array.create(:name => "") + articles.define_column("content", "") + + terms = Groonga::PatriciaTrie.create(:name => "", + :default_tokenizer => "") + content_index = terms.define_index_column("content", articles, + :source => ".content") + articles.add(:content => 'l') + articles.add(:content => 'll') + articles.add(:content => 'hello') + + assert_search(["hello"], content_index, "he") + assert_search(["ll", "hello"], content_index, "ll") + assert_search(["l", "ll", "hello"], content_index, "l") + end + + def assert_search(expected, content_index, keyword) + result = content_index.search(keyword).collect do |entry| + entry.key["content"] + end + assert_equal(expected, result) + end end Modified: groonga/trunk/README.rdoc (+1 -0) =================================================================== --- groonga/trunk/README.rdoc 2009-06-29 09:45:59 +09:00 (rev 410) +++ groonga/trunk/README.rdoc 2009-06-30 20:50:31 +09:00 (rev 411) @@ -54,3 +54,4 @@ * mori: sent patches to support the latest groonga. * Tasuku SUENAGA: sent bug reports. * niku: sent bug reports. +* dara: wrote tests. From null at cozmixng.org Tue Jun 30 07:50:33 2009 From: null at cozmixng.org (null at cozmixng.org) Date: Tue, 30 Jun 2009 20:50:33 +0900 Subject: [groonga-commit:393] groonga [groonga (trunk) r412] * remove needless object names. Message-ID: <20090630115033.135A91D1C7A@mail.cozmixng.org> retro 2009-06-30 20:50:32 +0900 (Tue, 30 Jun 2009) New Revision: 412 Log: * remove needless object names. Reported by dara. Thanks!!! Modified files: groonga/trunk/test/test-database.rb Modified: groonga/trunk/test/test-database.rb (+0 -4) =================================================================== --- groonga/trunk/test/test-database.rb 2009-06-30 20:36:37 +09:00 (rev 411) +++ groonga/trunk/test/test-database.rb 2009-06-30 20:50:32 +09:00 (rev 412) @@ -67,10 +67,6 @@ "", "", "", - "", - "", - "", - "", "", "", "",