heartcheck-webservice 1.2.0 → 1.3.0

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: 4aa666913efcada0341d6151bc41d38a2cbe63a4
4
- data.tar.gz: 6729a0c04654b0e3da26b1e51292cf9607319649
3
+ metadata.gz: 79a13b0ede2ae23c8c063af700c379945c14b34c
4
+ data.tar.gz: f511f43f82561f8ca7c90c7fa2815c2de7c54c10
5
5
  SHA512:
6
- metadata.gz: 2ca3cb3fa2a895403ca0e84b9c2625367ed65ce80ba55d421790cbe95565c3bc8b87171c7692ced56b3879c8e890901ad4c7a3b4856bc313375171b71dcac0d3
7
- data.tar.gz: 5f595137b7a1cb0c533e63e8b40a693bce902505b208ce2e8560f2e5405382738ab08bd43eb6abe4fc531dd0ca3c32080024e5f3e8a24c1ffcb0681d09861cf4
6
+ metadata.gz: cf0abaf51457d1912beb81150b1489b11de8397533466251fc260982d0c7253a6a58284c510e791481455b6866766160b3ead63b5a3575e67a3054604a2b4278
7
+ data.tar.gz: dede599b16655bb8f566abc73eee8bf86f8bc92603a48fd534fa8e175f9bfeafb288c3596344a2405fade5d080da5416a603d96c7771ac201e6e5cb2b6742128
@@ -82,7 +82,9 @@ module Heartcheck
82
82
  Heartcheck::Webservice::HttpClient.new(service[:url],
83
83
  service[:proxy],
84
84
  service[:ignore_ssl_cert],
85
- service[:headers]).get
85
+ service[:headers],
86
+ service[:open_timeout],
87
+ service[:read_timeout]).get
86
88
  end
87
89
  end
88
90
  end
@@ -3,9 +3,9 @@ module Heartcheck
3
3
  module Webservice
4
4
  # Http Client
5
5
  class HttpClient
6
- attr_reader :uri, :http, :proxy, :headers, :request
6
+ attr_reader :uri, :http, :proxy, :headers, :request, :open_timeout, :read_timeout
7
7
 
8
- def initialize(url, proxy, ignore_ssl_cert, headers)
8
+ def initialize(url, proxy, ignore_ssl_cert, headers, open_timeout = nil, read_timeout = nil)
9
9
  @uri = URI(url)
10
10
  @headers = headers || {}
11
11
  @proxy = URI(proxy) if proxy
@@ -13,6 +13,8 @@ module Heartcheck
13
13
  @http = Net::HTTP.new(@uri.host, @uri.port, proxy_host, proxy_port)
14
14
  @http.use_ssl = @uri.scheme == 'https'
15
15
  @http.verify_mode = OpenSSL::SSL::VERIFY_NONE if ignore_ssl_cert
16
+ @http.open_timeout = open_timeout if open_timeout
17
+ @http.read_timeout = read_timeout if read_timeout
16
18
  end
17
19
 
18
20
  def get
@@ -2,6 +2,6 @@
2
2
  module Heartcheck
3
3
  # gem version
4
4
  module Webservice
5
- VERSION = '1.2.0'
5
+ VERSION = '1.3.0'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: heartcheck-webservice
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Locaweb
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-19 00:00:00.000000000 Z
11
+ date: 2015-06-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: heartcheck