Kouhei Sutou
null+****@clear*****
Wed Jan 13 17:23:20 JST 2016
Kouhei Sutou 2015-08-06 20:59:41 +0900 (Thu, 06 Aug 2015) New Revision: 97149de8f542adc638d92d11e5d9e63dbf7542f6 https://github.com/groonga/groonga-command/commit/97149de8f542adc638d92d11e5d9e63dbf7542f6 Message: Support logical_shard_list Added files: lib/groonga/command/logical-shard-list.rb test/command/test-logical-shard-list.rb Modified files: lib/groonga/command.rb Modified: lib/groonga/command.rb (+1 -0) =================================================================== --- lib/groonga/command.rb 2015-07-28 10:55:51 +0900 (60527f9) +++ lib/groonga/command.rb 2015-08-06 20:59:41 +0900 (aacd2f3) @@ -32,6 +32,7 @@ require "groonga/command/load" require "groonga/command/logical-count" require "groonga/command/logical-range-filter" require "groonga/command/logical-select" +require "groonga/command/logical-shard-list" require "groonga/command/logical-table-remove" require "groonga/command/log-level" require "groonga/command/log-put" Added: lib/groonga/command/logical-shard-list.rb (+43 -0) 100644 =================================================================== --- /dev/null +++ lib/groonga/command/logical-shard-list.rb 2015-08-06 20:59:41 +0900 (6825d11) @@ -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 `logical_shard_list` command. + # + # @since 1.1.3 + class LogicalShardList < Base + Command.register("logical_shard_list", self) + + class << self + def parameter_names + [ + :logical_table, + ] + end + end + + # @return [String] `logical_table` parameter value. + # + # @since 1.1.3 + def logical_table + self[:logical_table] + end + end + end +end Added: test/command/test-logical-shard-list.rb (+46 -0) 100644 =================================================================== --- /dev/null +++ test/command/test-logical-shard-list.rb 2015-08-06 20:59:41 +0900 (09b38f2) @@ -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 LogicalShardListCommandTest < Test::Unit::TestCase + private + def logical_shard_list_command(pair_arguments={}, ordered_arguments=[]) + Groonga::Command::LogicalShardList.new("logical_shard_list", + pair_arguments, + ordered_arguments) + end + + class ConstructorTest < self + def test_ordered_arguments + logical_table = "Logs" + + ordered_arguments = [ + logical_table, + ] + command = logical_shard_list_command({}, ordered_arguments) + assert_equal({ + :logical_table => logical_table, + }, + command.arguments) + end + end + + class LogicalTableTest < self + def test_reader + command = logical_shard_list_command(:logical_table => "Logs") + assert_equal("Logs", command.logical_table) + end + end +end -------------- next part -------------- HTML����������������������������...Download