aylien_text_api 0.6.0 → 0.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/Gemfile.lock +2 -2
- data/lib/aylien_text_api/connection.rb +7 -5
- data/lib/aylien_text_api/version.rb +1 -1
- data/spec/lib/aylien_text_api/rate_limits.rb +6 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: af0bce44b8c09c10bc8f7745dbf0ec29235b6838
|
4
|
+
data.tar.gz: 1af948f7d4ff48f51c2c3f49d3b94adc608ae98c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 37e174a7b2d242951af8be9c85ff2807b25a29048ac8e035db8b01b6dd7d10f75143c5b3718fe61abe39ee913809487625f36d1858b868ce3ff09268c0b64059
|
7
|
+
data.tar.gz: 0f350f583b068884a56178c0e206aadb06b6b0019e1afc549e4841fc57578bea2386a8a5ac5b73b3b0c303f6a07f4fa24874ee50c2c8d6c5a6d3225a7f527e26
|
data/.gitignore
CHANGED
data/Gemfile.lock
CHANGED
@@ -42,12 +42,14 @@ module AylienTextApi
|
|
42
42
|
def request!
|
43
43
|
Net::HTTP.start(@uri.host, @uri.port, use_ssl: (@uri.scheme == 'https')) do |http|
|
44
44
|
response = http.request(@request)
|
45
|
+
|
46
|
+
@rate_limits = {
|
47
|
+
limit: response["X-RateLimit-Limit"],
|
48
|
+
remaining: response["X-RateLimit-Remaining"],
|
49
|
+
reset: response["X-RateLimit-Reset"]
|
50
|
+
}
|
51
|
+
|
45
52
|
if response.kind_of?(Net::HTTPSuccess)
|
46
|
-
@rate_limits = {
|
47
|
-
limit: response["X-RateLimit-Limit"],
|
48
|
-
remaining: response["X-RateLimit-Remaining"],
|
49
|
-
reset: response["X-RateLimit-Reset"]
|
50
|
-
}
|
51
53
|
JSON.parse(response.body, :symbolize_names => true)
|
52
54
|
else
|
53
55
|
klass = AylienTextApi::Error::ERRORS[response.code.to_i]
|
@@ -13,14 +13,18 @@ describe "RateLimits header parameter" do
|
|
13
13
|
it "should be nil with unauthenticated client" do
|
14
14
|
VCR.use_cassette('rate_limits_with_unauthenticated_client') do
|
15
15
|
result = @unauthenticated_client.rate_limits
|
16
|
-
result.must_be_nil
|
16
|
+
result[:limit].must_be_nil
|
17
|
+
result[:remaining].must_be_nil
|
18
|
+
result[:reset].must_be_nil
|
17
19
|
end
|
18
20
|
end
|
19
21
|
|
20
22
|
it "should be nil with invalid client" do
|
21
23
|
VCR.use_cassette('rate_limits_with_invalid_client') do
|
22
24
|
result = @invalid_client.rate_limits
|
23
|
-
result.must_be_nil
|
25
|
+
result[:limit].must_be_nil
|
26
|
+
result[:remaining].must_be_nil
|
27
|
+
result[:reset].must_be_nil
|
24
28
|
end
|
25
29
|
end
|
26
30
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aylien_text_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aylien Inc.
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-
|
12
|
+
date: 2016-05-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
@@ -234,7 +234,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
234
234
|
version: '0'
|
235
235
|
requirements: []
|
236
236
|
rubyforge_project:
|
237
|
-
rubygems_version: 2.6.
|
237
|
+
rubygems_version: 2.6.4
|
238
238
|
signing_key:
|
239
239
|
specification_version: 4
|
240
240
|
summary: AYLIEN Text Analysis API is a package of Natural Language Processing and
|