[Groonga-commit] groonga/grntest [master] Ensure close after URL open with block

Back to archive index

null+****@clear***** null+****@clear*****
2012年 6月 7日 (木) 14:36:14 JST


Haruka Yoshihara	2012-06-07 14:36:14 +0900 (Thu, 07 Jun 2012)

  New Revision: a91d1ec9afed36c46d31afa1bd979a40950f9cc4

  Log:
    Ensure close after URL open with block

  Modified files:
    lib/groonga/tester.rb

  Modified: lib/groonga/tester.rb (+3 -2)
===================================================================
--- lib/groonga/tester.rb    2012-06-07 14:17:40 +0900 (03a1774)
+++ lib/groonga/tester.rb    2012-06-07 14:36:14 +0900 (c33d230)
@@ -690,8 +690,9 @@ module Groonga
       def send_command(command_line)
         converter = CommandFormatConverter.new(command_line)
         url = "http://#{@host}:#{@port}#{converter.to_url}"
-        response_content = open(url).read
-        "#{response_content}\n"
+        open(url) do |response|
+          "#{response.read}\n"
+        end
       end
 
       def ensure_groonga_ready




Groonga-commit メーリングリストの案内
Back to archive index