YUKI Hiroshi
null+****@clear*****
Fri Jan 24 13:55:58 JST 2014
YUKI Hiroshi 2014-01-24 13:55:58 +0900 (Fri, 24 Jan 2014) New Revision: 67e3efcc7353ff76824a48df31a3ae37cfde55c9 https://github.com/droonga/fluent-plugin-droonga/commit/67e3efcc7353ff76824a48df31a3ae37cfde55c9 Message: Add input and output adapter for CURD operations Added files: lib/droonga/plugin/input_adapter/crud.rb lib/droonga/plugin/output_adapter/crud.rb Modified files: test/command/config/default/catalog.json Added: lib/droonga/plugin/input_adapter/crud.rb (+27 -0) 100644 =================================================================== --- /dev/null +++ lib/droonga/plugin/input_adapter/crud.rb 2014-01-24 13:55:58 +0900 (9b44c72) @@ -0,0 +1,27 @@ +# Copyright (C) 2014 Droonga Project +# +# 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 + +require "droonga/input_adapter_plugin" + +module Droonga + class CRUDInputAdapter < Droonga::InputAdapterPlugin + repository.register("add", self) + + command :add + def add(input_message) + input_message.add_route("crud_generic_response") + end + end +end Added: lib/droonga/plugin/output_adapter/crud.rb (+27 -0) 100644 =================================================================== --- /dev/null +++ lib/droonga/plugin/output_adapter/crud.rb 2014-01-24 13:55:58 +0900 (1bc5458) @@ -0,0 +1,27 @@ +# Copyright (C) 2013-2014 Droonga Project +# +# 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 + +require "droonga/output_adapter_plugin" + +module Droonga + class CRUDOutputAdapter < Droonga::OutputAdapterPlugin + repository.register("crud", self) + + command :crud_generic_response + def crud_generic_response(output_message) + output_message.body = output_message.body["success"] + end + end +end Modified: test/command/config/default/catalog.json (+1 -1) =================================================================== --- test/command/config/default/catalog.json 2014-01-24 13:43:24 +0900 (a1415aa) +++ test/command/config/default/catalog.json 2014-01-24 13:55:58 +0900 (d4d6c68) @@ -56,6 +56,6 @@ } }, "options": { - "plugins": ["groonga"] + "plugins": ["crud", "groonga"] } } -------------- next part -------------- HTML����������������������������...Download