groonga-client 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 79021775f495765006f1149ea3a2f0f868ab9bc7
4
+ data.tar.gz: 4a10ab8fe0a43a2809c8d58896ed00111ff35ddc
5
+ SHA512:
6
+ metadata.gz: 6679d3cf6ae43dfc72efb6cb90661707868c8aec1802605247e66879187335c88fe4961e89fdd4bd114f0f8000e177e9ff0139fc008482c880225a1fa0f03345
7
+ data.tar.gz: 3eae9baa5d090619b8fdb69eef2ec3a1eefaf162e7719d26cb7369e13c5a32290644b27cec975db4654c3e0cd9500c328504541852f7f151f451be94edc77287
data/doc/text/news.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # NEWS
2
2
 
3
+ ## 0.0.8 - 2014-05-12
4
+
5
+ ### Improvements
6
+
7
+ * HTTP, Thread: Supported "bad request" response.
8
+ * HTTP, Thread: Supported JSON body in "internal server error" response.
9
+
3
10
  ## 0.0.7 - 2014-03-28
4
11
 
5
12
  ### Improvements
@@ -15,7 +15,7 @@
15
15
  # License along with this library; if not, write to the Free Software
16
16
  # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17
17
 
18
- require "open-uri"
18
+ require "net/http"
19
19
 
20
20
  require "groonga/client/empty-request"
21
21
  require "groonga/client/protocol/error"
@@ -45,11 +45,22 @@ module Groonga
45
45
  url = "http://#{@host}:#{@port}#{command.to_uri_format}"
46
46
  thread = ::Thread.new do
47
47
  begin
48
- open(url) do |response|
49
- body = response.read
50
- yield(body)
48
+ Net::HTTP.start(@host, @port) do |http|
49
+ response = http.get(command.to_uri_format)
50
+ case response
51
+ when Net::HTTPSuccess, Net::HTTPBadRequest
52
+ yield(response.body)
53
+ else
54
+ if response.body.start_with?("[[")
55
+ yield(response.body)
56
+ else
57
+ message =
58
+ "#{response.code} #{response.message}: #{response.body}"
59
+ raise Error.new(message)
60
+ end
61
+ end
51
62
  end
52
- rescue OpenURI::HTTPError, Timeout::Error
63
+ rescue SystemCallError, Timeout::Error
53
64
  raise WrappedError.new($!)
54
65
  end
55
66
  end
@@ -18,6 +18,6 @@
18
18
 
19
19
  module Groonga
20
20
  class Client
21
- VERSION = "0.0.7"
21
+ VERSION = "0.0.8"
22
22
  end
23
23
  end
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: groonga-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
5
- prerelease:
4
+ version: 0.0.8
6
5
  platform: ruby
7
6
  authors:
8
7
  - Haruka Yoshihara
@@ -11,161 +10,139 @@ authors:
11
10
  autorequire:
12
11
  bindir: bin
13
12
  cert_chain: []
14
- date: 2014-03-28 00:00:00.000000000 Z
13
+ date: 2014-05-12 00:00:00.000000000 Z
15
14
  dependencies:
16
15
  - !ruby/object:Gem::Dependency
17
16
  name: gqtp
18
17
  requirement: !ruby/object:Gem::Requirement
19
- none: false
20
18
  requirements:
21
- - - ! '>='
19
+ - - ">="
22
20
  - !ruby/object:Gem::Version
23
21
  version: 1.0.4
24
22
  type: :runtime
25
23
  prerelease: false
26
24
  version_requirements: !ruby/object:Gem::Requirement
27
- none: false
28
25
  requirements:
29
- - - ! '>='
26
+ - - ">="
30
27
  - !ruby/object:Gem::Version
31
28
  version: 1.0.4
32
29
  - !ruby/object:Gem::Dependency
33
30
  name: groonga-command
34
31
  requirement: !ruby/object:Gem::Requirement
