getv 2.1.1 → 2.1.4

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
  SHA256:
3
- metadata.gz: c6935a6eb2a1891f2f0364bb251927ac36b80c23597a181a831d204c5f6d435e
4
- data.tar.gz: e538f358f96ccb237e393001bf5040fef381627f5668c59c6e1f923a12e19bcf
3
+ metadata.gz: 734da6050b2676ecb72bdfe549cd08219e2a812826105cf789f9df636aa8f1d2
4
+ data.tar.gz: '03095314106f28cb6d9e01ecbb18299702cf344a0618bd4dd43957b0e2be1b80'
5
5
  SHA512:
6
- metadata.gz: ef0890195f15619fafa7ef6e129b7e7db3cb632f5e4367ee45f696393180e43b94f02338baf72ef0ba3c0047374f101e300f56893a71a52318da2fba58dee593
7
- data.tar.gz: 12dc26b4e18b0e7ee4048556c4e896c2634777412fcc4e8282c1ce048d284e5c394d682365ecec07e68a8b6bfccab278ceeafb97e34db0d006ded8f3905b0345
6
+ metadata.gz: da39d5e3e8dfda3d6986b03bdff68bf1fecd45ab27ce744e575dca4bde0ebad0c1ee66fe5c69e03b6b65a2c8b0e9e6019cbe64e3e8445c31f193424f46eeda32
7
+ data.tar.gz: 58b26acd07fd0f663d136f2b8162809dfa64d797cee60f94b336b9b9a2e2afc450f3da980deaa94d951b8bf317040bc99a6a4bf0cf60e9a03e6546cbad9a0661
data/README.md CHANGED
@@ -39,7 +39,7 @@ SYNOPSIS
39
39
 
40
40
 
41
41
  VERSION
42
- 2.1.0
42
+ 2.1.4
43
43
 
44
44
 
45
45
 
@@ -72,7 +72,7 @@ Show the latest available version of the `getv` gem:
72
72
 
73
73
  ```console
74
74
  $ getv --latest gem getv
75
- 2.1.0
75
+ 2.1.4
76
76
  ```
77
77
 
78
78
  Show all `dep` GitHub release versions in JSON:
@@ -36,12 +36,20 @@ module Getv
36
36
  d_opts
37
37
  end
38
38
 
39
- def retrieve_versions
39
+ def retrieve_versions # rubocop:disable Metrics/MethodLength,Metrics/AbcSize
40
40
  require 'docker_registry2'
41
+ retries ||= 0
41
42
  docker = DockerRegistry2.connect(opts[:url], docker_opts)
42
43
  docker.tags("#{opts[:owner]}/#{opts[:repo]}")['tags'] || []
43
44
  rescue DockerRegistry2::NotFound
44
45
  []
46
+ rescue StandardError => e
47
+ if (retries += 1) < 4
48
+ retry
49
+ else
50
+ puts "Error fetching tags for docker image #{opts[:url]}/#{opts[:owner]}/#{opts[:repo]}:"
51
+ puts e.message
52
+ end
45
53
  end
46
54
  end
47
55
  end
@@ -14,9 +14,12 @@ module Getv
14
14
 
15
15
  def retrieve_versions
16
16
  require 'json'
17
+ retries ||= 0
17
18
  JSON.parse(get("https://rubygems.org/api/v1/versions/#{opts[:gem]}.json")).map do |v|
18
19
  v['number']
19
20
  end
21
+ rescue StandardError
22
+ retry if (retries += 1) < 4
20
23
  end
21
24
  end
22
25
  end
@@ -18,10 +18,13 @@ module Getv
18
18
 
19
19
  private
20
20
 
21
- def retrieve_versions
21
+ def retrieve_versions # rubocop:disable Metrics/AbcSize
22
+ retries ||= 0
22
23
  github.commits("#{opts[:owner]}/#{opts[:repo]}", opts[:branch]).map do |c|
23
24
  "#{DateTime.parse(c[:commit][:author][:date].to_s).strftime('%Y%m%d%H%M%S')},#{c[:sha]}"
24
25
  end
26
+ rescue StandardError
27
+ retry if (retries += 1) < 4
25
28
  end
26
29
  end
27
30
  end
@@ -14,7 +14,10 @@ module Getv
14
14
  private
15
15
 
