hypertrack 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/hypertrack/api_client.rb +13 -7
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3decfc7e51d6eb3cca0a4e953ba5d345e8e7fb1222ef8a0c66a717802f54ece5
4
- data.tar.gz: ff9690522022b09647069016ac3e33f69741d9dc74413867af0f51cb98940594
3
+ metadata.gz: 7cd33ffb3022506660ade678e859d8f4a822f5c98fa5ec8c6653a4373e2ca3b6
4
+ data.tar.gz: 5d2e0688ca132a59dab6ac4d29121db107fce5ee1b8807a9a624b0ae56aeb4f9
5
5
  SHA512:
6
- metadata.gz: 487c3ef0d480cc42fc2b37747261ec16f6ce3c17246fc1486d6db4f0f92155314c5d3d24935181aa5eee6fa7f8f15605583139b0dea50e2da16862c0aa19b6f9
7
- data.tar.gz: 1ad26f478831f666fc9e88e6ab27654d01582667da258fa14e7896b69d91c906f2e7c2e62affd08082ea0c9cfeb4d12c9b64a6952979b476c2ed4398bd64bc26
6
+ metadata.gz: bd650d36e7af7bb4eaa6d9ecbac6010e2dc1469fd1a05ba0316eddfad9cfcf6a3365d31eda1d53d30db5f0be903bd1511db4d78d111f5824cdec1fbf6b148cf6
7
+ data.tar.gz: b1cf916148189ccc7e250c3fb86019d96a19bea83b733717dc93e88a119dae8a67d40ed36abafec24fd88325d876d910afdba5111345579e9e3b8ed0d1188354
@@ -65,14 +65,20 @@ module HyperTrack
65
65
  request_object
66
66
  end
67
67
 
68
- # To-Do: Add a timeout
69
68
  def make_request(api_uri, request_object)
70
- conn = Net::HTTP.new api_uri.host, api_uri.port
71
- conn.use_ssl = api_uri.scheme == 'https'
72
- conn.verify_mode = OpenSSL::SSL::VERIFY_PEER
73
- conn.cert_store = OpenSSL::X509::Store.new
74
- conn.cert_store.set_default_paths
75
- parse_response(conn.request(request_object))
69
+ parse_response(
70
+ Net::HTTP.start(
71
+ api_uri.host,
72
+ api_uri.port,
73
+ :read_timeout => ENV['NET_TIMEOUT'] || 5,
74
+ :use_ssl => api_uri.scheme == 'https',
75
+ :verify_mode => OpenSSL::SSL::VERIFY_PEER
76
+ ) { |conn|
77
+ conn.cert_store = OpenSSL::X509::Store.new
78
+ conn.cert_store.set_default_paths
79
+ conn.request(request_object)
80
+ }
81
+ )
76
82
  end
77
83
 
78
84
  def parse_response(response)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hypertrack
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Utsav Kesharwani