hookworm-base 0.3.0 → 0.3.1

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: 7dfa1ddd5cd53f1277f44e7fce0928de3df975db
4
- data.tar.gz: 11479ee035a20330f503a30168d4a01b73d81b17
3
+ metadata.gz: 359ca76440a0b1f412c8c741ad2ca069b6112442
4
+ data.tar.gz: 3eeadb39237e15d5e79eb71bcb7f8dacfdb5df0b
5
5
  SHA512:
6
- metadata.gz: f92fad13d8b48922083513b157f75eddc42cdaa0b89709bc743de9e6643d19d39af45911c18b4008cd7ef028856723ab2200af3eb4a419eb948e41b92bd1d107
7
- data.tar.gz: 77a05a682c165134ff4219435bb91881b32b95beb06d70d05a18074390e68eb9d62fa4b27e852bfc939dd8052fb5f255ff63a5ad94050c98f634cfc4a75285c5
6
+ metadata.gz: 12fed51a2f7701e0f56d41ad389ec0fe8e4624c4214796c8d9f1dbb43c428de7890a22a8c6db49d5853366a1de203f1c261ef74085d1bbcb98a671b5fb172cbc
7
+ data.tar.gz: 4a596d9ec6476e3b59c707094bdf9aa56158bdfb87a5677f4b8f5611aab3658736e90dcdaa2ff26c5e89545a8e7db0cbcf86daa2510eeef0970540b7ce5ef464
@@ -1,5 +1,5 @@
1
1
  module Hookworm
2
2
  module Base
3
- VERSION = '0.3.0'
3
+ VERSION = '0.3.1'
4
4
  end
5
5
  end
@@ -17,10 +17,23 @@ module Hookworm
17
17
  end
18
18
 
19
19
  def http_cfg
20
- @http_cfg ||= JSON.parse(
21
- Net::HTTP.get_response(URI(ENV['HOOKWORM_HTTP_CFG'])).body,
22
- symbolize_names: true
23
- )
20
+ @http_cfg ||= JSON.parse(raw_http_cfg, symbolize_names: true)
21
+ end
22
+
23
+ def raw_http_cfg
24
+ opts = {
25
+ use_ssl: http_cfg_uri.scheme == 'https',
26
+ ssl_timeout: 2.0,
27
+ open_timeout: 2.0,
28
+ read_timeout: 10.0
29
+ }
30
+ Net::HTTP.start(http_cfg_uri.host, http_cfg_uri.port, opts) do |http|
31
+ http.request(Net::HTTP::Get.new(http_cfg_uri)).body
32
+ end
33
+ end
34
+
35
+ def http_cfg_uri
36
+ @http_cfg_uri ||= URI(ENV['HOOKWORM_HTTP_CFG'])
24
37
  end
25
38
 
26
39
  def cfg_disabled?
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hookworm-base
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dan Buch