16
16
  def retrieve_versions
17
+ retries ||= 0
17
18
  github.releases("#{opts[:owner]}/#{opts[:repo]}").map(&:tag_name)
19
+ rescue StandardError
20
+ retry if (retries += 1) < 4
18
21
  end
19
22
  end
20
23
  end
@@ -14,7 +14,10 @@ module Getv
14
14
  private
15
15
 
16
16
  def retrieve_versions
17
+ retries ||= 0
17
18
  github.tags("#{opts[:owner]}/#{opts[:repo]}").map { |t| t[:name] }
19
+ rescue StandardError
20
+ retry if (retries += 1) < 4
18
21
  end
19
22
  end
20
23
  end
@@ -14,9 +14,12 @@ module Getv
14
14
 
15
15
  def retrieve_versions
16
16
  require 'yaml'
17
+ retries ||= 0
17
18
  YAML.safe_load(get("#{opts[:url]}/index.yaml")).fetch('entries', {}).fetch(opts[:chart], []).map do |e|
18
19
  e['version']
19
20
  end
21
+ rescue StandardError
22
+ retry if (retries += 1) < 4
20
23
  end
21
24
  end
22
25
  end
@@ -14,7 +14,10 @@ module Getv
14
14
 
15
15
  def retrieve_versions
16
16
  require 'json'
17
+ retries ||= 0
17
18
  JSON.parse(get("https://registry.npmjs.org/#{opts[:npm]}"))['versions'].keys
19
+ rescue StandardError
20
+ retry if (retries += 1) < 4
18
21
  end
19
22
  end
20
23
  end
@@ -14,7 +14,10 @@ module Getv
14
14
 
15
15
  def retrieve_versions
16
16
  require 'json'
17
+ retries ||= 0
17
18
  JSON.parse(get("https://pypi.org/pypi/#{opts[:pypi]}/json"))['releases'].keys
19
+ rescue StandardError
20
+ retry if (retries += 1) < 4
18
21
  end
19
22
  end
20
23
  end
@@ -13,7 +13,10 @@ module Getv
13
13
  private
14
14
 
15
15
  def retrieve_versions
16
+ retries ||= 0
16
17
  get(opts[:url]).split("\n")
18
+ rescue StandardError
19
+ retry if (retries += 1) < 4
17
20
  end
18
21
  end
19
22
  end
@@ -13,8 +13,11 @@ module Getv
13
13
  private
14
14
 
15
15
  def retrieve_versions
16
+ retries ||= 0
16
17
  require 'nokogiri'
17
18
  Nokogiri::XML(get(opts[:url])).xpath(opts[:xpath]).map(&:text)
19
+ rescue StandardError
20
+ retry if (retries += 1) < 4
18
21
  end
19
22
  end
20
23
  end
data/lib/getv/package.rb CHANGED
@@ -66,7 +66,7 @@ module Getv
66
66
  end
67
67
 
68
68
  def update_versions # rubocop:disable Metrics/PerceivedComplexity,Metrics/MethodLength,Metrics/CyclomaticComplexity,Metrics/AbcSize
69
- versions = retrieve_versions
69
+ versions = retrieve_versions || []
70
70
  versions.sort! if instance_of?(Getv::Package::GitHub::Commit)
71
71
  select_pattern = Regexp.new(opts[:select_search])
72
72
  versions.select! { |v| v =~ select_pattern }
data/lib/getv/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Getv
4
- VERSION = '2.1.1'
4
+ VERSION = '2.1.4'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: getv
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.1
4
+ version: 2.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - harbottle
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-03-24 00:00:00.000000000 Z
11
+ date: 2022-05-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gli
@@ -36,7 +36,7 @@ dependencies:
36
36
  requirements:
37
37
  - - ">="
38
38
  - !ruby/object:Gem::Version
39
- version: 1.0.0
39
+ version: 1.10.1
40
40
  - - "<"
41
41
  - !ruby/object:Gem::Version
42
42
  version: 2.0.0
@@ -46,7 +46,7 @@ dependencies:
46
46
  requirements:
47
47
  - - ">="
48
48
  - !ruby/object:Gem::Version
49
- version: 1.0.0
49
+ version: 1.10.1
50
50
  - - "<"
51
51
  - !ruby/object:Gem::Version
52
52
  version: 2.0.0