aemcrxpkgmgr 0.1.0 → 0.1.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: 25e42cf987c2c0d2c02946a69e39c571f9b4f489
4
- data.tar.gz: e85f1b2e45e9fc2862755bcc6a7f60dadee353a2
3
+ metadata.gz: 6df29d5e01ce84d293a554ab1de18069c2aa454f
4
+ data.tar.gz: a2051abe1ddc48dfe154a2fd140b607e0f79dd83
5
5
  SHA512:
6
- metadata.gz: e080da8e6823ebdf995bfe49798c90b9fb6cbcd819ef1c892aa1f51b63afb9bc797bd33ab6d491232414e053866848f46b1a94c827295840b4137363503a2064
7
- data.tar.gz: aeab3ca6291b0f7174b7419235c7703c256ab9f0f0703184b8727163b472c62d481f2757108be3063f832f9dbfa65de9f66f516c1ed438dd6340438b33f7022e
6
+ metadata.gz: 854c1522b431d8aed94745bb6c49b0cfd0be41c779ba85927a02348812f1c7c956b17f32cfdd5a91e51b33bd79fe01e87a69e0703756d46c2425ea6002647be5
7
+ data.tar.gz: f6b710fd04ed7f218a16d63045c2939818af943ab4dd1a26b114361765e9a5990e84dd63dab6f462b49d88eecd984954685e80610f4a943d3fcc6bb002138133
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- aemcrxpkgmgr (0.1.0)
4
+ aemcrxpkgmgr (0.1.1)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -5,6 +5,10 @@ Version format based on http://semver.org/
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
+ ## [0.1.1] - 2018-01-30
9
+ ## Added
10
+ - retry failed get
11
+
8
12
  ## [0.1.0] - 2018-01-30
9
13
  ## Added
10
14
  - First working version
@@ -20,13 +20,25 @@ class AemCrxPkgMgr
20
20
  end
21
21
 
22
22
  def get(uri)
23
+ retries ||= 100
24
+ retry_timeout = 3
25
+
23
26
  request = Net::HTTP::Get.new(uri)
24
27
  request.basic_auth(@user, @pass)
25
28
 
26
29
  response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
27
30
  http.request(request)
28
31
  end
32
+ raise "AemCrxPkgMgr.get Response '#{response.code}' is not a Net::HTTPSuccess" unless response.is_a?(Net::HTTPSuccess)
29
33
  response
34
+ rescue Errno::EADDRNOTAVAIL, RuntimeError => e
35
+ puts "AemCrxPkgMgr.get : #{e.class} : #{e.message}"
36
+ will_retry = (retries -= 1) >= 0
37
+ if will_retry
38
+ sleep retry_timeout
39
+ retry
40
+ end
41
+ raise
30
42
  end
31
43
 
32
44
  def pkg_query_uri(query)
@@ -1,3 +1,3 @@
1
1
  class AemCrxPkgMgr
2
- VERSION = '0.1.0'.freeze
2
+ VERSION = '0.1.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aemcrxpkgmgr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefan - Zipkid - Goethals
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-01-30 00:00:00.000000000 Z
11
+ date: 2018-02-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler