[Groonga-commit] groonga/groonga-command at da4eea5 [fix-travis-ci-error] Add column_remove

Back to archive index

Kouhei Sutou null+****@clear*****
Wed Jan 13 17:18:22 JST 2016


Kouhei Sutou	2012-11-25 19:34:27 +0900 (Sun, 25 Nov 2012)

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

  Message:
    Add column_remove

  Added files:
    lib/groonga/command/column-remove.rb
    test/command/test-column-remove.rb
  Modified files:
    lib/groonga/command/parser.rb

  Added: lib/groonga/command/column-remove.rb (+36 -0) 100644
===================================================================
--- /dev/null
+++ lib/groonga/command/column-remove.rb    2012-11-25 19:34:27 +0900 (ff7d1f8)
@@ -0,0 +1,36 @@
+# -*- coding: utf-8 -*-
+#
+# Copyright (C) 2012  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
+    class ColumnRemove < Base
+      Command.register("column_remove", self)
+
+      class << self
+        def parameter_names
+          [
+            :table,
+            :name,
+          ]
+        end
+      end
+    end
+  end
+end

  Modified: lib/groonga/command/parser.rb (+1 -0)
===================================================================
--- lib/groonga/command/parser.rb    2012-11-25 19:30:46 +0900 (5cb2786)
+++ lib/groonga/command/parser.rb    2012-11-25 19:34:27 +0900 (424d489)
@@ -25,6 +25,7 @@ require "groonga/command/table-create"
 require "groonga/command/table-remove"
 require "groonga/command/table-rename"
 require "groonga/command/column-create"
+require "groonga/command/column-remove"
 
 module Groonga
   module Command

  Added: test/command/test-column-remove.rb (+41 -0) 100644
===================================================================
--- /dev/null
+++ test/command/test-column-remove.rb    2012-11-25 19:34:27 +0900 (90a4b9a)
@@ -0,0 +1,41 @@
+# -*- coding: utf-8 -*-
+#
+# Copyright (C) 2012  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 ColumnRemoveCommandTest < Test::Unit::TestCase
+  class CommandLineTest < self
+    include GroongaCommandTestUtils::CommandLineCommandParser
+
+    def test_ordered_arguments
+      table = "Users"
+      name  = "age"
+
+      command = parse(table, name)
+      assert_instance_of(Groonga::Command::ColumnRemove, command)
+      assert_equal({
+                     :table => table,
+                     :name  => name,
+                   },
+                   command.arguments)
+    end
+
+    private
+    def parse(*arguments)
+      super("column_remove", arguments, :output_type => false)
+    end
+  end
+end
-------------- next part --------------
HTML����������������������������...
Download 



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