xhash_client 0.3.5 → 0.3.6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 51cfc749e3e0033b38f6c080a3b879cb23d529d4ff2b18be8b51bb00dbaebe01
4
- data.tar.gz: a63139c2bfe211afd2e9071577b791e194dbc5fe66512d8da5973bb8a8ddeaf4
3
+ metadata.gz: 7a9138a8aa4d278ebdf067d812d06a9f87ef30390ee0f86a33fb07f49f140dd4
4
+ data.tar.gz: 4be4b3647acfa20a10b42ab3b9b0c6f0548825d2d5a2120916b8ddc000f62e3f
5
5
  SHA512:
6
- metadata.gz: 8aa84976a5e204f2357f4be92aca1292369d8f0dab40fa89ef8e9cc4b7cdc11e7230cda637df725d5a3b7e07f4713b44bc0a7e6085d3a81201ce23da063f1df2
7
- data.tar.gz: 64fdd3eaa5c9276b8ff27411e641e500b185d25041f672e71d7c6333019e9d40fc2e9950964a240b90af2b6f9dc979400591ed8a956a3341b6609b336e0c8a0c
6
+ metadata.gz: e43d879d10faf34886641bc1e0ccd20387e92017c0818ad8b77306b403f71182ac8e0e46890ec2a04febb7625f58e49bf460b7df164f915dfeb0fff7c61df95f
7
+ data.tar.gz: 3d13a691f4e44acc2958837ce3094f388409504dd1fbaee8c8c2d38d98f8ad82f7b25a1ee9f7f57e7a2b1450080e3402169536adef82f8a9fee6eac49bd338e6
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- xhash_client (0.3.4)
4
+ xhash_client (0.3.5)
5
5
  httparty (~> 0.16.0)
6
6
  json (~> 2.0)
7
7
 
@@ -40,4 +40,12 @@ module Xhash
40
40
  def self.api_key=(api_key)
41
41
  @api_key = api_key
42
42
  end
43
+
44
+ def self.timeout
45
+ @timeout
46
+ end
47
+
48
+ def self.timeout=(timeout)
49
+ @timeout = timeout
50
+ end
43
51
  end
@@ -23,5 +23,13 @@ module Xhash
23
23
  def self.api_key=(api_key)
24
24
  @api_key = api_key
25
25
  end
26
+
27
+ def self.timeout
28
+ @timeout
29
+ end
30
+
31
+ def self.api_key=(timeout)
32
+ @timeout = timeout
33
+ end
26
34
  end
27
35
  end
@@ -11,7 +11,7 @@ module Xhash
11
11
 
12
12
  def api_get(url:, headers: {})
13
13
  custom_headers = headers.merge(default_headers)
14
- response = HTTParty.get(Xhash.api_base + url, headers: custom_headers)
14
+ response = HTTParty.get(Xhash.api_base + url, headers: custom_headers, timeout: Xhash.timeout)
15
15
 
16
16
  raise Xhash::Error.new(response) unless response_ok?(response)
17
17
 
@@ -28,7 +28,7 @@ module Xhash
28
28
  response =
29
29
  HTTParty.post(
30
30
  Xhash.api_base + url,
31
- body: body.to_json, headers: custom_headers
31
+ body: body.to_json, headers: custom_headers, timeout: Xhash.timeout
32
32
  )
33
33
 
34
34
  raise Xhash::Error.new(response) unless response_ok?(response)
@@ -46,7 +46,7 @@ module Xhash
46
46
  response =
47
47
  HTTParty.post(
48
48
  Xhash.api_base + url,
49
- multipart: true, body: body, headers: custom_headers
49
+ multipart: true, body: body, headers: custom_headers, timeout: Xhash.timeout
50
50
  )
51
51
 
52
52
  raise Xhash::Error.new(response) unless response_ok?(response)
@@ -1,3 +1,3 @@
1
1
  module Xhash
2
- VERSION = '0.3.5'
2
+ VERSION = '0.3.6'
3
3
  end
@@ -6,4 +6,7 @@ require 'xhash'
6
6
 
7
7
  SimpleCov.start { add_filter '/spec/' }
8
8
 
9
- RSpec.configure { |config| config.before(:all) { Xhash.api_key = 'api_key' } }
9
+ RSpec.configure { |config| config.before(:all) {
10
+ Xhash.api_key = 'api_key'
11
+ Xhash.timeout = 10
12
+ } }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xhash_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.5
4
+ version: 0.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yellowme