[Groonga-commit] groonga/groonga-command at e43e696 [fix-travis-ci-error] table_create: Parse flags with "|"

Back to archive index

Kosuke Asami null+****@clear*****
Wed Jan 13 17:20:04 JST 2016


Kosuke Asami	2013-07-11 14:54:51 +0900 (Thu, 11 Jul 2013)

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

  Message:
    table_create: Parse flags with "|"

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

  Modified: lib/groonga/command/table-create.rb (+4 -0)
===================================================================
--- lib/groonga/command/table-create.rb    2013-07-11 14:52:01 +0900 (90fcaac)
+++ lib/groonga/command/table-create.rb    2013-07-11 14:54:51 +0900 (872b2df)
@@ -34,6 +34,10 @@ module Groonga
           ]
         end
       end
+
+      def flags
+        @flags ||= (self[:flags] || "").split(/\s*\|\s*/)
+      end
     end
   end
 end

  Modified: test/command/test-table-create.rb (+6 -0)
===================================================================
--- test/command/test-table-create.rb    2013-07-11 14:52:01 +0900 (7c17e79)
+++ test/command/test-table-create.rb    2013-07-11 14:54:51 +0900 (a257d80)
@@ -39,6 +39,12 @@ class TableCreateCommandTest < Test::Unit::TestCase
                    command.arguments)
     end
 
+    def test_flags
+      command = parse({"flags" => "TABLE_PAT_KEY|KEY_WITH_SIS"})
+      assert_equal(["TABLE_PAT_KEY", "KEY_WITH_SIS"],
+                   command.flags)
+    end
+
     private
     def parse(arguments)
       super("table_create", arguments, :output_type => false)
-------------- next part --------------
HTML����������������������������...
Download 



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