groonga-client 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/doc/text/news.md +6 -0
- data/lib/groonga/client/response.rb +2 -0
- data/lib/groonga/client/response/base.rb +6 -2
- data/lib/groonga/client/response/error.rb +27 -0
- data/lib/groonga/client/version.rb +1 -1
- data/test/response/test-error.rb +39 -0
- metadata +92 -66
- checksums.yaml +0 -7
data/doc/text/news.md
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
2
|
#
|
3
|
+
# Copyright (C) 2014 Kouhei Sutou <kou@clear-code.com>
|
3
4
|
# Copyright (C) 2013 Haruka Yoshihara <yoshihara@clear-code.com>
|
4
5
|
#
|
5
6
|
# This library is free software; you can redistribute it and/or
|
@@ -26,6 +27,7 @@ require "groonga/client/response/column_rename"
|
|
26
27
|
require "groonga/client/response/defrag"
|
27
28
|
require "groonga/client/response/delete"
|
28
29
|
require "groonga/client/response/dump"
|
30
|
+
require "groonga/client/response/error"
|
29
31
|
require "groonga/client/response/load"
|
30
32
|
require "groonga/client/response/log_level"
|
31
33
|
require "groonga/client/response/log_put"
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# -*- coding: utf-8 -*-
|
2
2
|
#
|
3
3
|
# Copyright (C) 2013 Haruka Yoshihara <yoshihara@clear-code.com>
|
4
|
-
# Copyright (C) 2013 Kouhei Sutou <kou@clear-code.com>
|
4
|
+
# Copyright (C) 2013-2014 Kouhei Sutou <kou@clear-code.com>
|
5
5
|
#
|
6
6
|
# This library is free software; you can redistribute it and/or
|
7
7
|
# modify it under the terms of the GNU Lesser General Public
|
@@ -59,7 +59,11 @@ module Groonga
|
|
59
59
|
header = nil
|
60
60
|
body = raw_response
|
61
61
|
end
|
62
|
-
|
62
|
+
if header.nil? or header[0].zero?
|
63
|
+
response = new(command, header, body)
|
64
|
+
else
|
65
|
+
response = Error.new(command, header, body)
|
66
|
+
end
|
63
67
|
response.raw = raw_response
|
64
68
|
response
|
65
69
|
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
# Copyright (C) 2014 Kouhei Sutou <kou@clear-code.com>
|
2
|
+
#
|
3
|
+
# This library is free software; you can redistribute it and/or
|
4
|
+
# modify it under the terms of the GNU Lesser General Public
|
5
|
+
# License as published by the Free Software Foundation; either
|
6
|
+
# version 2.1 of the License, or (at your option) any later version.
|
7
|
+
#
|
8
|
+
# This library is distributed in the hope that it will be useful,
|
9
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
10
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
11
|
+
# Lesser General Public License for more details.
|
12
|
+
#
|
13
|
+
# You should have received a copy of the GNU Lesser General Public
|
14
|
+
# License along with this library; if not, write to the Free Software
|
15
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
16
|
+
|
17
|
+
require "groonga/client/response/base"
|
18
|
+
|
19
|
+
module Groonga
|
20
|
+
class Client
|
21
|
+
module Response
|
22
|
+
class Error < Base
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
@@ -0,0 +1,39 @@
|
|
1
|
+
# Copyright (C) 2014 Kouhei Sutou <kou@clear-code.com>
|
2
|
+
#
|
3
|
+
# This library is free software; you can redistribute it and/or
|
4
|
+
# modify it under the terms of the GNU Lesser General Public
|
5
|
+
# License as published by the Free Software Foundation; either
|
6
|
+
# version 2.1 of the License, or (at your option) any later version.
|
7
|
+
#
|
8
|
+
# This library is distributed in the hope that it will be useful,
|
9
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
10
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
11
|
+
# Lesser General Public License for more details.
|
12
|
+
#
|
13
|
+
# You should have received a copy of the GNU Lesser General Public
|
14
|
+
# License along with this library; if not, write to the Free Software
|
15
|
+
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
16
|
+
|
17
|
+
require "response/helper"
|
18
|
+
|
19
|
+
class TestResponseError < Test::Unit::TestCase
|
20
|
+
class TestParse < self
|
21
|
+
include TestResponseHelper
|
22
|
+
|
23
|
+
def test_class
|
24
|
+
header = [
|
25
|
+
-22,
|
26
|
+
1396012478.14975,
|
27
|
+
0.00050806999206543,
|
28
|
+
"invalid table name: <Nonexistent>",
|
29
|
+
[
|
30
|
+
["grn_select", "proc.c", 897],
|
31
|
+
],
|
32
|
+
]
|
33
|
+
raw_response = [header].to_json
|
34
|
+
|
35
|
+
response = parse_raw_response("select", raw_response)
|
36
|
+
assert_equal(Groonga::Client::Response::Error, response.class)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: groonga-client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
|
+
prerelease:
|
5
6
|
platform: ruby
|
6
7
|
authors:
|
7
8
|
- Haruka Yoshihara
|
@@ -10,139 +11,161 @@ authors:
|
|
10
11
|
autorequire:
|
11
12
|
bindir: bin
|
12
13
|
cert_chain: []
|
13
|
-
date: 2014-03-
|
14
|
+
date: 2014-03-28 00:00:00.000000000 Z
|
14
15
|
dependencies:
|
15
16
|
- !ruby/object:Gem::Dependency
|
16
17
|
name: gqtp
|
17
18
|
requirement: !ruby/object:Gem::Requirement
|
19
|
+
none: false
|
18
20
|
requirements:
|
19
|
-
- - '>='
|
21
|
+
- - ! '>='
|
20
22
|
- !ruby/object:Gem::Version
|
21
23
|
version: 1.0.4
|
22
24
|
type: :runtime
|
23
25
|
prerelease: false
|
24
26
|
version_requirements: !ruby/object:Gem::Requirement
|
27
|
+
none: false
|
25
28
|
requirements:
|
26
|
-
- - '>='
|
29
|
+
- - ! '>='
|
27
30
|
- !ruby/object:Gem::Version
|
28
31
|
version: 1.0.4
|
29
32
|
- !ruby/object:Gem::Dependency
|
30
33
|
name: groonga-command
|
31
34
|
requirement: !ruby/object:Gem::Requirement
|
35
|
+
none: false
|
32
36
|
requirements:
|
33
|
-
- - '>='
|
37
|
+
- - ! '>='
|
34
38
|
- !ruby/object:Gem::Version
|
35
39
|
version: 1.0.4
|
36
40
|
type: :runtime
|
37
41
|
prerelease: false
|
38
42
|
version_requirements: !ruby/object:Gem::Requirement
|
43
|
+
none: false
|
39
44
|
requirements:
|
40
|
-
- - '>='
|
45
|
+
- - ! '>='
|
41
46
|
- !ruby/object:Gem::Version
|
42
47
|
version: 1.0.4
|
43
48
|
- !ruby/object:Gem::Dependency
|
44
49
|
name: bundler
|
45
50
|
requirement: !ruby/object:Gem::Requirement
|
51
|
+
none: false
|
46
52
|
requirements:
|
47
|
-
- - '>='
|
53
|
+
- - ! '>='
|
48
54
|
- !ruby/object:Gem::Version
|
49
55
|
version: '0'
|
50
56
|
type: :development
|
51
57
|
prerelease: false
|
52
58
|
version_requirements: !ruby/object:Gem::Requirement
|
59
|
+
none: false
|
53
60
|
requirements:
|
54
|
-
- - '>='
|
61
|
+
- - ! '>='
|
55
62
|
- !ruby/object:Gem::Version
|
56
63
|
version: '0'
|
57
64
|
- !ruby/object:Gem::Dependency
|
58
65
|
name: rake
|
59
66
|
requirement: !ruby/object:Gem::Requirement
|
67
|
+
none: false
|
60
68
|
requirements:
|
61
|
-
- - '>='
|
69
|
+
- - ! '>='
|
62
70
|
- !ruby/object:Gem::Version
|
63
71
|
version: '0'
|
64
72
|
type: :development
|
65
73
|
prerelease: false
|
66
74
|
version_requirements: !ruby/object:Gem::Requirement
|
75
|
+
none: false
|
67
76
|
requirements:
|
68
|
-
- - '>='
|
77
|
+
- - ! '>='
|
69
78
|
- !ruby/object:Gem::Version
|
70
79
|
version: '0'
|
71
80
|
- !ruby/object:Gem::Dependency
|
72
81
|
name: test-unit
|
73
82
|
requirement: !ruby/object:Gem::Requirement
|
83
|
+
none: false
|
74
84
|
requirements:
|
75
|
-
- - '>='
|
85
|
+
- - ! '>='
|
76
86
|
- !ruby/object:Gem::Version
|
77
87
|
version: '0'
|
78
88
|
type: :development
|
79
89
|
prerelease: false
|
80
90
|
version_requirements: !ruby/object:Gem::Requirement
|
91
|
+
none: false
|
81
92
|
requirements:
|
82
|
-
- - '>='
|
93
|
+
- - ! '>='
|
83
94
|
- !ruby/object:Gem::Version
|
84
95
|
version: '0'
|
85
96
|
- !ruby/object:Gem::Dependency
|
86
97
|
name: test-unit-notify
|
87
98
|
requirement: !ruby/object:Gem::Requirement
|
99
|
+
none: false
|
88
100
|
requirements:
|
89
|
-
- - '>='
|
101
|
+
- - ! '>='
|
90
102
|
- !ruby/object:Gem::Version
|
91
103
|
version: '0'
|
92
104
|
type: :development
|
93
105
|
prerelease: false
|
94
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
none: false
|
95
108
|
requirements:
|
96
|
-
- - '>='
|
109
|
+
- - ! '>='
|
97
110
|
- !ruby/object:Gem::Version
|
98
111
|
version: '0'
|
99
112
|
- !ruby/object:Gem::Dependency
|
100
113
|
name: test-unit-rr
|
101
114
|
requirement: !ruby/object:Gem::Requirement
|
115
|
+
none: false
|
102
116
|
requirements:
|
103
|
-
- - '>='
|
117
|
+
- - ! '>='
|
104
118
|
- !ruby/object:Gem::Version
|
105
119
|
version: '0'
|
106
120
|
type: :development
|
107
121
|
prerelease: false
|
108
122
|
version_requirements: !ruby/object:Gem::Requirement
|
123
|
+
none: false
|
109
124
|
requirements:
|
110
|
-
- - '>='
|
125
|
+
- - ! '>='
|
111
126
|
- !ruby/object:Gem::Version
|
112
127
|
version: '0'
|
113
128
|
- !ruby/object:Gem::Dependency
|
114
129
|
name: packnga
|
115
130
|
requirement: !ruby/object:Gem::Requirement
|
131
|
+
none: false
|
116
132
|
requirements:
|
117
|
-
- - '>='
|
133
|
+
- - ! '>='
|
118
134
|
- !ruby/object:Gem::Version
|
119
135
|
version: '0'
|
120
136
|
type: :development
|
121
137
|
prerelease: false
|
122
138
|
version_requirements: !ruby/object:Gem::Requirement
|
139
|
+
none: false
|
123
140
|
requirements:
|
124
|
-
- - '>='
|
141
|
+
- - ! '>='
|
125
142
|
- !ruby/object:Gem::Version
|
126
143
|
version: '0'
|
127
144
|
- !ruby/object:Gem::Dependency
|
128
145
|
name: redcarpet
|
129
146
|
requirement: !ruby/object:Gem::Requirement
|
147
|
+
none: false
|
130
148
|
requirements:
|
131
|
-
- - '>='
|
149
|
+
- - ! '>='
|
132
150
|
- !ruby/object:Gem::Version
|
133
151
|
version: '0'
|
134
152
|
type: :development
|
135
153
|
prerelease: false
|
136
154
|
version_requirements: !ruby/object:Gem::Requirement
|
155
|
+
none: false
|
137
156
|
requirements:
|
138
|
-
- - '>='
|
157
|
+
- - ! '>='
|
139
158
|
- !ruby/object:Gem::Version
|
140
159
|
version: '0'
|
141
|
-
description:
|
142
|
-
|
160
|
+
description: ! 'Groonga-client gem supports HTTP or
|
161
|
+
|
143
162
|
[GQTP (Groonga Query Transfer Protocol)](http://groonga.org/docs/spec/gqtp.html)
|
163
|
+
|
144
164
|
as the protocol using a client. You can use it without groonga
|
165
|
+
|
145
166
|
package.
|
167
|
+
|
168
|
+
'
|
146
169
|
email:
|
147
170
|
- yshr04hrk@gmail.com
|
148
171
|
- kou@clear-code.com
|
@@ -156,87 +179,90 @@ files:
|
|
156
179
|
- Gemfile
|
157
180
|
- groonga-client.gemspec
|
158
181
|
- .yardopts
|
159
|
-
- lib/groonga/client
|
182
|
+
- lib/groonga/client.rb
|
183
|
+
- 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
|
187
|
+
- lib/groonga/client/protocol/error.rb
|
188
|
+
- lib/groonga/client/protocol/http.rb
|
189
|
+
- lib/groonga/client/command.rb
|
160
190
|
- lib/groonga/client/error.rb
|
161
|
-
- lib/groonga/client/response
|
162
|
-
- lib/groonga/client/response/
|
191
|
+
- lib/groonga/client/response.rb
|
192
|
+
- lib/groonga/client/response/log_reopen.rb
|
163
193
|
- lib/groonga/client/response/quit.rb
|
164
|
-
- lib/groonga/client/response/log_put.rb
|
165
|
-
- lib/groonga/client/response/load.rb
|
166
|
-
- lib/groonga/client/response/delete.rb
|
167
|
-
- lib/groonga/client/response/base.rb
|
168
|
-
- lib/groonga/client/response/status.rb
|
169
|
-
- lib/groonga/client/response/table_create.rb
|
170
|
-
- lib/groonga/client/response/register.rb
|
171
|
-
- lib/groonga/client/response/column_create.rb
|
172
|
-
- lib/groonga/client/response/check.rb
|
173
|
-
- lib/groonga/client/response/cache_limit.rb
|
174
194
|
- lib/groonga/client/response/column_rename.rb
|
195
|
+
- lib/groonga/client/response/cache_limit.rb
|
175
196
|
- lib/groonga/client/response/defrag.rb
|
176
|
-
- lib/groonga/client/response/
|
177
|
-
- lib/groonga/client/response/
|
178
|
-
- lib/groonga/client/response/
|
197
|
+
- lib/groonga/client/response/base.rb
|
198
|
+
- lib/groonga/client/response/clearlock.rb
|
199
|
+
- lib/groonga/client/response/register.rb
|
179
200
|
- lib/groonga/client/response/dump.rb
|
201
|
+
- lib/groonga/client/response/table_create.rb
|
202
|
+
- lib/groonga/client/response/delete.rb
|
203
|
+
- lib/groonga/client/response/load.rb
|
204
|
+
- lib/groonga/client/response/log_level.rb
|
180
205
|
- lib/groonga/client/response/select.rb
|
206
|
+
- lib/groonga/client/response/error.rb
|
207
|
+
- lib/groonga/client/response/column_remove.rb
|
208
|
+
- lib/groonga/client/response/log_put.rb
|
209
|
+
- lib/groonga/client/response/table_list.rb
|
181
210
|
- lib/groonga/client/response/column_list.rb
|
211
|
+
- lib/groonga/client/response/check.rb
|
212
|
+
- lib/groonga/client/response/column_create.rb
|
213
|
+
- lib/groonga/client/response/status.rb
|
182
214
|
- lib/groonga/client/version.rb
|
183
|
-
- lib/groonga/client/command.rb
|
184
|
-
- lib/groonga/client/protocol/error.rb
|
185
|
-
- lib/groonga/client/protocol/http/coolio.rb
|
186
|
-
- lib/groonga/client/protocol/http/thread.rb
|
187
|
-
- lib/groonga/client/protocol/gqtp.rb
|
188
|
-
- lib/groonga/client/protocol/http.rb
|
189
|
-
- lib/groonga/client/empty-request.rb
|
190
|
-
- lib/groonga/client.rb
|
191
215
|
- doc/text/news.md
|
216
|
+
- test/results/test-table-list.rb
|
217
|
+
- test/results/test-column-list.rb
|
218
|
+
- test/test-command.rb
|
192
219
|
- test/run-test.rb
|
193
220
|
- test/test-client.rb
|
194
|
-
- test/
|
221
|
+
- test/protocol/test-gqtp.rb
|
222
|
+
- test/protocol/test-http.rb
|
223
|
+
- test/response/test-table-list.rb
|
224
|
+
- test/response/test-error.rb
|
195
225
|
- test/response/test-status.rb
|
196
226
|
- test/response/test-select.rb
|
197
|
-
- test/response/
|
227
|
+
- test/response/helper.rb
|
198
228
|
- test/response/test-column-list.rb
|
199
|
-
- test/test-command.rb
|
200
|
-
- test/results/test-table-list.rb
|
201
|
-
- test/results/test-column-list.rb
|
202
|
-
- test/protocol/test-gqtp.rb
|
203
|
-
- test/protocol/test-http.rb
|
204
229
|
homepage: https://github.com/ranguba/groonga-client
|
205
230
|
licenses:
|
206
231
|
- LGPLv2.1 or later
|
207
|
-
metadata: {}
|
208
232
|
post_install_message:
|
209
233
|
rdoc_options: []
|
210
234
|
require_paths:
|
211
235
|
- lib
|
212
236
|
required_ruby_version: !ruby/object:Gem::Requirement
|
237
|
+
none: false
|
213
238
|
requirements:
|
214
|
-
- - '>='
|
239
|
+
- - ! '>='
|
215
240
|
- !ruby/object:Gem::Version
|
216
241
|
version: '0'
|
217
242
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
243
|
+
none: false
|
218
244
|
requirements:
|
219
|
-
- - '>='
|
245
|
+
- - ! '>='
|
220
246
|
- !ruby/object:Gem::Version
|
221
247
|
version: '0'
|
222
248
|
requirements: []
|
223
249
|
rubyforge_project:
|
224
|
-
rubygems_version:
|
250
|
+
rubygems_version: 1.8.23
|
225
251
|
signing_key:
|
226
|
-
specification_version:
|
252
|
+
specification_version: 3
|
227
253
|
summary: Groonga-client is a client for groonga (http://groonga.org/) implemented
|
228
254
|
with pure ruby.
|
229
255
|
test_files:
|
256
|
+
- test/results/test-table-list.rb
|
257
|
+
- test/results/test-column-list.rb
|
258
|
+
- test/test-command.rb
|
230
259
|
- test/run-test.rb
|
231
260
|
- test/test-client.rb
|
232
|
-
- test/
|
261
|
+
- test/protocol/test-gqtp.rb
|
262
|
+
- test/protocol/test-http.rb
|
263
|
+
- test/response/test-table-list.rb
|
264
|
+
- test/response/test-error.rb
|
233
265
|
- test/response/test-status.rb
|
234
266
|
- test/response/test-select.rb
|
235
|
-
- test/response/
|
267
|
+
- test/response/helper.rb
|
236
268
|
- test/response/test-column-list.rb
|
237
|
-
- test/test-command.rb
|
238
|
-
- test/results/test-table-list.rb
|
239
|
-
- test/results/test-column-list.rb
|
240
|
-
- test/protocol/test-gqtp.rb
|
241
|
-
- test/protocol/test-http.rb
|
242
|
-
has_rdoc:
|
checksums.yaml
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
---
|
2
|
-
SHA1:
|
3
|
-
metadata.gz: 3c50b276ffa5a1f9020c6414018c089ac76943b9
|
4
|
-
data.tar.gz: 0e9f0189f9f19e1b94e27f1e1fce4363783c7753
|
5
|
-
SHA512:
|
6
|
-
metadata.gz: 38b205d2086d409e3c604f7db19d8327f8cfa585481996f7c4cabbe4f52f5b53dfe6a4502032d2eb1180e117e7b93d6de40bbf81806b85efbd8d95a409ce1c93
|
7
|
-
data.tar.gz: ddd34bc40409ea4fe7d2ef3684f760c6ac5b01e23b51990bfc1d88fbb4671a2cb9c3626e7017694bbcaf382e07a586bb9bdd0a96fc786660c7feed2815e6d82e
|