35
- none: false
36
32
  requirements:
37
- - - ! '>='
33
+ - - ">="
38
34
  - !ruby/object:Gem::Version
39
35
  version: 1.0.4
40
36
  type: :runtime
41
37
  prerelease: false
42
38
  version_requirements: !ruby/object:Gem::Requirement
43
- none: false
44
39
  requirements:
45
- - - ! '>='
40
+ - - ">="
46
41
  - !ruby/object:Gem::Version
47
42
  version: 1.0.4
48
43
  - !ruby/object:Gem::Dependency
49
44
  name: bundler
50
45
  requirement: !ruby/object:Gem::Requirement
51
- none: false
52
46
  requirements:
53
- - - ! '>='
47
+ - - ">="
54
48
  - !ruby/object:Gem::Version
55
49
  version: '0'
56
50
  type: :development
57
51
  prerelease: false
58
52
  version_requirements: !ruby/object:Gem::Requirement
59
- none: false
60
53
  requirements:
61
- - - ! '>='
54
+ - - ">="
62
55
  - !ruby/object:Gem::Version
63
56
  version: '0'
64
57
  - !ruby/object:Gem::Dependency
65
58
  name: rake
66
59
  requirement: !ruby/object:Gem::Requirement
67
- none: false
68
60
  requirements:
69
- - - ! '>='
61
+ - - ">="
70
62
  - !ruby/object:Gem::Version
71
63
  version: '0'
72
64
  type: :development
73
65
  prerelease: false
74
66
  version_requirements: !ruby/object:Gem::Requirement
75
- none: false
76
67
  requirements:
77
- - - ! '>='
68
+ - - ">="
78
69
  - !ruby/object:Gem::Version
79
70
  version: '0'
80
71
  - !ruby/object:Gem::Dependency
81
72
  name: test-unit
82
73
  requirement: !ruby/object:Gem::Requirement
83
- none: false
84
74
  requirements:
85
- - - ! '>='
75
+ - - ">="
86
76
  - !ruby/object:Gem::Version
87
77
  version: '0'
88
78
  type: :development
89
79
  prerelease: false
90
80
  version_requirements: !ruby/object:Gem::Requirement
91
- none: false
92
81
  requirements:
93
- - - ! '>='
82
+ - - ">="
94
83
  - !ruby/object:Gem::Version
95
84
  version: '0'
96
85
  - !ruby/object:Gem::Dependency
97
86
  name: test-unit-notify
98
87
  requirement: !ruby/object:Gem::Requirement
99
- none: false
100
88
  requirements:
101
- - - ! '>='
89
+ - - ">="
102
90
  - !ruby/object:Gem::Version
103
91
  version: '0'
104
92
  type: :development
105
93
  prerelease: false
106
94
  version_requirements: !ruby/object:Gem::Requirement
107
- none: false
108
95
  requirements:
109
- - - ! '>='
96
+ - - ">="
110
97
  - !ruby/object:Gem::Version
111
98
  version: '0'
112
99
  - !ruby/object:Gem::Dependency
113
100
  name: test-unit-rr
114
101
  requirement: !ruby/object:Gem::Requirement
115
- none: false
116
102
  requirements:
117
- - - ! '>='
103
+ - - ">="
118
104
  - !ruby/object:Gem::Version
119
105
  version: '0'
120
106
  type: :development
121
107
  prerelease: false
122
108
  version_requirements: !ruby/object:Gem::Requirement
123
- none: false
124
109
  requirements:
125
- - - ! '>='
110
+ - - ">="
126
111
  - !ruby/object:Gem::Version
127
112
  version: '0'
128
113
  - !ruby/object:Gem::Dependency
129
114
  name: packnga
130
115
  requirement: !ruby/object:Gem::Requirement
131
- none: false
132
116
  requirements:
133
- - - ! '>='
117
+ - - ">="
134
118
  - !ruby/object:Gem::Version
