heartcheck-webservice 1.0.1 → 1.1.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: 5287acb8573ebce1aed07b1c437978068e9da634
4
- data.tar.gz: 4c3de5001452c1f8d14a476d89596ce9b2254156
3
+ metadata.gz: 85d95a9b12c2bb80fc047135b70e3a385271774e
4
+ data.tar.gz: ef9f8312db964a9c4d6bd0a41b0d8556fec7e2ba
5
5
  SHA512:
6
- metadata.gz: 45c178ffec85212afe50a883bd9afa3f7c4bd9900f803b8f7a58d789710fb2ee47345ae24edd136ec192f98c1596b025043cd7591d4e81b2e67328541a9bb27c
7
- data.tar.gz: 4d0042be71bde25148bb6eea13da955adb569e8769d8459e4bb3c61c39f83498557a732ccd0396798a03bfb70ee1ca6e50446ed08c7b5465c2129eaa26f49649
6
+ metadata.gz: 513cf0300e92f97d86d356086ada4f39480c19f4af118c77c26b0baa4249e86880169b630032dd9bd95eaaedcbf292ffc462d48c99f2a1bd787b99b71200469a
7
+ data.tar.gz: 4d0c97d8bec29a5223b24c6394a995fd59fb0efaa9d22ab33bf143a9ae92e8ecf12822d0f32a50d063112af8ad0d027b57b59de37ea2f8fb064a9aae5dbb4635
@@ -79,8 +79,8 @@ module Heartcheck
79
79
  #
80
80
  # @return [Net:HTTP]
81
81
  def request_for(service)
82
- uri = URI(service[:url])
83
- Net::HTTP.get_response(uri)
82
+ Heartcheck::Webservice::HttpClient.new(service[:url],
83
+ service[:ignore_ssl_cert]).get
84
84
  end
85
85
  end
86
86
  end
@@ -1,2 +1,3 @@
1
1
  require 'heartcheck'
2
2
  require 'heartcheck/checks/webservice'
3
+ require 'heartcheck/webservice/http_client'
@@ -0,0 +1,20 @@
1
+ # enconding: utf-8
2
+ module Heartcheck
3
+ module Webservice
4
+ # Http Client
5
+ class HttpClient
6
+ attr_reader :uri, :http
7
+
8
+ def initialize(url, ignore_ssl_cert)
9
+ @uri = URI url
10
+ @http = Net::HTTP.new(@uri.host, @uri.port)
11
+ @http.use_ssl = @uri.scheme == 'https'
12
+ @http.verify_mode = OpenSSL::SSL::VERIFY_NONE if ignore_ssl_cert
13
+ end
14
+
15
+ def get
16
+ http.request Net::HTTP::Get.new(uri.request_uri)
17
+ end
18
+ end
19
+ end
20
+ end
@@ -2,6 +2,6 @@
2
2
  module Heartcheck
3
3
  # gem version
4
4
  module Webservice
5
- VERSION = '1.0.1'
5
+ VERSION = '1.1.0'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: heartcheck-webservice
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Locaweb
@@ -159,6 +159,7 @@ extra_rdoc_files: []
159
159
  files:
160
160
  - lib/heartcheck/checks/webservice.rb
161
161
  - lib/heartcheck/webservice.rb
162
+ - lib/heartcheck/webservice/http_client.rb
162
163
  - lib/heartcheck/webservice/version.rb
163
164
  homepage: http://developer.locaweb.com.br
164
165
  licenses: