matterhorn_whymper 0.2.0 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/matterhorn/endpoint.rb +2 -1
- data/lib/matterhorn/http_client.rb +11 -6
- data/lib/matterhorn_whymper/version.rb +1 -1
- data/lib/matterhorn_whymper.rb +3 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
M2ExMTYzYjRiZTg1YjQzZGY4NmI5MDhjOTIwNDE3YWQ2ODgyYTk3Ng==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
MGVhNWYyNmM1MzQ4ODRhYmIwZTYxMDZlYTA3NzMzYzNjMmUyZmRlOQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MTNiNDI2Mjg0YzY4OWViYWMzMWFhNWNjZTRmMzVlNjU4YzhiZjYwOTEyNGU5
|
10
|
+
NTYzNDg1NTIyZDI5NDczYTY4ODNiZDMxMzFiYzZiNzJjMzgxNDg4MzgzOWM1
|
11
|
+
NDYzOGZjMmNkZjAwN2RmYmYzYWFkYzUwNmRkNjM5OWMzZDg1N2I=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MmY2NTA4Y2NiZDFmYjM4YjAyYjk1NGNjOGZhZjEzZWRkZGQ2MTM3ZmE2MTYx
|
14
|
+
Nzc3Nzc1NDAyOTM2NmEyZDlkNWViMWYxNDM2MmY3ZTBhMGEyN2NhNTI3NGIx
|
15
|
+
NTlmNWMxMzFlN2UzNGQzNjc4ZDc3NWJmMWFhMTUwNmVhNTliZGI=
|
data/lib/matterhorn/endpoint.rb
CHANGED
@@ -13,16 +13,17 @@ module Matterhorn
|
|
13
13
|
|
14
14
|
# ------------------------------------------------------------------------------- attributes ---
|
15
15
|
|
16
|
-
attr_reader :base_uri, :host, :port, :ssl
|
16
|
+
attr_reader :base_uri, :host, :port, :ssl, :timeout
|
17
17
|
|
18
18
|
|
19
19
|
# --------------------------------------------------------------------------- initialization ---
|
20
20
|
|
21
|
-
def initialize(base_uri)
|
22
|
-
@base_uri
|
23
|
-
@host
|
24
|
-
@port
|
25
|
-
@ssl
|
21
|
+
def initialize(base_uri, http_timeout = nil)
|
22
|
+
@base_uri = URI.parse(base_uri)
|
23
|
+
@host = @base_uri.host
|
24
|
+
@port = @base_uri.port
|
25
|
+
@ssl = @port == 443 ? true : false
|
26
|
+
@timeout = http_timeout
|
26
27
|
end
|
27
28
|
|
28
29
|
|
@@ -62,6 +63,10 @@ module Matterhorn
|
|
62
63
|
return @http_socket if !@http_socket.nil? && @http_socket.started?
|
63
64
|
@http_socket = Net::HTTP.new(host, port)
|
64
65
|
@http_socket.use_ssl = ssl
|
66
|
+
if !timeout.nil?
|
67
|
+
@http_socket.open_timeout = timeout
|
68
|
+
@http_socket.read_timeout = timeout
|
69
|
+
end
|
65
70
|
@http_socket.start
|
66
71
|
end
|
67
72
|
|
@@ -5,7 +5,7 @@ module MatterhornWhymper
|
|
5
5
|
|
6
6
|
# -------------------------------------------------------------------------- const definitions ---
|
7
7
|
|
8
|
-
VERSION = "0.2.
|
8
|
+
VERSION = "0.2.2"
|
9
9
|
|
10
10
|
|
11
11
|
end # -------------------------------------------------------------------- end MatterhornWhymper ---
|
data/lib/matterhorn_whymper.rb
CHANGED
@@ -36,6 +36,7 @@ module MatterhornWhymper
|
|
36
36
|
require 'logger'
|
37
37
|
self.logger = Logger.new(STDOUT)
|
38
38
|
end
|
39
|
+
self.configuration.http_timeout = nil
|
39
40
|
yield(configuration) if block_given?
|
40
41
|
end
|
41
42
|
|
@@ -47,7 +48,8 @@ module MatterhornWhymper
|
|
47
48
|
|
48
49
|
# ------------------------------------------------------------------------------- attributes ---
|
49
50
|
|
50
|
-
attr_accessor :system_account_user, :system_account_password, :system_domain, :system_protocol
|
51
|
+
attr_accessor :system_account_user, :system_account_password, :system_domain, :system_protocol,
|
52
|
+
:http_timeout
|
51
53
|
|
52
54
|
|
53
55
|
# --------------------------------------------------------------------------------- methodes ---
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: matterhorn_whymper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Fritschi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-07-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: multipart-post
|