[Groonga-commit] groonga/groonga-command at 5947f00 [master] Support table_list

Back to archive index

Kouhei Sutou null+****@clear*****
Fri Jul 24 15:45:29 JST 2015


Kouhei Sutou	2015-07-24 15:45:29 +0900 (Fri, 24 Jul 2015)

  New Revision: 5947f008fe8e125a61c2573f931e8668d93fc16e
  https://github.com/groonga/groonga-command/commit/5947f008fe8e125a61c2573f931e8668d93fc16e

  Message:
    Support table_list

  Added files:
    lib/groonga/command/table-list.rb
    test/command/test-table-list.rb
  Modified files:
    lib/groonga/command.rb

  Modified: lib/groonga/command.rb (+1 -0)
===================================================================
--- lib/groonga/command.rb    2015-06-16 17:24:24 +0900 (b1670fa)
+++ lib/groonga/command.rb    2015-07-24 15:45:29 +0900 (dad51d7)
@@ -45,6 +45,7 @@ require "groonga/command/select"
 require "groonga/command/status"
 require "groonga/command/suggest"
 require "groonga/command/table-create"
+require "groonga/command/table-list"
 require "groonga/command/table-remove"
 require "groonga/command/table-rename"
 require "groonga/command/table-tokenize"

  Added: lib/groonga/command/table-list.rb (+43 -0) 100644
===================================================================
--- /dev/null
+++ lib/groonga/command/table-list.rb    2015-07-24 15:45:29 +0900 (d81ee95)
@@ -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 `table_list` command.
+    #
+    # @since 1.1.3
+    class TableList < Base
+      Command.register("table_list", self)
+
+      class << self
+        def parameter_names
+          [
+            :prefix,
+          ]
+        end
+      end
+
+      # @return [String] `prefix` parameter value.
+      #
+      # @since 1.1.3
+      def prefix
+        self[:prefix]
+      end
+    end
+  end
+end

  Added: test/command/test-table-list.rb (+43 -0) 100644
===================================================================
--- /dev/null
+++ test/command/test-table-list.rb    2015-07-24 15:45:29 +0900 (171b37f)
@@ -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
+
+class TableListCommandTest < Test::Unit::TestCase
+  private
+  def table_list_command(pair_arguments={}, ordered_arguments=[])
+    Groonga::Command::TableList.new("table_list",
+                                    pair_arguments,
+                                    ordered_arguments)
+  end
+
+  class ConstructorTest < self
+    def test_ordered_arguments
+      prefix = "Logs_2015"
+
+      command = table_list_command({}, [prefix])
+      assert_equal({
+                     :prefix => prefix,
+                   },
+                   command.arguments)
+    end
+  end
+
+  class PrefixTest < self
+    def test_reader
+      command = table_list_command(:prefix => "Logs_2015")
+      assert_equal("Logs_2015", command.prefix)
+    end
+  end
+end
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index