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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fb740f7faa70a0e3eac16d82927d02c4fbd35cae
4
- data.tar.gz: dce53f0252457ad79ce510642ca3a0d51ffbab87
3
+ metadata.gz: af0bce44b8c09c10bc8f7745dbf0ec29235b6838
4
+ data.tar.gz: 1af948f7d4ff48f51c2c3f49d3b94adc608ae98c
5
5
  SHA512:
6
- metadata.gz: 99bbb2e9ff6b37852ab1ae7373d212fbe215c2d4b7de0d61d0e902abd15a4db9b550834b198938becf4b0a03ac306c3416d35f8ecb193b80f122b76879819363
7
- data.tar.gz: 718d244f2b8e6763810ec5ccd65e5242be9246851c2f2cbfdd468f0a4e2421231e6c96656fb10924e23a2c59799f5282007964e368d96adac6177b5abd875433
6
+ metadata.gz: 37e174a7b2d242951af8be9c85ff2807b25a29048ac8e035db8b01b6dd7d10f75143c5b3718fe61abe39ee913809487625f36d1858b868ce3ff09268c0b64059
7
+ data.tar.gz: 0f350f583b068884a56178c0e206aadb06b6b0019e1afc549e4841fc57578bea2386a8a5ac5b73b3b0c303f6a07f4fa24874ee50c2c8d6c5a6d3225a7f527e26
data/.gitignore CHANGED
@@ -2,3 +2,4 @@ config/app_config.yml
2
2
  doc/
3
3
  .yardoc/
4
4
  *.gem
5
+ Gemfile.lock
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- aylien_text_api (0.6.0)
4
+ aylien_text_api (0.6.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -28,4 +28,4 @@ DEPENDENCIES
28
28
  webmock (~> 1.20)
29
29
 
30
30
  BUNDLED WITH
31
- 1.11.2
31
+ 1.12.4
@@ -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,5 +13,5 @@
13
13
  # limitations under the License.
14
14
 
15
15
  module AylienTextApi
16
- VERSION = "0.6.0" unless defined? AylienTextApi::VERSION
16
+ VERSION = "0.6.1" unless defined? AylienTextApi::VERSION
17
17
  end
@@ -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.0
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-04-28 00:00:00.000000000 Z
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.1
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