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 CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- OTVmYWFiNTFiYTY3ZWFiMDI4YWJlMWYxYzdkZTUxYmM5OTk3NDFhMw==
4
+ M2ExMTYzYjRiZTg1YjQzZGY4NmI5MDhjOTIwNDE3YWQ2ODgyYTk3Ng==
5
5
  data.tar.gz: !binary |-
6
- M2U5MWJhMWExNWFjYWMwZGZhMzExNTQ0MmIxNDIwZDllZDVhNTU5Nw==
6
+ MGVhNWYyNmM1MzQ4ODRhYmIwZTYxMDZlYTA3NzMzYzNjMmUyZmRlOQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- NjhhYzBmN2M1YjAwYzgwNjhiMDlmMTM5ZGJmYjczZWU1MjEwNWM4ODQyYjEw
10
- Y2IwNjUwM2RmMWMxZWU3YjM5ZTE3ODg3YzhmZDA5YjVjMDc0ODZiMzQyNzFh
11
- MTQ0MWU3YTNhNDcyMmY0MWQ2ZDRlZTc3OWMxNTc4ODQ2OTFlZDI=
9
+ MTNiNDI2Mjg0YzY4OWViYWMzMWFhNWNjZTRmMzVlNjU4YzhiZjYwOTEyNGU5
10
+ NTYzNDg1NTIyZDI5NDczYTY4ODNiZDMxMzFiYzZiNzJjMzgxNDg4MzgzOWM1
11
+ NDYzOGZjMmNkZjAwN2RmYmYzYWFkYzUwNmRkNjM5OWMzZDg1N2I=
12
12
  data.tar.gz: !binary |-
13
- NzgyYWIyMDQ5ZjEwMDk4Yjc0Y2Y1NDg5ZTJhYmZjZDJhNzJkNDhhNWQzZjA2
14
- MTlkYjk0NmFhMmMxYjgyYTRiMWJmMzAzOGE5NDM4ZGQ0MDU1YzI2M2YxN2Yx
15
- MzhjMDE1MGM4ZDdmZTYzMmRlMWEyNGI4MGE2MGE1ZjIyZWU2YmI=
13
+ MmY2NTA4Y2NiZDFmYjM4YjAyYjk1NGNjOGZhZjEzZWRkZGQ2MTM3ZmE2MTYx
14
+ Nzc3Nzc1NDAyOTM2NmEyZDlkNWViMWYxNDM2MmY3ZTBhMGEyN2NhNTI3NGIx
15
+ NTlmNWMxMzFlN2UzNGQzNjc4ZDc3NWJmMWFhMTUwNmVhNTliZGI=
@@ -37,7 +37,8 @@ module Matterhorn
37
37
 
38
38
  def initialize
39
39
  @http_client = Matterhorn::HttpClient.new(
40
- MatterhornWhymper.configuration.uri
40
+ MatterhornWhymper.configuration.uri,
41
+ MatterhornWhymper.configuration.http_timeout
41
42
  )
42
43
  end
43
44
 
@@ -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 = URI.parse(base_uri)
23
- @host = @base_uri.host
24
- @port = @base_uri.port
25
- @ssl = @port == 443 ? true : false
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.0"
8
+ VERSION = "0.2.2"
9
9
 
10
10
 
11
11
  end # -------------------------------------------------------------------- end MatterhornWhymper ---
@@ -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.0
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-06-27 00:00:00.000000000 Z
11
+ date: 2014-07-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: multipart-post