berbix 0.0.7 → 0.0.8

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/berbix.rb +12 -1
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e6256df46bb179723f2707ce437068058b7422d493e4fbb6e882824d3de12c91
4
- data.tar.gz: e62c31fb105893010ac0814c876412b214f66f4eaf001afe594c797648c6da5b
3
+ metadata.gz: a0ca2b2ab54b6feeb8b5541a0ffcc09b1dbe8a8f654ddbe0084229090f6ef486
4
+ data.tar.gz: 32e96587ed52dcc545e4a1d2577da4ac42c0438bbf1fdaf14ace9a48d1f6c999
5
5
  SHA512:
6
- metadata.gz: c2037dcff8958a90f5ddc79cb8d7ad292401a51834fb1a5e5237821ba984e5e6e3cb9963f57d7c7e9c89030838c6583d2dd9dc6c7b88d8e7b50d26d36f433f19
7
- data.tar.gz: d168dc65d635a55391186a1338f5f29d83f48d6bbef675235bcfbc7b1be0737153379cfe28c155acb056d4c14fbbc731397386b7570f63a5933babcb8d9fe515
6
+ metadata.gz: b32079aaa304876ee08115b1af4def5ff1a47f54d3418ece08880261a30fed30dfde219ddfe7abd01972552fdb0049d4a785872c46e7494829a54b33544920e6
7
+ data.tar.gz: abf4c1c34bfde3f072d0f935a933845cab6097c4e0f97daecfa6d0eb30040a9f8a3f1378d0a433db77ce8c2faed287422bbb0366c8482a6eec98bd7014d0d739
@@ -3,7 +3,7 @@ require 'json'
3
3
 
4
4
  module Berbix
5
5
 
6
- SDK_VERSION = '0.0.7'
6
+ SDK_VERSION = '0.0.8'
7
7
  CLOCK_DRIFT = 300
8
8
 
9
9
  class HTTPClient
@@ -13,6 +13,15 @@ module Berbix
13
13
  end
14
14
 
15
15
  class NetHTTPClient < HTTPClient
16
+ attr_reader :read_timeout
17
+ attr_reader :open_timeout
18
+
19
+ def initialize(opts={})
20
+ # Sets the defaults to align with the Net::HTTP defaults
21
+ @open_timeout = opts[:open_timeout] || 60
22
+ @read_timeout = opts[:read_timeout] || 60
23
+ end
24
+
16
25
  def request(method, url, headers, opts={})
17
26
  uri = URI(url)
18
27
  klass = if method == :post
@@ -33,6 +42,8 @@ module Berbix
33
42
  end
34
43
  cli = Net::HTTP.new(uri.host, uri.port).tap do |http|
35
44
  http.use_ssl = true
45
+ http.read_timeout = read_timeout
46
+ http.open_timeout = open_timeout
36
47
  end
37
48
  res = cli.request(req)
38
49
  code = res.code.to_i
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: berbix
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Levine