[Groonga-commit] ranguba/groonga-client at dbb1862 [master] Fix connection error when default options don't exist

Back to archive index

Kouhei Sutou null+****@clear*****
Mon Dec 12 12:22:38 JST 2016


Kouhei Sutou	2016-12-12 12:22:38 +0900 (Mon, 12 Dec 2016)

  New Revision: dbb1862423848d1679e8857cbc1aca03b5fd83cf
  https://github.com/ranguba/groonga-client/commit/dbb1862423848d1679e8857cbc1aca03b5fd83cf

  Message:
    Fix connection error when default options don't exist

  Modified files:
    lib/groonga/client/test/groonga-server-runner.rb

  Modified: lib/groonga/client/test/groonga-server-runner.rb (+5 -3)
===================================================================
--- lib/groonga/client/test/groonga-server-runner.rb    2016-12-12 11:37:26 +0900 (8a45f09)
+++ lib/groonga/client/test/groonga-server-runner.rb    2016-12-12 12:22:38 +0900 (123e36c)
@@ -49,7 +49,7 @@ module Groonga
 
         def stop
           if @using_running_server
-            Groonga::Client.open do |client|
+            Groonga::Client.open(url: @url) do |client|
               schema = client.schema
               schema.tables.each do |name, _|
                 client.delete(table: name,
@@ -58,7 +58,7 @@ module Groonga
             end
           else
             if @pid
-              Groonga::Client.open do |client|
+              Groonga::Client.open(url: @url) do |client|
                 client.shutdown
               end
               wait_groonga_shutdown
@@ -74,7 +74,9 @@ module Groonga
           default_options = Groonga::Client.default_options
           url = default_options[:url]
           if url.nil?
-            host = default_options[:host] || default_options[:address]
+            host = default_options[:host] ||
+              default_options[:address] ||
+              "127.0.0.1"
             port = default_options[:port] || 10041
             path = default_options[:path]
             url = URI("http://#{host}:#{port}#{path}")
-------------- next part --------------
HTML����������������������������...
Download 



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