getv 1.3.0 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/exe/getv +89 -118
- data/lib/getv/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 76b665201a4d7f1ecdaa9047121a3b4fece0805d5de821b9acf636cc9f82a506
|
4
|
+
data.tar.gz: 620003975f2b25a1d6df14edfda536e7710cfbcbd6ab4f329c710c4ee820a281
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 61f05289eca59aab2435330d79d849876cf2e3d160d214899a4644c11cba109a4337a5b9bac8c905a54e020b06362201befe63302a5d513efe4f07e82c2fc6fb
|
7
|
+
data.tar.gz: 56c9e45f319a0bd94bd27b15053f782731b0f08d6b94c55fbfc8d449b80a3fb8deb96af6fd7e51403305b4875f0231986bb114834b069e243027df56a4f671aa
|
data/exe/getv
CHANGED
@@ -7,26 +7,16 @@ require 'gli'
|
|
7
7
|
module Getv
|
8
8
|
# cli class
|
9
9
|
class Cli
|
10
|
-
def self.output(package, latest: false, json: false)
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
'name' => package.name,
|
16
|
-
'latest_version' => package.latest_version
|
17
|
-
}.to_json)
|
18
|
-
else
|
19
|
-
puts package.latest_version
|
20
|
-
end
|
21
|
-
elsif json
|
10
|
+
def self.output(package, latest: false, json: false)
|
11
|
+
key = latest ? 'latest_version' : 'versions'
|
12
|
+
result = package.send(key)
|
13
|
+
|
14
|
+
if json
|
22
15
|
require 'json'
|
23
|
-
|
24
|
-
'name' => package.name,
|
25
|
-
'versions' => package.versions
|
26
|
-
}.to_json)
|
27
|
-
else
|
28
|
-
puts package.versions
|
16
|
+
result = { 'name' => package.name, key => result }.to_json
|
29
17
|
end
|
18
|
+
|
19
|
+
puts result
|
30
20
|
end
|
31
21
|
end
|
32
22
|
end
|
@@ -47,7 +37,7 @@ class App # rubocop:disable Metrics/ClassLength
|
|
47
37
|
|
48
38
|
desc 'Get package versions from a Docker or OCI container image registry'
|
49
39
|
arg_name 'package_name'
|
50
|
-
command :docker do |c|
|
40
|
+
command :docker do |c|
|
51
41
|
defaults = (Getv::Package.new 'name', type: c.name.to_s).opts
|
52
42
|
c.flag %i[select_search], desc: 'Regex version selection search', default_value: defaults[:select_search]
|
53
43
|
c.flag %i[select_replace], desc: 'Regex version selection replace', default_value: defaults[:select_replace]
|
@@ -61,18 +51,16 @@ class App # rubocop:disable Metrics/ClassLength
|
|
61
51
|
default_value: "'<repo>' if package_name is in format '<owner>/<repo>', otherwise just package_name" # rubocop:disable Layout/LineLength
|
62
52
|
c.flag %i[url], desc: 'URL', default_value: defaults[:url]
|
63
53
|
c.action do |global_options, options, args|
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
help_now!
|
75
|
-
end
|
54
|
+
help_now! unless args.size == 1
|
55
|
+
|
56
|
+
opts = global_options.merge(options)
|
57
|
+
opts = opts.slice :select_search, :select_replace, :reject, :semantic_only, :semantic_select, :owner, :repo,
|
58
|
+
:url
|
59
|
+
opts = opts.delete_if { |k, v| v.nil? || v == c.flags[k].default_value }
|
60
|
+
opts[:semantic_only] = !options[:invalid_versions]
|
61
|
+
opts[:semantic_select] = opts[:semantic_select].split(',') unless opts.fetch(:semantic_select, nil).nil?
|
62
|
+
package = Getv::Package.new args[0], { type: c.name.to_s }.merge(opts)
|
63
|
+
Getv::Cli.output(package, latest: global_options[:latest], json: global_options[:json])
|
76
64
|
end
|
77
65
|
end
|
78
66
|
|
@@ -87,17 +75,15 @@ class App # rubocop:disable Metrics/ClassLength
|
|
87
75
|
c.flag %i[semantic_select], desc: 'Semantic version selection (comma delimited)',
|
88
76
|
default_value: defaults[:semantic_select]
|
89
77
|
c.action do |global_options, options, args|
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
help_now!
|
100
|
-
end
|
78
|
+
help_now! unless args.size == 1
|
79
|
+
|
80
|
+
opts = global_options.merge(options)
|
81
|
+
opts = opts.slice :select_search, :select_replace, :reject, :semantic_only, :semantic_select
|
82
|
+
opts = opts.delete_if { |k, v| v.nil? || v == c.flags[k].default_value }
|
83
|
+
opts[:semantic_only] = !options[:invalid_versions]
|
84
|
+
opts[:semantic_select] = opts[:semantic_select].split(',') unless opts.fetch(:semantic_select, nil).nil?
|
85
|
+
package = Getv::Package.new args[0], { type: c.name.to_s }.merge(opts)
|
86
|
+
Getv::Cli.output(package, latest: global_options[:latest], json: global_options[:json])
|
101
87
|
end
|
102
88
|
end
|
103
89
|
|
@@ -113,17 +99,14 @@ class App # rubocop:disable Metrics/ClassLength
|
|
113
99
|
default_value: defaults[:semantic_select]
|
114
100
|
c.flag %i[url], desc: 'URL', default_value: defaults[:url]
|
115
101
|
c.action do |global_options, options, args|
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
else
|
125
|
-
help_now!
|
126
|
-
end
|
102
|
+
help_now! unless args.size == 1
|
103
|
+
|
104
|
+
opts = opts.slice :select_search, :select_replace, :reject, :semantic_only, :semantic_select, :url
|
105
|
+
opts = opts.delete_if { |k, v| v.nil? || v == c.flags[k].default_value }
|
106
|
+
opts[:semantic_only] = !options[:invalid_versions]
|
107
|
+
opts[:semantic_select] = opts[:semantic_select].split(',') unless opts.fetch(:semantic_select, nil).nil?
|
108
|
+
package = Getv::Package.new args[0], { type: c.name.to_s }.merge(opts)
|
109
|
+
Getv::Cli.output(package, latest: global_options[:latest], json: global_options[:json])
|
127
110
|
end
|
128
111
|
end
|
129
112
|
|
@@ -140,15 +123,13 @@ class App # rubocop:disable Metrics/ClassLength
|
|
140
123
|
default_value: "'<repo>' if package_name is in format '<owner>/<repo>', otherwise just package_name" # rubocop:disable Layout/LineLength
|
141
124
|
c.flag %i[branch], desc: 'Repository branch', default_value: defaults[:branch]
|
142
125
|
c.action do |global_options, options, args|
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
help_now!
|
151
|
-
end
|
126
|
+
help_now! unless args.size == 1
|
127
|
+
|
128
|
+
opts = global_options.merge(options)
|
129
|
+
opts = opts.slice :select_search, :select_replace, :reject, :owner, :repo, :branch
|
130
|
+
opts = opts.delete_if { |k, v| v.nil? || v == c.flags[k].default_value }
|
131
|
+
package = Getv::Package.new args[0], { type: c.name.to_s }.merge(opts)
|
132
|
+
Getv::Cli.output(package, latest: global_options[:latest], json: global_options[:json])
|
152
133
|
end
|
153
134
|
end
|
154
135
|
|
@@ -167,17 +148,15 @@ class App # rubocop:disable Metrics/ClassLength
|
|
167
148
|
c.flag %i[repo], desc: 'Repository name',
|
168
149
|
default_value: "'<repo>' if package_name is in format '<owner>/<repo>', otherwise just package_name" # rubocop:disable Layout/LineLength
|
169
150
|
c.action do |global_options, options, args|
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
help_now!
|
180
|
-
end
|
151
|
+
help_now! unless args.size == 1
|
152
|
+
|
153
|
+
opts = global_options.merge(options)
|
154
|
+
opts = opts.slice :select_search, :select_replace, :reject, :semantic_only, :semantic_select, :owner, :repo
|
155
|
+
opts = opts.delete_if { |k, v| v.nil? || v == c.flags[k].default_value }
|
156
|
+
opts[:semantic_only] = !options[:invalid_versions]
|
157
|
+
opts[:semantic_select] = opts[:semantic_select].split(',') unless opts.fetch(:semantic_select, nil).nil?
|
158
|
+
package = Getv::Package.new args[0], { type: c.name.to_s }.merge(opts)
|
159
|
+
Getv::Cli.output(package, latest: global_options[:latest], json: global_options[:json])
|
181
160
|
end
|
182
161
|
end
|
183
162
|
|
@@ -196,17 +175,15 @@ class App # rubocop:disable Metrics/ClassLength
|
|
196
175
|
c.flag %i[repo], desc: 'Repository name',
|
197
176
|
default_value: "'<repo>' if package_name is in format '<owner>/<repo>', otherwise just package_name" # rubocop:disable Layout/LineLength
|
198
177
|
c.action do |global_options, options, args|
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
help_now!
|
209
|
-
end
|
178
|
+
help_now! unless args.size == 1
|
179
|
+
|
180
|
+
opts = global_options.merge(options)
|
181
|
+
opts = opts.slice :select_search, :select_replace, :reject, :semantic_only, :semantic_select, :owner, :repo
|
182
|
+
opts = opts.delete_if { |k, v| v.nil? || v == c.flags[k].default_value }
|
183
|
+
opts[:semantic_only] = !options[:invalid_versions]
|
184
|
+
opts[:semantic_select] = opts[:semantic_select].split(',') unless opts.fetch(:semantic_select, nil).nil?
|
185
|
+
package = Getv::Package.new args[0], { type: c.name.to_s }.merge(opts)
|
186
|
+
Getv::Cli.output(package, latest: global_options[:latest], json: global_options[:json])
|
210
187
|
end
|
211
188
|
end
|
212
189
|
|
@@ -224,18 +201,16 @@ class App # rubocop:disable Metrics/ClassLength
|
|
224
201
|
c.switch %i[link_value], desc: 'Use the value (target) of links rather than the content (display text)',
|
225
202
|
negatable: false, default_value: false
|
226
203
|
c.action do |global_options, options, args|
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
help_now!
|
238
|
-
end
|
204
|
+
help_now! unless args.size == 1
|
205
|
+
|
206
|
+
opts = global_options.merge(options)
|
207
|
+
opts = opts.slice :select_search, :select_replace, :reject, :semantic_only, :semantic_select, :url
|
208
|
+
opts = opts.delete_if { |k, v| v.nil? || v == c.flags[k].default_value }
|
209
|
+
opts[:link] == 'value' if options[:link_value]
|
210
|
+
opts[:semantic_only] = !options[:invalid_versions]
|
211
|
+
opts[:semantic_select] = opts[:semantic_select].split(',') unless opts.fetch(:semantic_select, nil).nil?
|
212
|
+
package = Getv::Package.new args[0], { type: c.name.to_s }.merge(opts)
|
213
|
+
Getv::Cli.output(package, latest: global_options[:latest], json: global_options[:json])
|
239
214
|
end
|
240
215
|
end
|
241
216
|
|
@@ -250,17 +225,15 @@ class App # rubocop:disable Metrics/ClassLength
|
|
250
225
|
c.flag %i[semantic_select], desc: 'Semantic version selection (comma delimited)',
|
251
226
|
default_value: defaults[:semantic_select]
|
252
227
|
c.action do |global_options, options, args|
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
help_now!
|
263
|
-
end
|
228
|
+
help_now! unless args.size == 1
|
229
|
+
|
230
|
+
opts = global_options.merge(options)
|
231
|
+
opts = opts.slice :select_search, :select_replace, :reject, :semantic_only, :semantic_select
|
232
|
+
opts = opts.delete_if { |k, v| v.nil? || v == c.flags[k].default_value }
|
233
|
+
opts[:semantic_only] = !options[:invalid_versions]
|
234
|
+
opts[:semantic_select] = opts[:semantic_select].split(',') unless opts.fetch(:semantic_select, nil).nil?
|
235
|
+
package = Getv::Package.new args[0], { type: c.name.to_s }.merge(opts)
|
236
|
+
Getv::Cli.output(package, latest: global_options[:latest], json: global_options[:json])
|
264
237
|
end
|
265
238
|
end
|
266
239
|
|
@@ -275,17 +248,15 @@ class App # rubocop:disable Metrics/ClassLength
|
|
275
248
|
c.flag %i[semantic_select], desc: 'Semantic version selection (comma delimited)',
|
276
249
|
default_value: defaults[:semantic_select]
|
277
250
|
c.action do |global_options, options, args|
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
help_now!
|
288
|
-
end
|
251
|
+
help_now! unless args.size == 1
|
252
|
+
|
253
|
+
opts = global_options.merge(options)
|
254
|
+
opts = opts.slice :select_search, :select_replace, :reject, :semantic_only, :semantic_select
|
255
|
+
opts = opts.delete_if { |k, v| v.nil? || v == c.flags[k].default_value }
|
256
|
+
opts[:semantic_only] = !options[:invalid_versions]
|
257
|
+
opts[:semantic_select] = opts[:semantic_select].split(',') unless opts.fetch(:semantic_select, nil).nil?
|
258
|
+
package = Getv::Package.new args[0], { type: c.name.to_s }.merge(opts)
|
259
|
+
Getv::Cli.output(package, latest: global_options[:latest], json: global_options[:json])
|
289
260
|
end
|
290
261
|
end
|
291
262
|
|
data/lib/getv/version.rb
CHANGED
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: 1.3.
|
4
|
+
version: 1.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- harbottle
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-01-
|
11
|
+
date: 2022-01-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gli
|