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 +4 -4
- data/lib/access_watch/client.rb +3 -1
- data/lib/access_watch/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fb430f02e966b18abe67fe3e084f3afc2f238e9c
|
4
|
+
data.tar.gz: 88fccc2487ad1bc736225764d28ae27458d2e54f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 58e3a063a475136a229d2381cb0f1799e547df51c175cfe8210aae09c1baf323cb381bd7e400330104bf260ab30496601546e9eb9aa8222be5d654b278e7fdc2
|
7
|
+
data.tar.gz: d4a8379a77376565e9a8751d3bb6b997228d070ac9eccbcde4833252a6343997c129d316052b0cce6c5b6621dc47582e20bd636d3faf881beaf22cfeba55db8a
|
data/lib/access_watch/client.rb
CHANGED
@@ -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
|
data/lib/access_watch/version.rb
CHANGED