gqtp 1.0.6 → 1.0.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
- SHA1:
3
- metadata.gz: a9646329d91fbafd50713cb36cd0a29805f955fc
4
- data.tar.gz: d4a1e5c555ee1463d29a4817d5232e05122b20fb
2
+ SHA256:
3
+ metadata.gz: 3ba8e20fcb3f77df785a6c699395d01d49d4767f3a3a3894fe50860486694421
4
+ data.tar.gz: 4f15bcae25e718c7d32101c413b4e1ddee4a5065e94953431178af031fbb50ae
5
5
  SHA512:
6
- metadata.gz: 4e97a85e004db92b0d58a9cb624ede027b1ba44d50547526bbec6e0605a96d721b04ad993129ec827959cc050fdad6723ffa0cafedf350cc70c1c1f4fef51646
7
- data.tar.gz: 3e6daac1d896ff3ca752bb55a479b6ec1aa7dd4603bc3a28745cd86bdedca95a988da795683e5947edb556326e24d5c5bb8663a4c904d5e0368376b55227549d
6
+ metadata.gz: d346db4216e041d24bce8151638be7d87374fc8372f3ee4708d588a755d423c481af2a5e76e1eba21964b9968839ca35137fc5b8e29d440acd23d4077a698c7a
7
+ data.tar.gz: 111c68b192add263c89a62e2c72ef90728a975ab0e0be8eb9e63250779c6384dc4bb2a940da42639c9837ca390f79ef44c636bc92370d59799b368b1c2c8d96d
data/README.md CHANGED
@@ -53,7 +53,7 @@ for high concurrency use.
53
53
 
54
54
  ## Dependencies
55
55
 
56
- * Ruby 1.9.3
56
+ * Ruby
57
57
 
58
58
  ## Mailing list
59
59
 
data/Rakefile CHANGED
@@ -32,7 +32,9 @@ end
32
32
  helper.install
33
33
  spec = helper.gemspec
34
34
 
35
- Packnga::DocumentTask.new(spec) do
35
+ Packnga::DocumentTask.new(spec) do |task|
36
+ task.original_language = "en"
37
+ task.translate_language = "ja"
36
38
  end
37
39
 
38
40
  Packnga::ReleaseTask.new(spec) do
@@ -1,5 +1,12 @@
1
1
  # News
2
2
 
3
+ ## 1.0.7: 2019-05-11
4
+
5
+ ### Improvements
6
+
7
+ * Added support for `Groonga::Client#close` after sending `shutdown`
8
+ or `close`.
9
+
3
10
  ## 1.0.6: 2014-03-25
4
11
 
5
12
  ### Improvements
@@ -27,12 +27,20 @@ module GQTP
27
27
  @options[:host] ||= @options[:address] || "127.0.0.1"
28
28
  @options[:port] ||= 10043
29
29
  @backend = create_backend
30
+ @close_requesting = false
30
31
  end
31
32
 
32
33
  def send(body, options={}, &block)
33
34
  header = options[:header] || Header.new
34
35
  header.size = body.bytesize
35
36
 
37
+ case body
38
+ when /\A(?:shutdown|quit)(?:\z|\s)/
39
+ @close_requesting = true
40
+ when /\A\/d\/(?:shutdown|quit)(?:\z|\?)/
41
+ @close_requesting = true
42
+ end
43
+
36
44
  if block_given?
37
45
  sequential_request = SequentialRequest.new
38
46
  write_request = @backend.write(header.pack, body) do
@@ -55,6 +63,10 @@ module GQTP
55
63
  parser << header
56
64
  read_body_request = @backend.read(parser.header.size) do |body|
57
65
  response_body = body
66
+ if @close_requesting
67
+ @backend.close
68
+ @backend = nil
69
+ end
58
70
  yield(parser.header, response_body) if block_given?
59
71
  end
60
72
  sequential_request << read_body_request
@@ -87,11 +99,12 @@ module GQTP
87
99
  def close
88
100
  sync = !block_given?
89
101
  sequential_request = SequentialRequest.new
90
- quit_request = send("quit", :header => header_for_close) do
91
- @backend.close
92
- yield if block_given?
102
+ if @backend
103
+ quit_request = send("quit", :header => header_for_close) do
104
+ yield if block_given?
105
+ end
106
+ sequential_request << quit_request
93
107
  end
94
- sequential_request << quit_request
95
108
 
96
109
  if sync
97
110
  sequential_request.wait
@@ -1,6 +1,6 @@
1
1
  # -*- coding: utf-8 -*-
2
2
  #
