[Groonga-commit] groonga/grntest at 22a099d [master] Remove needless current_command dependency

Back to archive index

Kouhei Sutou null+****@clear*****
Mon Mar 14 15:01:17 JST 2016


Kouhei Sutou	2016-03-14 15:01:17 +0900 (Mon, 14 Mar 2016)

  New Revision: 22a099da82f543b78193e21da4198281993f0796
  https://github.com/groonga/grntest/commit/22a099da82f543b78193e21da4198281993f0796

  Message:
    Remove needless current_command dependency

  Modified files:
    lib/grntest/executors/standard-io-executor.rb

  Modified: lib/grntest/executors/standard-io-executor.rb (+7 -7)
===================================================================
--- lib/grntest/executors/standard-io-executor.rb    2016-02-10 14:17:31 +0900 (347734f)
+++ lib/grntest/executors/standard-io-executor.rb    2016-03-14 15:01:17 +0900 (0858cac)
@@ -27,8 +27,8 @@ module Grntest
       end
 
       def send_command(command)
-        command_line = @current_command.original_source
-        unless @current_command.has_key?(:output_type)
+        command_line = command.original_source
+        unless command.has_key?(:output_type)
           command_line = command_line.sub(/$/, " --output_type #{@output_type}")
         end
         begin
@@ -39,7 +39,7 @@ module Grntest
           message = "failed to write to groonga: <#{command_line}>: #{$!}"
           raise Error.new(message)
         end
-        read_output
+        read_output(command)
       end
 
       def ensure_groonga_ready
@@ -53,9 +53,9 @@ module Grntest
       end
 
       private
-      def read_output
+      def read_output(command)
         options = {}
-        options[:first_timeout] = @long_timeout if may_slow_command?
+        options[:first_timeout] = @long_timeout if may_slow_command?(command)
         read_all_readable_content(@output, options)
       end
 
@@ -65,8 +65,8 @@ module Grntest
         "plugin_register",
         "register",
       ]
-      def may_slow_command?
-        MAY_SLOW_COMMANDS.include?(@current_command.name)
+      def may_slow_command?(command)
+        MAY_SLOW_COMMANDS.include?(command.name)
       end
     end
   end
-------------- next part --------------
HTML����������������������������...
Download 



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