Kouhei Sutou
null+****@clear*****
Wed Jan 13 17:23:02 JST 2016
Kouhei Sutou 2015-03-11 12:17:08 +0900 (Wed, 11 Mar 2015) New Revision: b5a6fcd0353b349330b83bb390bdfe70b4aca0b1 https://github.com/groonga/groonga-command/commit/b5a6fcd0353b349330b83bb390bdfe70b4aca0b1 Message: Support plugin_unregister Added files: lib/groonga/command/plugin-unregister.rb test/command/test-plugin-unregister.rb Modified files: lib/groonga/command.rb Modified: lib/groonga/command.rb (+1 -0) =================================================================== --- lib/groonga/command.rb 2015-02-13 16:56:36 +0900 (ad1a0e9) +++ lib/groonga/command.rb 2015-03-11 12:17:08 +0900 (6121a56) @@ -31,6 +31,7 @@ require "groonga/command/load" require "groonga/command/logical-count" require "groonga/command/logical-range-filter" require "groonga/command/normalize" +require "groonga/command/plugin-unregister" require "groonga/command/range-filter" require "groonga/command/register" require "groonga/command/request-cancel" Added: lib/groonga/command/plugin-unregister.rb (+43 -0) 100644 =================================================================== --- /dev/null +++ lib/groonga/command/plugin-unregister.rb 2015-03-11 12:17:08 +0900 (32e0b63) @@ -0,0 +1,43 @@ +# Copyright (C) 2015 Kouhei Sutou <kou �� clear-code.com> +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +require "groonga/command/base" + +module Groonga + module Command + # A command class that represents `plugin_unregister` command. + # + # @since 1.1.2 + class PluginUnregister < Base + Command.register("plugin_unregister", self) + + class << self + def parameter_names + [ + :name, + ] + end + end + + # @return [String] `name` parameter value. + # + # @since 1.1.2 + def name + self[:name] + end + end + end +end Added: test/command/test-plugin-unregister.rb (+46 -0) 100644 =================================================================== --- /dev/null +++ test/command/test-plugin-unregister.rb 2015-03-11 12:17:08 +0900 (8abbb51) @@ -0,0 +1,46 @@ +# Copyright (C) 2015 Kouhei Sutou <kou �� clear-code.com> +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +class PluginUnregisterCommandTest < Test::Unit::TestCase + private + def plugin_unregister_command(pair_arguments={}, ordered_arguments=[]) + Groonga::Command::PluginUnregister.new("plugin_unregister", + pair_arguments, + ordered_arguments) + end + + class ConstructorTest < self + def test_ordered_arguments + name = "query_expanders/tsv" + + ordered_arguments = [ + name, + ] + command = plugin_unregister_command({}, ordered_arguments) + assert_equal({ + :name => name, + }, + command.arguments) + end + end + + class NameTest < self + def test_reader + command = plugin_unregister_command(:name => "query_expanders/tsv") + assert_equal("query_expanders/tsv", command.name) + end + end +end -------------- next part -------------- HTML����������������������������...Download