135
119
  version: '0'
136
120
  type: :development
137
121
  prerelease: false
138
122
  version_requirements: !ruby/object:Gem::Requirement
139
- none: false
140
123
  requirements:
141
- - - ! '>='
124
+ - - ">="
142
125
  - !ruby/object:Gem::Version
143
126
  version: '0'
144
127
  - !ruby/object:Gem::Dependency
145
128
  name: redcarpet
146
129
  requirement: !ruby/object:Gem::Requirement
147
- none: false
148
130
  requirements:
149
- - - ! '>='
131
+ - - ">="
150
132
  - !ruby/object:Gem::Version
151
133
  version: '0'
152
134
  type: :development
153
135
  prerelease: false
154
136
  version_requirements: !ruby/object:Gem::Requirement
155
- none: false
156
137
  requirements:
157
- - - ! '>='
138
+ - - ">="
158
139
  - !ruby/object:Gem::Version
159
140
  version: '0'
160
- description: ! 'Groonga-client gem supports HTTP or
161
-
141
+ description: |
142
+ Groonga-client gem supports HTTP or
162
143
  [GQTP (Groonga Query Transfer Protocol)](http://groonga.org/docs/spec/gqtp.html)
163
-
164
144
  as the protocol using a client. You can use it without groonga
165
-
166
145
  package.
167
-
168
- '
169
146
  email:
170
147
  - yshr04hrk@gmail.com
171
148
  - kou@clear-code.com
@@ -174,95 +151,95 @@ executables: []
174
151
  extensions: []
175
152
  extra_rdoc_files: []
176
153
  files:
154
+ - ".yardopts"
155
+ - Gemfile
177
156
  - README.md
178
157
  - Rakefile
179
- - Gemfile
158
+ - doc/text/news.md
180
159
  - groonga-client.gemspec
181
- - .yardopts
182
160
  - lib/groonga/client.rb
161
+ - lib/groonga/client/command.rb
183
162
  - lib/groonga/client/empty-request.rb
184
- - lib/groonga/client/protocol/http/thread.rb
185
- - lib/groonga/client/protocol/http/coolio.rb
186
- - lib/groonga/client/protocol/gqtp.rb
163
+ - lib/groonga/client/error.rb
187
164
  - lib/groonga/client/protocol/error.rb
165
+ - lib/groonga/client/protocol/gqtp.rb
188
166
  - lib/groonga/client/protocol/http.rb
189
- - lib/groonga/client/command.rb
190
- - lib/groonga/client/error.rb
167
+ - lib/groonga/client/protocol/http/coolio.rb
168
+ - lib/groonga/client/protocol/http/thread.rb
191
169
  - lib/groonga/client/response.rb
192
- - lib/groonga/client/response/log_reopen.rb
193
- - lib/groonga/client/response/quit.rb
194
- - lib/groonga/client/response/column_rename.rb
195
- - lib/groonga/client/response/cache_limit.rb
196
- - lib/groonga/client/response/defrag.rb
197
170
  - lib/groonga/client/response/base.rb
171
+ - lib/groonga/client/response/cache_limit.rb
172
+ - lib/groonga/client/response/check.rb
198
173
  - lib/groonga/client/response/clearlock.rb
199
- - lib/groonga/client/response/register.rb
200
- - lib/groonga/client/response/dump.rb
201
- - lib/groonga/client/response/table_create.rb
174
+ - lib/groonga/client/response/column_create.rb
175
+ - lib/groonga/client/response/column_list.rb
176
+ - lib/groonga/client/response/column_remove.rb
177
+ - lib/groonga/client/response/column_rename.rb
178
+ - lib/groonga/client/response/defrag.rb
202
179
  - lib/groonga/client/response/delete.rb
180
+ - lib/groonga/client/response/dump.rb
181
+ - lib/groonga/client/response/error.rb
203
182
  - lib/groonga/client/response/load.rb
204
183
  - lib/groonga/client/response/log_level.rb
205
- - lib/groonga/client/response/select.rb
206
- - lib/groonga/client/response/error.rb
207
- - lib/groonga/client/response/column_remove.rb
208
184
  - lib/groonga/client/response/log_put.rb
209
- - lib/groonga/client/response/table_list.rb
210
- - lib/groonga/client/response/column_list.rb
211
- - lib/groonga/client/response/check.rb
212
- - lib/groonga/client/response/column_create.rb
185
+ - lib/groonga/client/response/log_reopen.rb
186
+ - lib/groonga/client/response/quit.rb
187
+ - lib/groonga/client/response/register.rb
188
+ - lib/groonga/client/response/select.rb
213
189
  - lib/groonga/client/response/status.rb
190
+ - lib/groonga/client/response/table_create.rb
191
+ - lib/groonga/client/response/table_list.rb
214
192
  - lib/groonga/client/version.rb
215
- - doc/text/news.md
216
- - test/results/test-table-list.rb
217
- - test/results/test-column-list.rb
218
- - test/test-command.rb
219
- - test/run-test.rb
220
- - test/test-client.rb
221
193
  - test/protocol/test-gqtp.rb
222
194
  - test/protocol/test-http.rb
223
- - test/response/test-table-list.rb
224
- - test/response/test-error.rb
225
- - test/response/test-status.rb
226
- - test/response/test-select.rb
227
195
  - test/response/helper.rb
228
196
  - test/response/test-column-list.rb
197
+ - test/response/test-error.rb
198
+ - test/response/test-select.rb
199
+ - test/response/test-status.rb
200
+ - test/response/test-table-list.rb
201
+ - test/results/test-column-list.rb
202
+ - test/results/test-table-list.rb
203
+ - test/run-test.rb
204
+ - test/test-client.rb
205
+ - test/test-command.rb
229
206
  homepage: https://github.com/ranguba/groonga-client
230
207
  licenses:
231
208
  - LGPLv2.1 or later
209
+ metadata: {}
232
210
  post_install_message:
233
211
  rdoc_options: []
234
212
  require_paths:
235
213
  - lib
236
214
  required_ruby_version: !ruby/object:Gem::Requirement
237
- none: false
238
215
  requirements:
239
- - - ! '>='
216
+ - - ">="
240
217
  - !ruby/object:Gem::Version
241
218
  version: '0'
242
219
  required_rubygems_version: !ruby/object:Gem::Requirement
243
- none: false
244
220
  requirements:
245
- - - ! '>='
221
+ - - ">="
246
222
  - !ruby/object:Gem::Version
247
223
  version: '0'
248
224
  requirements: []
249
225
  rubyforge_project:
250
- rubygems_version: 1.8.23
226
+ rubygems_version: 2.2.2
251
227
  signing_key:
252
- specification_version: 3
228
+ specification_version: 4
253
229
  summary: Groonga-client is a client for groonga (http://groonga.org/) implemented
254
230
  with pure ruby.
255
231
  test_files:
256
- - test/results/test-table-list.rb
257
- - test/results/test-column-list.rb
258
- - test/test-command.rb
259
232
  - test/run-test.rb
260
233
  - test/test-client.rb
261
- - test/protocol/test-gqtp.rb
262
- - test/protocol/test-http.rb
263
- - test/response/test-table-list.rb
234
+ - test/response/helper.rb
264
235
  - test/response/test-error.rb
265
236
  - test/response/test-status.rb
266
237
  - test/response/test-select.rb
267
- - test/response/helper.rb
238
+ - test/response/test-table-list.rb
268
239
  - test/response/test-column-list.rb
240
+ - test/test-command.rb
241
+ - test/results/test-table-list.rb
242
+ - test/results/test-column-list.rb
243
+ - test/protocol/test-gqtp.rb
244
+ - test/protocol/test-http.rb
245
+ has_rdoc: