groonga-client 0.3.6 → 0.3.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a6c355134e4059b95ea7d3746803c7f4341d9247
4
- data.tar.gz: 9c3ebae53243d5fa4cb0ab8395763db7e2e4bcfe
3
+ metadata.gz: 716963b0471224b408c7282c106abf6963eec5e3
4
+ data.tar.gz: dda03fa55b5f474b590f81bce1c3fad4761c0b72
5
5
  SHA512:
6
- metadata.gz: a91f6bd599929636c25aa63654c4a026b9d951b68c1f1ae25c6355fdfb2cef205ed76afe13af041e8eb895e7039a898cf8ea278b806b23c004447e9e1980bd2a
7
- data.tar.gz: 55997467909ceb21090d53379b9d70968c3b2bd79f9a590a9f93d41cb1cf873335718af0b84a2ca719b8bdbfcb653f9fdc59260d68c8f029034b66bd001a32f6
6
+ metadata.gz: 5d7ba9d303ce1da3aa3229d82d2af43d76ac4e663d5f6b17e2ffc72be7a385da2a715f4ce6423c3d127546e33b84605eb1d1e6f7eeed0b7b9cf9335fa21ae7be
7
+ data.tar.gz: acd4190d4b4e3f4e2b0bb72e9a69cc76eda467fa55fcd00289796b4a4c8ad5d0918af663acc9ba302666b6d4eb9b1ebad652280516629752fa351fd177f1b3cc
data/doc/text/news.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # NEWS
2
2
 
3
+ ## 0.3.7 - 2016-12-20
4
+
5
+ ### Improvements
6
+
7
+ * `Groonga::Client::Test::GroongaServerRunner`: Supported customizing Groonga server URL.
8
+
3
9
  ## 0.3.6 - 2016-12-20
4
10
 
5
11
  ### Improvements
@@ -26,7 +26,6 @@ module Groonga
26
26
  def initialize
27
27
  @pid = nil
28
28
  @using_running_server = false
29
- @url = build_url
30
29
  @groonga = find_groonga
31
30
  @tmp_dir = nil
32
31
  end
@@ -34,7 +33,7 @@ module Groonga
34
33
  def run
35
34
  if groonga_server_running?
36
35
  @using_running_server = true
37
- @dump = Groonga::Client.open(url: @url) do |client|
36
+ @dump = open_client do |client|
38
37
  client.dump.body
39
38
  end
40
39
  else
@@ -42,7 +41,7 @@ module Groonga
42
41
  @tmp_dir = create_tmp_dir
43
42
  db_path = @tmp_dir + "db"
44
43
  @pid = spawn(@groonga,
45
- "--port", @url.port.to_s,
44
+ "--port", url.port.to_s,
46
45
  "--log-path", (@tmp_dir + "groonga.log").to_s,
47
46
  "--query-log-path", (@tmp_dir + "query.log").to_s,
48
47
  "--protocol", "http",
@@ -54,13 +53,13 @@ module Groonga
54
53
 
55
54
  def stop
56
55
  if @using_running_server
57
- Groonga::Client.open(url: @url) do |client|
56
+ open_client do |client|
58
57
  remove_all(client)
59
58
  restore(client)
60
59
  end
61
60
  else
62
61
  if @pid
63
- Groonga::Client.open(url: @url) do |client|
62
+ open_client do |client|
64
63
  client.shutdown
65
64
  end
66
65
  wait_groonga_shutdown
@@ -75,7 +74,15 @@ module Groonga
75
74
  @using_running_server
76
75
  end
77
76
 
77
+ def url
78
+ @url ||= build_url
79
+ end
80
+
78
81
  private
82
+ def open_client(&block)
83
+ Client.open(url: url, &block)
84
+ end
85
+
79
86
  def build_url
80
87
  default_options = Groonga::Client.default_options
81
88
  url = default_options[:url]
@@ -92,7 +99,7 @@ module Groonga
92
99
 
93
100
  def groonga_server_running?
94
101
  begin
95
- TCPSocket.open(@url.host, @url.port) do
102
+ TCPSocket.open(url.host, url.port) do
96
103
  end
97
104
  rescue SystemCallError
98
105
  false
@@ -16,6 +16,6 @@
16
16
 
17
17
  module Groonga
18
18
  class Client
19
- VERSION = "0.3.6"
19
+ VERSION = "0.3.7"
20
20
  end
21
21
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: groonga-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.6
4
+ version: 0.3.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Haruka Yoshihara