access_watch 0.0.3 → 0.0.4

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: cad2bcef8d760ae8b64bdf959c7d481f5ac0be55
4
- data.tar.gz: 49b160e978b63a7abd58e87522eabc994d55464c
3
+ metadata.gz: fb430f02e966b18abe67fe3e084f3afc2f238e9c
4
+ data.tar.gz: 88fccc2487ad1bc736225764d28ae27458d2e54f
5
5
  SHA512:
6
- metadata.gz: cd37080cf88ccc657c991061105faa6655da6844e9524fc145b5342477803edb49ac78b86e0628ce10bb2c2d9d90d2323bb8565bf53de2359440c402e7e4edfd
7
- data.tar.gz: 54167e4c67cefeb07046c20d8bb59da8072a780f4eb069f1c67ef7c4fd38df6832eed1b183ec617eb9f537885f040040b080fbd1a6cd76c5d315b5511186f1ce
6
+ metadata.gz: 58e3a063a475136a229d2381cb0f1799e547df51c175cfe8210aae09c1baf323cb381bd7e400330104bf260ab30496601546e9eb9aa8222be5d654b278e7fdc2
7
+ data.tar.gz: d4a8379a77376565e9a8751d3bb6b997228d070ac9eccbcde4833252a6343997c129d316052b0cce6c5b6621dc47582e20bd636d3faf881beaf22cfeba55db8a
@@ -5,10 +5,11 @@ require "openssl"
5
5
 
6
6
  module AccessWatch
7
7
  class Client
8
- attr_reader :api_key, :api_secret, :api_endpoint
8
+ attr_reader :api_key, :api_secret, :api_endpoint, :api_timeout
9
9
 
10
10
  def initialize(options)
11
11
  @api_secret = options[:api_secret]
12
+ @api_timeout = options[:api_timeout] || 1
12
13
  @api_key = options[:api_key] or raise "AccessWatch api_key is mandatory."
13
14
  @api_endpoint = options[:api_endpoint] || "https://access.watch/api/1.0/"
14
15
  end
@@ -43,6 +44,7 @@ module AccessWatch
43
44
 
44
45
  def http(uri)
45
46
  http = Net::HTTP.new(uri.host, uri.port)
47
+ http.open_timeout = api_timeout
46
48
  if uri.scheme == HTTPS
47
49
  http.verify_mode = OpenSSL::SSL::VERIFY_PEER
48
50
  http.ca_file = CERTIFICATE_AUTHORITIES_PATH
@@ -1,3 +1,3 @@
1
1
  module AccessWatch
2
- VERSION = "0.0.3".freeze
2
+ VERSION = "0.0.4".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: access_watch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexis Bernard