rosette_api 1.8.0 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/lib/request_builder.rb +6 -0
- data/lib/rosette_api.rb +6 -1
- data/tests/tests_spec.rb +53 -45
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: c9ae506e18bb5737ed9eacb75025c726968acfc0fbad50a6ac155e717317db86
|
4
|
+
data.tar.gz: f0c142482ff8a4dd2d049302b5bb4106135e8a0d7311d872e804d5e7d660301f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7bbf898aaa91598430108ca5aa10e3bf3d855dcf8b9e81e0ee05cbdbf89c277e1fd2a98b0e16c21524a27cf3d8fe236a973f8ee0b4870402afc6d1f9c7eda599
|
7
|
+
data.tar.gz: 37ff307ccacaa35b47ddcb3404869537a0ccb3cfeb2051dbd08b14a7100c6759a41005e3203b084a53381c497ef668719b8597354f6d47121accaad0891f68b7
|
data/lib/request_builder.rb
CHANGED
@@ -17,6 +17,8 @@ class RequestBuilder
|
|
17
17
|
attr_accessor :user_key
|
18
18
|
# Rosette API binding version
|
19
19
|
attr_accessor :binding_version
|
20
|
+
# User-Agent string
|
21
|
+
attr_reader :user_agent
|
20
22
|
|
21
23
|
def initialize(user_key, alternate_url, http_client, params = {}, url_parameters = nil, binding_version)
|
22
24
|
@user_key = user_key
|
@@ -24,6 +26,7 @@ class RequestBuilder
|
|
24
26
|
@http_client = http_client
|
25
27
|
@params = params
|
26
28
|
@binding_version = binding_version
|
29
|
+
@user_agent = 'Ruby/' + binding_version + '/' + RUBY_VERSION
|
27
30
|
|
28
31
|
return unless url_parameters
|
29
32
|
@alternate_url = @alternate_url + '?' + URI.encode_www_form(url_parameters)
|
@@ -61,6 +64,7 @@ class RequestBuilder
|
|
61
64
|
request['X-RosetteAPI-Key'] = @user_key
|
62
65
|
request['Content-Type'] = 'application/json'
|
63
66
|
request['Accept'] = 'application/json'
|
67
|
+
request['User-Agent'] = @user_agent
|
64
68
|
request['X-RosetteAPI-Binding'] = 'ruby'
|
65
69
|
request['X-RosetteAPI-Binding-Version'] = @binding_version
|
66
70
|
request.body = params.to_json
|
@@ -123,6 +127,7 @@ class RequestBuilder
|
|
123
127
|
end
|
124
128
|
|
125
129
|
request.add_field 'Content-Type', "multipart/form-data; boundary=#{boundary}"
|
130
|
+
request.add_field 'User-Agent', @user_agent
|
126
131
|
request.add_field 'X-RosetteAPI-Key', @user_key
|
127
132
|
request.add_field 'X-RosetteAPI-Binding', 'ruby'
|
128
133
|
request.add_field 'X-RosetteAPI-Binding-Version', @binding_version
|
@@ -143,6 +148,7 @@ class RequestBuilder
|
|
143
148
|
raise RosetteAPIError.new 'connectionError', 'Failed to establish connection with Rosette API server.'
|
144
149
|
end
|
145
150
|
request['X-RosetteAPI-Key'] = @user_key
|
151
|
+
request['User-Agent'] = @user_agent
|
146
152
|
|
147
153
|
get_response @http_client, request
|
148
154
|
end
|
data/lib/rosette_api.rb
CHANGED
@@ -10,7 +10,7 @@ require_relative 'bad_request_format_error'
|
|
10
10
|
# This class allows you to access all Rosette API endpoints.
|
11
11
|
class RosetteAPI
|
12
12
|
# Version of Ruby binding
|
13
|
-
BINDING_VERSION = '1.
|
13
|
+
BINDING_VERSION = '1.9.0'
|
14
14
|
# Rosette API language endpoint
|
15
15
|
LANGUAGE_ENDPOINT = '/language'.freeze
|
16
16
|
# Rosette API morphology endpoint
|
@@ -398,6 +398,11 @@ class RosetteAPI
|
|
398
398
|
.send_get_request
|
399
399
|
end
|
400
400
|
|
401
|
+
# Gets the User-Agent string
|
402
|
+
def user_agent
|
403
|
+
RequestBuilder.new(@user_key, @alternate_url + PING, @http_client, @url_parameters, BINDING_VERSION).user_agent
|
404
|
+
end
|
405
|
+
|
401
406
|
private
|
402
407
|
|
403
408
|
# Checks that the right parameter type is being passed in.
|
data/tests/tests_spec.rb
CHANGED
@@ -9,6 +9,14 @@ describe RosetteAPI do
|
|
9
9
|
RSpec.configure do |config|
|
10
10
|
config.before(:example) { @content = 'Sample Content' }
|
11
11
|
config.before(:example) { @json = {content: 'Sample Content'}.to_json }
|
12
|
+
config.before(:example) { @user_agent = 'Ruby/' + RosetteAPI::BINDING_VERSION + '/' + RUBY_VERSION }
|
13
|
+
end
|
14
|
+
|
15
|
+
describe '.user_agent' do
|
16
|
+
it 'check User-Agent string' do
|
17
|
+
result = RosetteAPI.new('0123456789').user_agent
|
18
|
+
expect(result).to eq @user_agent
|
19
|
+
end
|
12
20
|
end
|
13
21
|
|
14
22
|
describe '.get_language' do
|
@@ -18,10 +26,10 @@ describe RosetteAPI do
|
|
18
26
|
headers: { 'Accept' => 'application/json',
|
19
27
|
'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
|
20
28
|
'Content-Type' => 'application/json',
|
21
|
-
'User-Agent' =>
|
29
|
+
'User-Agent' => @user_agent,
|
22
30
|
'X-Rosetteapi-Key' => '0123456789',
|
23
31
|
'X-Rosetteapi-Binding' => 'ruby',
|
24
|
-
'X-Rosetteapi-Binding-Version' => '1.
|
32
|
+
'X-Rosetteapi-Binding-Version' => '1.9.0' })
|
25
33
|
.to_return(status: 200, body: '{"test": "language"}', headers: {})
|
26
34
|
end
|
27
35
|
it 'test language' do
|
@@ -52,10 +60,10 @@ describe RosetteAPI do
|
|
52
60
|
headers: { 'Accept' => 'application/json',
|
53
61
|
'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
|
54
62
|
'Content-Type' => 'application/json',
|
55
|
-
'User-Agent' =>
|
63
|
+
'User-Agent' => @user_agent,
|
56
64
|
'X-Rosetteapi-Key' => '0123456789',
|
57
65
|
'X-Rosetteapi-Binding' => 'ruby',
|
58
|
-
'X-Rosetteapi-Binding-Version' => '1.
|
66
|
+
'X-Rosetteapi-Binding-Version' => '1.9.0' })
|
59
67
|
.to_return(status: 200, body: '{"test": "morphology/complete"}', headers: {})
|
60
68
|
end
|
61
69
|
it 'test morphology complete' do
|
@@ -73,10 +81,10 @@ describe RosetteAPI do
|
|
73
81
|
headers: { 'Accept' => 'application/json',
|
74
82
|
'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
|
75
83
|
'Content-Type' => 'application/json',
|
76
|
-
'User-Agent' =>
|
84
|
+
'User-Agent' => @user_agent,
|
77
85
|
'X-Rosetteapi-Key' => '0123456789',
|
78
86
|
'X-Rosetteapi-Binding' => 'ruby',
|
79
|
-
'X-Rosetteapi-Binding-Version' => '1.
|
87
|
+
'X-Rosetteapi-Binding-Version' => '1.9.0' })
|
80
88
|
.to_return(status: 200, body: '{"test": "morphology/compound-components"}', headers: {})
|
81
89
|
end
|
82
90
|
it 'test morphology compound components' do
|
@@ -94,10 +102,10 @@ describe RosetteAPI do
|
|
94
102
|
headers: { 'Accept' => 'application/json',
|
95
103
|
'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
|
96
104
|
'Content-Type' => 'application/json',
|
97
|
-
'User-Agent' =>
|
105
|
+
'User-Agent' => @user_agent,
|
98
106
|
'X-Rosetteapi-Key' => '0123456789',
|
99
107
|
'X-Rosetteapi-Binding' => 'ruby',
|
100
|
-
'X-Rosetteapi-Binding-Version' => '1.
|
108
|
+
'X-Rosetteapi-Binding-Version' => '1.9.0' })
|
101
109
|
.to_return(status: 200, body: '{"test": "morphology/han-readings"}', headers: {})
|
102
110
|
end
|
103
111
|
it 'test morphology han readings' do
|
@@ -115,10 +123,10 @@ describe RosetteAPI do
|
|
115
123
|
headers: { 'Accept' => 'application/json',
|
116
124
|
'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
|
117
125
|
'Content-Type' => 'application/json',
|
118
|
-
'User-Agent' =>
|
126
|
+
'User-Agent' => @user_agent,
|
119
127
|
'X-Rosetteapi-Key' => '0123456789',
|
120
128
|
'X-Rosetteapi-Binding' => 'ruby',
|
121
|
-
'X-Rosetteapi-Binding-Version' => '1.
|
129
|
+
'X-Rosetteapi-Binding-Version' => '1.9.0' })
|
122
130
|
.to_return(status: 200, body: '{"test": "morphology/parts-of-speech"}', headers: {})
|
123
131
|
end
|
124
132
|
it 'test morphology parts of speech' do
|
@@ -136,10 +144,10 @@ describe RosetteAPI do
|
|
136
144
|
headers: { 'Accept' => 'application/json',
|
137
145
|
'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
|
138
146
|
'Content-Type' => 'application/json',
|
139
|
-
'User-Agent' =>
|
147
|
+
'User-Agent' => @user_agent,
|
140
148
|
'X-Rosetteapi-Key' => '0123456789',
|
141
149
|
'X-Rosetteapi-Binding' => 'ruby',
|
142
|
-
'X-Rosetteapi-Binding-Version' => '1.
|
150
|
+
'X-Rosetteapi-Binding-Version' => '1.9.0' })
|
143
151
|
.to_return(status: 200, body: '{"test": "morphology/lemmas"}', headers: {})
|
144
152
|
end
|
145
153
|
it 'test morphology lemmas' do
|
@@ -157,10 +165,10 @@ describe RosetteAPI do
|
|
157
165
|
headers: { 'Accept' => 'application/json',
|
158
166
|
'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
|
159
167
|
'Content-Type' => 'application/json',
|
160
|
-
'User-Agent' =>
|
168
|
+
'User-Agent' => @user_agent,
|
161
169
|
'X-Rosetteapi-Key' => '0123456789',
|
162
170
|
'X-Rosetteapi-Binding' => 'ruby',
|
163
|
-
'X-Rosetteapi-Binding-Version' => '1.
|
171
|
+
'X-Rosetteapi-Binding-Version' => '1.9.0' })
|
164
172
|
.to_return(status: 200, body: '{"test": "entities"}', headers: {})
|
165
173
|
end
|
166
174
|
it 'test entities' do
|
@@ -179,10 +187,10 @@ describe RosetteAPI do
|
|
179
187
|
headers: { 'Accept' => 'application/json',
|
180
188
|
'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
|
181
189
|
'Content-Type' => 'application/json',
|
182
|
-
'User-Agent' =>
|
190
|
+
'User-Agent' => @user_agent,
|
183
191
|
'X-Rosetteapi-Key' => '0123456789',
|
184
192
|
'X-Rosetteapi-Binding' => 'ruby',
|
185
|
-
'X-Rosetteapi-Binding-Version' => '1.
|
193
|
+
'X-Rosetteapi-Binding-Version' => '1.9.0' })
|
186
194
|
.to_return(status: 200, body: '{"test": "entities"}', headers: {})
|
187
195
|
end
|
188
196
|
it 'test entities without qids' do
|
@@ -210,10 +218,10 @@ describe RosetteAPI do
|
|
210
218
|
headers: { 'Accept' => 'application/json',
|
211
219
|
'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
|
212
220
|
'Content-Type' => 'application/json',
|
213
|
-
'User-Agent' =>
|
221
|
+
'User-Agent' => @user_agent,
|
214
222
|
'X-Rosetteapi-Key' => '0123456789',
|
215
223
|
'X-Rosetteapi-Binding' => 'ruby',
|
216
|
-
'X-Rosetteapi-Binding-Version' => '1.
|
224
|
+
'X-Rosetteapi-Binding-Version' => '1.9.0' })
|
217
225
|
.to_return(status: 200, body: '{"test": "categories"}', headers: {})
|
218
226
|
end
|
219
227
|
it 'test categories' do
|
@@ -231,10 +239,10 @@ describe RosetteAPI do
|
|
231
239
|
headers: { 'Accept' => 'application/json',
|
232
240
|
'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
|
233
241
|
'Content-Type' => 'application/json',
|
234
|
-
'User-Agent' =>
|
242
|
+
'User-Agent' => @user_agent,
|
235
243
|
'X-Rosetteapi-Key' => '0123456789',
|
236
244
|
'X-Rosetteapi-Binding' => 'ruby',
|
237
|
-
'X-Rosetteapi-Binding-Version' => '1.
|
245
|
+
'X-Rosetteapi-Binding-Version' => '1.9.0' })
|
238
246
|
.to_return(status: 200, body: '{"test": "relationships"}', headers: {})
|
239
247
|
end
|
240
248
|
it 'test relationships' do
|
@@ -253,10 +261,10 @@ describe RosetteAPI do
|
|
253
261
|
headers: { 'Accept' => 'application/json',
|
254
262
|
'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
|
255
263
|
'Content-Type' => 'application/json',
|
256
|
-
'User-Agent' =>
|
264
|
+
'User-Agent' => @user_agent,
|
257
265
|
'X-Rosetteapi-Key' => '0123456789',
|
258
266
|
'X-Rosetteapi-Binding' => 'ruby',
|
259
|
-
'X-Rosetteapi-Binding-Version' => '1.
|
267
|
+
'X-Rosetteapi-Binding-Version' => '1.9.0' })
|
260
268
|
.to_return(status: 200, body: '{"test": "name-translation"}', headers: {})
|
261
269
|
end
|
262
270
|
it 'test name translation' do
|
@@ -280,10 +288,10 @@ describe RosetteAPI do
|
|
280
288
|
headers: { 'Accept' => 'application/json',
|
281
289
|
'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
|
282
290
|
'Content-Type' => 'application/json',
|
283
|
-
'User-Agent' =>
|
291
|
+
'User-Agent' => @user_agent,
|
284
292
|
'X-Rosetteapi-Key' => '0123456789',
|
285
293
|
'X-Rosetteapi-Binding' => 'ruby',
|
286
|
-
'X-Rosetteapi-Binding-Version' => '1.
|
294
|
+
'X-Rosetteapi-Binding-Version' => '1.9.0' })
|
287
295
|
.to_return(status: 200, body: '{"test": "name-similarity"}', headers: {})
|
288
296
|
end
|
289
297
|
it 'test name similarity' do
|
@@ -318,10 +326,10 @@ describe RosetteAPI do
|
|
318
326
|
headers: {'Accept' => 'application/json',
|
319
327
|
'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
|
320
328
|
'Content-Type' => 'application/json',
|
321
|
-
'User-Agent' =>
|
329
|
+
'User-Agent' => @user_agent,
|
322
330
|
'X-Rosetteapi-Key' => '0123456789',
|
323
331
|
'X-Rosetteapi-Binding' => 'ruby',
|
324
|
-
'X-Rosetteapi-Binding-Version' => '1.
|
332
|
+
'X-Rosetteapi-Binding-Version' => '1.9.0' })
|
325
333
|
.to_return(status: 200, body: '{"test": "name-deduplication"}', headers: {})
|
326
334
|
|
327
335
|
nothresh_json = { names: names.map(&:load_param) }.to_json
|
@@ -331,10 +339,10 @@ describe RosetteAPI do
|
|
331
339
|
headers: {'Accept' => 'application/json',
|
332
340
|
'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
|
333
341
|
'Content-Type' => 'application/json',
|
334
|
-
'User-Agent' =>
|
342
|
+
'User-Agent' => @user_agent,
|
335
343
|
'X-Rosetteapi-Key' => '0123456789',
|
336
344
|
'X-Rosetteapi-Binding' => 'ruby',
|
337
|
-
'X-Rosetteapi-Binding-Version' => '1.
|
345
|
+
'X-Rosetteapi-Binding-Version' => '1.9.0' })
|
338
346
|
.to_return(status: 200, body: '{"test": "name-deduplication"}', headers: {})
|
339
347
|
end
|
340
348
|
it 'test name deduplication' do
|
@@ -382,10 +390,10 @@ describe RosetteAPI do
|
|
382
390
|
headers: {'Accept' => 'application/json',
|
383
391
|
'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
|
384
392
|
'Content-Type' => 'application/json',
|
385
|
-
'User-Agent' =>
|
393
|
+
'User-Agent' => @user_agent,
|
386
394
|
'X-Rosetteapi-Key' => '0123456789',
|
387
395
|
'X-Rosetteapi-Binding' => 'ruby',
|
388
|
-
'X-Rosetteapi-Binding-Version' => '1.
|
396
|
+
'X-Rosetteapi-Binding-Version' => '1.9.0' })
|
389
397
|
.to_return(status: 200, body: '{"test": "transliteration"}', headers: {})
|
390
398
|
end
|
391
399
|
it 'test transliteration' do
|
@@ -415,10 +423,10 @@ describe RosetteAPI do
|
|
415
423
|
headers: { 'Accept' => 'application/json',
|
416
424
|
'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
|
417
425
|
'Content-Type' => 'application/json',
|
418
|
-
'User-Agent' =>
|
426
|
+
'User-Agent' => @user_agent,
|
419
427
|
'X-Rosetteapi-Key' => '0123456789',
|
420
428
|
'X-Rosetteapi-Binding' => 'ruby',
|
421
|
-
'X-Rosetteapi-Binding-Version' => '1.
|
429
|
+
'X-Rosetteapi-Binding-Version' => '1.9.0' })
|
422
430
|
.to_return(status: 200, body: '{"test": "tokens"}', headers: {})
|
423
431
|
end
|
424
432
|
it 'test tokens' do
|
@@ -436,10 +444,10 @@ describe RosetteAPI do
|
|
436
444
|
headers: { 'Accept' => 'application/json',
|
437
445
|
'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
|
438
446
|
'Content-Type' => 'application/json',
|
439
|
-
'User-Agent' =>
|
447
|
+
'User-Agent' => @user_agent,
|
440
448
|
'X-Rosetteapi-Key' => '0123456789',
|
441
449
|
'X-Rosetteapi-Binding' => 'ruby',
|
442
|
-
'X-Rosetteapi-Binding-Version' => '1.
|
450
|
+
'X-Rosetteapi-Binding-Version' => '1.9.0' })
|
443
451
|
.to_return(status: 200, body: '{"test": "topics"}', headers: {})
|
444
452
|
end
|
445
453
|
it 'test topics' do
|
@@ -457,10 +465,10 @@ describe RosetteAPI do
|
|
457
465
|
headers: { 'Accept' => 'application/json',
|
458
466
|
'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
|
459
467
|
'Content-Type' => 'application/json',
|
460
|
-
'User-Agent' =>
|
468
|
+
'User-Agent' => @user_agent,
|
461
469
|
'X-Rosetteapi-Key' => '0123456789',
|
462
470
|
'X-Rosetteapi-Binding' => 'ruby',
|
463
|
-
'X-Rosetteapi-Binding-Version' => '1.
|
471
|
+
'X-Rosetteapi-Binding-Version' => '1.9.0' })
|
464
472
|
.to_return(status: 200, body: '{"test": "sentences"}', headers: {})
|
465
473
|
end
|
466
474
|
it 'test sentences' do
|
@@ -476,7 +484,7 @@ describe RosetteAPI do
|
|
476
484
|
stub_request(:get, 'https://api.rosette.com/rest/v1/info')
|
477
485
|
.with(headers: { 'Accept' => '*/*',
|
478
486
|
'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
|
479
|
-
'User-Agent' =>
|
487
|
+
'User-Agent' => @user_agent,
|
480
488
|
'X-Rosetteapi-Key' => '0123456789' })
|
481
489
|
.to_return(status: 200, body: '{"test": "info"}', headers: {})
|
482
490
|
end
|
@@ -491,7 +499,7 @@ describe RosetteAPI do
|
|
491
499
|
stub_request(:get, 'https://api.rosette.com/rest/v1/ping')
|
492
500
|
.with(headers: { 'Accept' => '*/*',
|
493
501
|
'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
|
494
|
-
'User-Agent' =>
|
502
|
+
'User-Agent' => @user_agent,
|
495
503
|
'X-Rosetteapi-Key' => '0123456789' })
|
496
504
|
.to_return(status: 200, body: '{"test": "ping"}', headers: {})
|
497
505
|
end
|
@@ -508,10 +516,10 @@ describe RosetteAPI do
|
|
508
516
|
headers: { 'Accept' => 'application/json',
|
509
517
|
'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
|
510
518
|
'Content-Type' => 'application/json',
|
511
|
-
'User-Agent' =>
|
519
|
+
'User-Agent' => @user_agent,
|
512
520
|
'X-Rosetteapi-Key' => '0123456789',
|
513
521
|
'X-Rosetteapi-Binding' => 'ruby',
|
514
|
-
'X-Rosetteapi-Binding-Version' => '1.
|
522
|
+
'X-Rosetteapi-Binding-Version' => '1.9.0',
|
515
523
|
'X-RosetteApi-App' => 'ruby-app' })
|
516
524
|
.to_return(status: 200, body: '{"test": "language"}', headers: {})
|
517
525
|
end
|
@@ -529,7 +537,7 @@ describe RosetteAPI do
|
|
529
537
|
stub_request(:get, 'https://api.rosette.com/rest/v1/info')
|
530
538
|
.with(headers: { 'Accept' => '*/*',
|
531
539
|
'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
|
532
|
-
'User-Agent' =>
|
540
|
+
'User-Agent' => @user_agent,
|
533
541
|
'X-Rosetteapi-Key' => '0123456789' })
|
534
542
|
.to_return(status: 409, body: '{"code": "incompatibleClientVersion"}', headers: {})
|
535
543
|
end
|
@@ -545,10 +553,10 @@ describe RosetteAPI do
|
|
545
553
|
headers: { 'Accept' => 'application/json',
|
546
554
|
'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
|
547
555
|
'Content-Type' => 'application/json',
|
548
|
-
'User-Agent' =>
|
556
|
+
'User-Agent' => @user_agent,
|
549
557
|
'X-Rosetteapi-Key' => '0123456789',
|
550
558
|
'X-Rosetteapi-Binding' => 'ruby',
|
551
|
-
'X-Rosetteapi-Binding-Version' => '1.
|
559
|
+
'X-Rosetteapi-Binding-Version' => '1.9.0' })
|
552
560
|
.to_return(status: 200, body: '{"test": "language"}', headers: {})
|
553
561
|
end
|
554
562
|
it 'test text_embedding' do
|
@@ -566,10 +574,10 @@ describe RosetteAPI do
|
|
566
574
|
headers: { 'Accept' => 'application/json',
|
567
575
|
'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3',
|
568
576
|
'Content-Type' => 'application/json',
|
569
|
-
'User-Agent' =>
|
577
|
+
'User-Agent' => @user_agent,
|
570
578
|
'X-Rosetteapi-Key' => '0123456789',
|
571
579
|
'X-Rosetteapi-Binding' => 'ruby',
|
572
|
-
'X-Rosetteapi-Binding-Version' => '1.
|
580
|
+
'X-Rosetteapi-Binding-Version' => '1.9.0' })
|
573
581
|
.to_return(status: 200, body: '{"test": "language"}', headers: {})
|
574
582
|
end
|
575
583
|
it 'test syntax_dependencies' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rosette_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Basis Technology Corp
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-01-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubysl-securerandom
|
@@ -63,7 +63,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
63
63
|
version: '0'
|
64
64
|
requirements: []
|
65
65
|
rubyforge_project:
|
66
|
-
rubygems_version: 2.
|
66
|
+
rubygems_version: 2.7.4
|
67
67
|
signing_key:
|
68
68
|
specification_version: 2
|
69
69
|
summary: Rosette API gem that supports multilingual text-analytics.
|