null+****@clear*****
null+****@clear*****
2012年 6月 6日 (水) 17:16:55 JST
Haruka Yoshihara 2012-06-06 17:16:55 +0900 (Wed, 06 Jun 2012) New Revision: 2cfa9326192802e298cabb080f8edcbb66f64eff Log: Use send_command for load Modified files: lib/groonga/tester.rb Modified: lib/groonga/tester.rb (+7 -15) =================================================================== --- lib/groonga/tester.rb 2012-06-06 17:16:08 +0900 (172721c) +++ lib/groonga/tester.rb 2012-06-06 17:16:55 +0900 (585bc73) @@ -511,20 +511,12 @@ module Groonga private def execute_line_on_loading(line) - if @pending_load_command - log_input(@pending_load_command) - @input.print(@pending_load_command) - @pending_load_command = nil - end log_input(line) - @input.print(line) - @input.flush - if /\]$/ =~ line - current_result = read_output - unless current_result.empty? - @loading = false - log_output(current_result) - end + @pending_load_command << line + if line == "]\n" + log_output(send_command(@pending_load_command)) + @pending_load_command = nil + @loading = false end end @@ -599,11 +591,11 @@ module Groonga def execute_command(line) extract_command_info(line) + log_input(line) if @current_command == "load" @loading = true - @pending_load_command = line + @pending_load_command = line.dup else - log_input(line) log_output(send_command(line)) end end