3
- # Copyright (C) 2012-2013 Kouhei Sutou <kou@clear-code.com>
3
+ # Copyright (C) 2012-2014 Kouhei Sutou <kou@clear-code.com>
4
4
  #
5
5
  # This library is free software; you can redistribute it and/or
6
6
  # modify it under the terms of the GNU Lesser General Public
@@ -17,5 +17,5 @@
17
17
  # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18
18
 
19
19
  module GQTP
20
- VERSION = "1.0.6"
20
+ VERSION = "1.0.7"
21
21
  end
metadata CHANGED
@@ -1,97 +1,97 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gqtp
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.6
4
+ version: 1.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kouhei Sutou
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-25 00:00:00.000000000 Z
11
+ date: 2019-05-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - '>='
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - '>='
24
+ - - ">="
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - '>='
38
+ - - ">="
39
39
  - !ruby/object:Gem::Version
40
40
  version: '0'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: test-unit
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: test-unit-notify
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - '>='
59
+ - - ">="
60
60
  - !ruby/object:Gem::Version
61
61
  version: '0'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - '>='
66
+ - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: packnga
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - '>='
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - '>='
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: redcarpet
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - '>='
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - '>='
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  description: |
@@ -105,32 +105,32 @@ executables:
105
105
  extensions: []
106
106
  extra_rdoc_files: []
107
107
  files:
108
+ - ".yardopts"
109
+ - Gemfile
108
110
  - README.md
109
111
  - Rakefile
110
- - Gemfile
112
+ - bin/gqtp-proxy
113
+ - doc/text/lgpl-2.1.txt
114
+ - doc/text/news.md
111
115
  - gqtp.gemspec
112
- - .yardopts
113
- - lib/gqtp/parser.rb
114
- - lib/gqtp/header.rb
115
- - lib/gqtp/error.rb
116
- - lib/gqtp/version.rb
117
- - lib/gqtp/proxy.rb
116
+ - lib/gqtp.rb
118
117
  - lib/gqtp/backend/coolio.rb
119
- - lib/gqtp/backend/thread.rb
120
- - lib/gqtp/backend/synchronous.rb
121
118
  - lib/gqtp/backend/eventmachine.rb
119
+ - lib/gqtp/backend/synchronous.rb
120
+ - lib/gqtp/backend/thread.rb
121
+ - lib/gqtp/client.rb
122
+ - lib/gqtp/error.rb
123
+ - lib/gqtp/header.rb
124
+ - lib/gqtp/parser.rb
125
+ - lib/gqtp/proxy.rb
122
126
  - lib/gqtp/sequential-request.rb
123
127
  - lib/gqtp/server.rb
124
- - lib/gqtp/client.rb
125
- - lib/gqtp.rb
126
- - doc/text/news.md
127
- - doc/text/lgpl-2.1.txt
128
+ - lib/gqtp/version.rb
128
129
  - test/run-test.rb
129
130
  - test/test-client.rb
131
+ - test/test-header.rb
130
132
  - test/test-parser.rb
131
133
  - test/test-proxy.rb
132
- - test/test-header.rb
133
- - bin/gqtp-proxy
134
134
  homepage: https://github.com/ranguba/gqtp
135
135
  licenses:
136
136
  - LGPLv2.1 or later
@@ -141,25 +141,24 @@ require_paths:
141
141
  - lib
142
142
  required_ruby_version: !ruby/object:Gem::Requirement
143
143
  requirements:
144
- - - '>='
144
+ - - ">="
145
145
  - !ruby/object:Gem::Version
146
146
  version: '0'
147
147
  required_rubygems_version: !ruby/object:Gem::Requirement
148
148
  requirements:
149
- - - '>='
149
+ - - ">="
150
150
  - !ruby/object:Gem::Version
151
151
  version: '0'
152
152
  requirements: []
153
153
  rubyforge_project:
154
- rubygems_version: 2.0.14
154
+ rubygems_version: 2.7.6.2
155
155
  signing_key:
156
156
  specification_version: 4
157
157
  summary: Gqtp gem is a [GQTP (Groonga Query Transfer Protocol)](http://groonga.org/docs/spec/gqtp.html)
158
158
  Ruby implementation.
159
159
  test_files:
160
- - test/run-test.rb
161
- - test/test-client.rb
162
- - test/test-parser.rb
163
160
  - test/test-proxy.rb
161
+ - test/test-parser.rb
162
+ - test/run-test.rb
164
163
  - test/test-header.rb
165
- has_rdoc:
164
+ - test/test-client.rb