getv 1.2.1 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +22 -15
- data/exe/getv +82 -33
- data/lib/getv/package.rb +1 -1
- data/lib/getv/version.rb +1 -1
- metadata +6 -17
- data/.bundle/config +0 -4
- data/.github/workflows/ruby.yml +0 -37
- data/.gitignore +0 -17
- data/.rspec +0 -3
- data/.rubocop.yml +0 -16
- data/.travis.yml +0 -6
- data/Gemfile +0 -21
- data/Rakefile +0 -13
- data/bin/console +0 -14
- data/bin/setup +0 -8
- data/getv.gemspec +0 -34
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d3f1afae07aeb895e7cac0ef722a2a0c12008681ee09bfa724cdfc692accba75
|
4
|
+
data.tar.gz: 67ea05289cee910c2c53db2fa337cc6a20bc2459d407bf5bf995d01b5cea41a5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e33576d51b5d6a32d39f54421e87d458542b3ce38a52f2e8b5182d4c38d54257b5e4a75469f96d15df8ab34c0546e03a153e7133138dd5d2dd9b63258d0eaa02
|
7
|
+
data.tar.gz: da5ed58b41e029f1979147c6d3d614bdc9841f267fc56e37f9b4775b7f7c8dc1836141f57e477156876b03b2daa9ac518445364386f4e85802728e0981a7577e
|
data/README.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# getv
|
2
2
|
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/getv.svg)](https://rubygems.org/gems/getv)
|
4
|
+
|
3
5
|
The goal of `getv` is to make it easy and quick to pull software package version numbers from various sources on the web. The application is packaged as a [gem](https://rubygems.org/gems/getv) and provides both a Ruby library and an executable command line tool, `getv`.
|
4
6
|
|
5
7
|
## Installation
|
@@ -37,18 +39,15 @@ SYNOPSIS
|
|
37
39
|
|
38
40
|
|
39
41
|
VERSION
|
40
|
-
1.
|
42
|
+
1.3.0
|
41
43
|
|
42
44
|
|
43
45
|
|
44
46
|
GLOBAL OPTIONS
|
45
|
-
--help
|
46
|
-
-j, --json
|
47
|
-
-l, --latest
|
48
|
-
--
|
49
|
-
--select_replace=arg - Regex version selection replace (default: none)
|
50
|
-
--select_search=arg - Regex version selection search (default: none)
|
51
|
-
--version - Display the program version
|
47
|
+
--help - Show this message
|
48
|
+
-j, --json - Output in json
|
49
|
+
-l, --latest - Latest version
|
50
|
+
--version - Display the program version
|
52
51
|
|
53
52
|
|
54
53
|
|
@@ -56,9 +55,9 @@ COMMANDS
|
|
56
55
|
docker - Get package versions from a Docker or OCI container image registry
|
57
56
|
gem - Get package versions from RubyGems.org
|
58
57
|
get - Get package versions from text file URL
|
59
|
-
github_commit - Get package versions from GitHub commits
|
60
|
-
github_release - Get package versions from GitHub releases
|
61
|
-
github_tag - Get package versions from GitHub tags
|
58
|
+
github_commit - Get package versions from GitHub commits. Set environment variable $GITHUB_TOKEN to avoid GitHub API limit.
|
59
|
+
github_release - Get package versions from GitHub releases. Set environment variable $GITHUB_TOKEN to avoid GitHub API limit.
|
60
|
+
github_tag - Get package versions from GitHub tags. Set environment variable $GITHUB_TOKEN to avoid GitHub API limit.
|
62
61
|
help - Shows a list of commands or help for one command
|
63
62
|
index - Get package versions from web page of links
|
64
63
|
npm - Get package versions from npm at registry.npmjs.org
|
@@ -71,7 +70,7 @@ Show the latest available version of the `getv` gem:
|
|
71
70
|
|
72
71
|
```console
|
73
72
|
$ getv --latest gem getv
|
74
|
-
1.
|
73
|
+
1.3.0
|
75
74
|
```
|
76
75
|
|
77
76
|
Show all `dep` GitHub release versions in JSON:
|
@@ -84,7 +83,7 @@ $ getv --json github_release golang/dep
|
|
84
83
|
Show all AtomicParsley Github release versions:
|
85
84
|
|
86
85
|
```console
|
87
|
-
$ getv
|
86
|
+
$ getv github_release --invalid_versions wez/atomicparsley
|
88
87
|
20200701.154658.b0d6223
|
89
88
|
20201231.092811.cbecfb1
|
90
89
|
20210114.184825.1dbe1be
|
@@ -103,7 +102,7 @@ $ getv -l get --url=https://storage.googleapis.com/kubernetes-release/release/st
|
|
103
102
|
Show selected semantic versions of the `apache/superset` Docker image in JSON:
|
104
103
|
|
105
104
|
```console
|
106
|
-
$ getv --json --reject '-'
|
105
|
+
$ getv --json docker --reject '-' --semantic_select '~>1.3.0,!=1.3.1' apache/superset
|
107
106
|
{"name":"apache/superset","versions":["1.3.0","1.3.2"]}
|
108
107
|
```
|
109
108
|
|
@@ -121,7 +120,7 @@ Show the latest GitHub commit to the `main` branch of the `getv` project in a us
|
|
121
120
|
|
122
121
|
```console
|
123
122
|
# By default the \2 capture group contains the date and \5 contains the short commit hash
|
124
|
-
$ getv -l --select_replace '\2git\5'
|
123
|
+
$ getv -l github_commit --select_replace '\2git\5' --branch main liger1978/getv
|
125
124
|
20220123git9ed86f0
|
126
125
|
```
|
127
126
|
|
@@ -141,6 +140,14 @@ puts superset.latest_version
|
|
141
140
|
|
142
141
|
After checking out the repo, run `bin/setup` to install dependencies. Then, run `bundle exec rake spec` to run the tests. Run `bundle exec rubocop` to run the linter. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
143
142
|
|
143
|
+
Note that by default, Bundler will attempt to install gems to the system, e.g. `/usr/bin`, `/usr/share`, which requires elevated access and can interfere with files that are managed by the system's package manager. This behaviour can be overridden by creating the file `.bundle/config` and adding the following line:
|
144
|
+
```
|
145
|
+
BUNDLE_PATH: "./.bundle"
|
146
|
+
```
|
147
|
+
When you run `bin/setup` or `bundle install`, all gems will be installed inside the .bundle directory of this project.
|
148
|
+
|
149
|
+
To make this behaviour a default for all gem projects, the above line can be added to the user's bundle config file in their home directory (`~/.bundle/config`)
|
150
|
+
|
144
151
|
## Contributing
|
145
152
|
|
146
153
|
Bug reports and pull requests are welcome on [GitHub](https://github.com/liger1978/getv).
|
data/exe/getv
CHANGED
@@ -44,24 +44,28 @@ class App # rubocop:disable Metrics/ClassLength
|
|
44
44
|
|
45
45
|
switch %i[l latest], desc: 'Latest version', negatable: false
|
46
46
|
switch %i[j json], desc: 'Output in json', negatable: false
|
47
|
-
flag %i[select_search], desc: 'Regex version selection search'
|
48
|
-
flag %i[select_replace], desc: 'Regex version selection replace'
|
49
|
-
flag %i[reject], desc: 'Regex version rejection'
|
50
47
|
|
51
48
|
desc 'Get package versions from a Docker or OCI container image registry'
|
52
49
|
arg_name 'package_name'
|
53
|
-
command :docker do |c|
|
50
|
+
command :docker do |c| # rubocop:disable Metrics/BlockLength
|
51
|
+
defaults = (Getv::Package.new 'name', type: c.name.to_s).opts
|
52
|
+
c.flag %i[select_search], desc: 'Regex version selection search', default_value: defaults[:select_search]
|
53
|
+
c.flag %i[select_replace], desc: 'Regex version selection replace', default_value: defaults[:select_replace]
|
54
|
+
c.flag %i[reject], desc: 'Regex version rejection', default_value: defaults[:reject]
|
54
55
|
c.switch %i[invalid_versions], desc: 'Include invalid semantic versions', negatable: false, default_value: false
|
55
|
-
c.flag %i[semantic_select], desc: 'Semantic version selection (comma delimited)'
|
56
|
-
|
57
|
-
c.flag %i[
|
58
|
-
|
56
|
+
c.flag %i[semantic_select], desc: 'Semantic version selection (comma delimited)',
|
57
|
+
default_value: defaults[:semantic_select]
|
58
|
+
c.flag %i[owner], desc: 'Repository owner',
|
59
|
+
default_value: "'<owner>' if package_name is in format '<owner>/<repo>', otherwise just package_name" # rubocop:disable Layout/LineLength
|
60
|
+
c.flag %i[repo], desc: 'Repository name',
|
61
|
+
default_value: "'<repo>' if package_name is in format '<owner>/<repo>', otherwise just package_name" # rubocop:disable Layout/LineLength
|
62
|
+
c.flag %i[url], desc: 'URL', default_value: defaults[:url]
|
59
63
|
c.action do |global_options, options, args|
|
60
64
|
if args.size == 1
|
61
65
|
opts = global_options.merge(options)
|
62
66
|
opts = opts.slice :select_search, :select_replace, :reject, :semantic_only, :semantic_select, :owner, :repo,
|
63
67
|
:url
|
64
|
-
opts = opts.delete_if { |
|
68
|
+
opts = opts.delete_if { |k, v| v.nil? || v == c.flags[k].default_value }
|
65
69
|
opts[:semantic_only] = !options[:invalid_versions]
|
66
70
|
opts[:semantic_select] = opts[:semantic_select].split(',') unless opts.fetch(:semantic_select, nil).nil?
|
67
71
|
package = Getv::Package.new args[0], { type: c.name.to_s }.merge(opts)
|
@@ -75,13 +79,18 @@ class App # rubocop:disable Metrics/ClassLength
|
|
75
79
|
desc 'Get package versions from RubyGems.org'
|
76
80
|
arg_name 'package_name'
|
77
81
|
command :gem do |c|
|
82
|
+
defaults = (Getv::Package.new 'name', type: c.name.to_s).opts
|
83
|
+
c.flag %i[select_search], desc: 'Regex version selection search', default_value: defaults[:select_search]
|
84
|
+
c.flag %i[select_replace], desc: 'Regex version selection replace', default_value: defaults[:select_replace]
|
85
|
+
c.flag %i[reject], desc: 'Regex version rejection', default_value: defaults[:reject]
|
78
86
|
c.switch %i[invalid_versions], desc: 'Include invalid semantic versions', negatable: false, default_value: false
|
79
|
-
c.flag %i[semantic_select], desc: 'Semantic version selection (comma delimited)'
|
87
|
+
c.flag %i[semantic_select], desc: 'Semantic version selection (comma delimited)',
|
88
|
+
default_value: defaults[:semantic_select]
|
80
89
|
c.action do |global_options, options, args|
|
81
90
|
if args.size == 1
|
82
91
|
opts = global_options.merge(options)
|
83
92
|
opts = opts.slice :select_search, :select_replace, :reject, :semantic_only, :semantic_select
|
84
|
-
opts = opts.delete_if { |
|
93
|
+
opts = opts.delete_if { |k, v| v.nil? || v == c.flags[k].default_value }
|
85
94
|
opts[:semantic_only] = !options[:invalid_versions]
|
86
95
|
opts[:semantic_select] = opts[:semantic_select].split(',') unless opts.fetch(:semantic_select, nil).nil?
|
87
96
|
package = Getv::Package.new args[0], { type: c.name.to_s }.merge(opts)
|
@@ -95,14 +104,19 @@ class App # rubocop:disable Metrics/ClassLength
|
|
95
104
|
desc 'Get package versions from text file URL'
|
96
105
|
arg_name 'package_name'
|
97
106
|
command :get do |c|
|
107
|
+
defaults = (Getv::Package.new 'name', type: c.name.to_s).opts
|
108
|
+
c.flag %i[select_search], desc: 'Regex version selection search', default_value: defaults[:select_search]
|
109
|
+
c.flag %i[select_replace], desc: 'Regex version selection replace', default_value: defaults[:select_replace]
|
110
|
+
c.flag %i[reject], desc: 'Regex version rejection', default_value: defaults[:reject]
|
98
111
|
c.switch %i[invalid_versions], desc: 'Include invalid semantic versions', negatable: false, default_value: false
|
99
|
-
c.flag %i[semantic_select], desc: 'Semantic version selection (comma delimited)'
|
100
|
-
|
112
|
+
c.flag %i[semantic_select], desc: 'Semantic version selection (comma delimited)',
|
113
|
+
default_value: defaults[:semantic_select]
|
114
|
+
c.flag %i[url], desc: 'URL', default_value: defaults[:url]
|
101
115
|
c.action do |global_options, options, args|
|
102
116
|
if args.size == 1
|
103
117
|
opts = global_options.merge(options)
|
104
118
|
opts = opts.slice :select_search, :select_replace, :reject, :semantic_only, :semantic_select, :url
|
105
|
-
opts = opts.delete_if { |
|
119
|
+
opts = opts.delete_if { |k, v| v.nil? || v == c.flags[k].default_value }
|
106
120
|
opts[:semantic_only] = !options[:invalid_versions]
|
107
121
|
opts[:semantic_select] = opts[:semantic_select].split(',') unless opts.fetch(:semantic_select, nil).nil?
|
108
122
|
package = Getv::Package.new args[0], { type: c.name.to_s }.merge(opts)
|
@@ -116,14 +130,20 @@ class App # rubocop:disable Metrics/ClassLength
|
|
116
130
|
desc 'Get package versions from GitHub commits. Set environment variable $GITHUB_TOKEN to avoid GitHub API limit.'
|
117
131
|
arg_name 'package_name'
|
118
132
|
command :github_commit do |c|
|
119
|
-
|
120
|
-
c.flag %i[
|
121
|
-
c.flag %i[
|
133
|
+
defaults = (Getv::Package.new 'name', type: c.name.to_s).opts
|
134
|
+
c.flag %i[select_search], desc: 'Regex version selection search', default_value: defaults[:select_search]
|
135
|
+
c.flag %i[select_replace], desc: 'Regex version selection replace', default_value: defaults[:select_replace]
|
136
|
+
c.flag %i[reject], desc: 'Regex version rejection', default_value: defaults[:reject]
|
137
|
+
c.flag %i[owner], desc: 'Repository owner',
|
138
|
+
default_value: "'<owner>' if package_name is in format '<owner>/<repo>', otherwise just package_name" # rubocop:disable Layout/LineLength
|
139
|
+
c.flag %i[repo], desc: 'Repository name',
|
140
|
+
default_value: "'<repo>' if package_name is in format '<owner>/<repo>', otherwise just package_name" # rubocop:disable Layout/LineLength
|
141
|
+
c.flag %i[branch], desc: 'Repository branch', default_value: defaults[:branch]
|
122
142
|
c.action do |global_options, options, args|
|
123
143
|
if args.size == 1
|
124
144
|
opts = global_options.merge(options)
|
125
145
|
opts = opts.slice :select_search, :select_replace, :reject, :owner, :repo, :branch
|
126
|
-
opts = opts.delete_if { |
|
146
|
+
opts = opts.delete_if { |k, v| v.nil? || v == c.flags[k].default_value }
|
127
147
|
package = Getv::Package.new args[0], { type: c.name.to_s }.merge(opts)
|
128
148
|
Getv::Cli.output(package, latest: global_options[:latest], json: global_options[:json])
|
129
149
|
else
|
@@ -135,15 +155,22 @@ class App # rubocop:disable Metrics/ClassLength
|
|
135
155
|
desc 'Get package versions from GitHub releases. Set environment variable $GITHUB_TOKEN to avoid GitHub API limit.'
|
136
156
|
arg_name 'package_name'
|
137
157
|
command :github_release do |c|
|
158
|
+
defaults = (Getv::Package.new 'name', type: c.name.to_s).opts
|
159
|
+
c.flag %i[select_search], desc: 'Regex version selection search', default_value: defaults[:select_search]
|
160
|
+
c.flag %i[select_replace], desc: 'Regex version selection replace', default_value: defaults[:select_replace]
|
161
|
+
c.flag %i[reject], desc: 'Regex version rejection', default_value: defaults[:reject]
|
138
162
|
c.switch %i[invalid_versions], desc: 'Include invalid semantic versions', negatable: false, default_value: false
|
139
|
-
c.flag %i[semantic_select], desc: 'Semantic version selection (comma delimited)'
|
140
|
-
|
141
|
-
c.flag %i[
|
163
|
+
c.flag %i[semantic_select], desc: 'Semantic version selection (comma delimited)',
|
164
|
+
default_value: defaults[:semantic_select]
|
165
|
+
c.flag %i[owner], desc: 'Repository owner',
|
166
|
+
default_value: "'<owner>' if package_name is in format '<owner>/<repo>', otherwise just package_name" # rubocop:disable Layout/LineLength
|
167
|
+
c.flag %i[repo], desc: 'Repository name',
|
168
|
+
default_value: "'<repo>' if package_name is in format '<owner>/<repo>', otherwise just package_name" # rubocop:disable Layout/LineLength
|
142
169
|
c.action do |global_options, options, args|
|
143
170
|
if args.size == 1
|
144
171
|
opts = global_options.merge(options)
|
145
172
|
opts = opts.slice :select_search, :select_replace, :reject, :semantic_only, :semantic_select, :owner, :repo
|
146
|
-
opts = opts.delete_if { |
|
173
|
+
opts = opts.delete_if { |k, v| v.nil? || v == c.flags[k].default_value }
|
147
174
|
opts[:semantic_only] = !options[:invalid_versions]
|
148
175
|
opts[:semantic_select] = opts[:semantic_select].split(',') unless opts.fetch(:semantic_select, nil).nil?
|
149
176
|
package = Getv::Package.new args[0], { type: c.name.to_s }.merge(opts)
|
@@ -157,15 +184,22 @@ class App # rubocop:disable Metrics/ClassLength
|
|
157
184
|
desc 'Get package versions from GitHub tags. Set environment variable $GITHUB_TOKEN to avoid GitHub API limit.'
|
158
185
|
arg_name 'package_name'
|
159
186
|
command :github_tag do |c|
|
187
|
+
defaults = (Getv::Package.new 'name', type: c.name.to_s).opts
|
188
|
+
c.flag %i[select_search], desc: 'Regex version selection search', default_value: defaults[:select_search]
|
189
|
+
c.flag %i[select_replace], desc: 'Regex version selection replace', default_value: defaults[:select_replace]
|
190
|
+
c.flag %i[reject], desc: 'Regex version rejection', default_value: defaults[:reject]
|
160
191
|
c.switch %i[invalid_versions], desc: 'Include invalid semantic versions', negatable: false, default_value: false
|
161
|
-
c.flag %i[semantic_select], desc: 'Semantic version selection (comma delimited)'
|
162
|
-
|
163
|
-
c.flag %i[
|
192
|
+
c.flag %i[semantic_select], desc: 'Semantic version selection (comma delimited)',
|
193
|
+
default_value: defaults[:semantic_select]
|
194
|
+
c.flag %i[owner], desc: 'Repository owner',
|
195
|
+
default_value: "'<owner>' if package_name is in format '<owner>/<repo>', otherwise just package_name" # rubocop:disable Layout/LineLength
|
196
|
+
c.flag %i[repo], desc: 'Repository name',
|
197
|
+
default_value: "'<repo>' if package_name is in format '<owner>/<repo>', otherwise just package_name" # rubocop:disable Layout/LineLength
|
164
198
|
c.action do |global_options, options, args|
|
165
199
|
if args.size == 1
|
166
200
|
opts = global_options.merge(options)
|
167
201
|
opts = opts.slice :select_search, :select_replace, :reject, :semantic_only, :semantic_select, :owner, :repo
|
168
|
-
opts = opts.delete_if { |
|
202
|
+
opts = opts.delete_if { |k, v| v.nil? || v == c.flags[k].default_value }
|
169
203
|
opts[:semantic_only] = !options[:invalid_versions]
|
170
204
|
opts[:semantic_select] = opts[:semantic_select].split(',') unless opts.fetch(:semantic_select, nil).nil?
|
171
205
|
package = Getv::Package.new args[0], { type: c.name.to_s }.merge(opts)
|
@@ -179,16 +213,21 @@ class App # rubocop:disable Metrics/ClassLength
|
|
179
213
|
desc 'Get package versions from web page of links'
|
180
214
|
arg_name 'package_name'
|
181
215
|
command :index do |c|
|
216
|
+
defaults = (Getv::Package.new 'name', type: c.name.to_s).opts
|
217
|
+
c.flag %i[select_search], desc: 'Regex version selection search', default_value: defaults[:select_search]
|
218
|
+
c.flag %i[select_replace], desc: 'Regex version selection replace', default_value: defaults[:select_replace]
|
219
|
+
c.flag %i[reject], desc: 'Regex version rejection', default_value: defaults[:reject]
|
182
220
|
c.switch %i[invalid_versions], desc: 'Include invalid semantic versions', negatable: false, default_value: false
|
183
|
-
c.flag %i[semantic_select], desc: 'Semantic version selection (comma delimited)'
|
184
|
-
|
221
|
+
c.flag %i[semantic_select], desc: 'Semantic version selection (comma delimited)',
|
222
|
+
default_value: defaults[:semantic_select]
|
223
|
+
c.flag %i[url], desc: 'URL', default_value: defaults[:url]
|
185
224
|
c.switch %i[link_value], desc: 'Use the value (target) of links rather than the content (display text)',
|
186
225
|
negatable: false, default_value: false
|
187
226
|
c.action do |global_options, options, args|
|
188
227
|
if args.size == 1
|
189
228
|
opts = global_options.merge(options)
|
190
229
|
opts = opts.slice :select_search, :select_replace, :reject, :semantic_only, :semantic_select, :url
|
191
|
-
opts = opts.delete_if { |
|
230
|
+
opts = opts.delete_if { |k, v| v.nil? || v == c.flags[k].default_value }
|
192
231
|
opts[:link] == 'value' if options[:link_value]
|
193
232
|
opts[:semantic_only] = !options[:invalid_versions]
|
194
233
|
opts[:semantic_select] = opts[:semantic_select].split(',') unless opts.fetch(:semantic_select, nil).nil?
|
@@ -203,13 +242,18 @@ class App # rubocop:disable Metrics/ClassLength
|
|
203
242
|
desc 'Get package versions from npm at registry.npmjs.org'
|
204
243
|
arg_name 'package_name'
|
205
244
|
command :npm do |c|
|
245
|
+
defaults = (Getv::Package.new 'name', type: c.name.to_s).opts
|
246
|
+
c.flag %i[select_search], desc: 'Regex version selection search', default_value: defaults[:select_search]
|
247
|
+
c.flag %i[select_replace], desc: 'Regex version selection replace', default_value: defaults[:select_replace]
|
248
|
+
c.flag %i[reject], desc: 'Regex version rejection', default_value: defaults[:reject]
|
206
249
|
c.switch %i[invalid_versions], desc: 'Include invalid semantic versions', negatable: false, default_value: false
|
207
|
-
c.flag %i[semantic_select], desc: 'Semantic version selection (comma delimited)'
|
250
|
+
c.flag %i[semantic_select], desc: 'Semantic version selection (comma delimited)',
|
251
|
+
default_value: defaults[:semantic_select]
|
208
252
|
c.action do |global_options, options, args|
|
209
253
|
if args.size == 1
|
210
254
|
opts = global_options.merge(options)
|
211
255
|
opts = opts.slice :select_search, :select_replace, :reject, :semantic_only, :semantic_select
|
212
|
-
opts = opts.delete_if { |
|
256
|
+
opts = opts.delete_if { |k, v| v.nil? || v == c.flags[k].default_value }
|
213
257
|
opts[:semantic_only] = !options[:invalid_versions]
|
214
258
|
opts[:semantic_select] = opts[:semantic_select].split(',') unless opts.fetch(:semantic_select, nil).nil?
|
215
259
|
package = Getv::Package.new args[0], { type: c.name.to_s }.merge(opts)
|
@@ -223,13 +267,18 @@ class App # rubocop:disable Metrics/ClassLength
|
|
223
267
|
desc 'Get package versions from the Python Package Index at pypi.org'
|
224
268
|
arg_name 'package_name'
|
225
269
|
command :pypi do |c|
|
270
|
+
defaults = (Getv::Package.new 'name', type: c.name.to_s).opts
|
271
|
+
c.flag %i[select_search], desc: 'Regex version selection search', default_value: defaults[:select_search]
|
272
|
+
c.flag %i[select_replace], desc: 'Regex version selection replace', default_value: defaults[:select_replace]
|
273
|
+
c.flag %i[reject], desc: 'Regex version rejection', default_value: defaults[:reject]
|
226
274
|
c.switch %i[invalid_versions], desc: 'Include invalid semantic versions', negatable: false, default_value: false
|
227
|
-
c.flag %i[semantic_select], desc: 'Semantic version selection (comma delimited)'
|
275
|
+
c.flag %i[semantic_select], desc: 'Semantic version selection (comma delimited)',
|
276
|
+
default_value: defaults[:semantic_select]
|
228
277
|
c.action do |global_options, options, args|
|
229
278
|
if args.size == 1
|
230
279
|
opts = global_options.merge(options)
|
231
280
|
opts = opts.slice :select_search, :select_replace, :reject, :semantic_only, :semantic_select
|
232
|
-
opts = opts.delete_if { |
|
281
|
+
opts = opts.delete_if { |k, v| v.nil? || v == c.flags[k].default_value }
|
233
282
|
opts[:semantic_only] = !options[:invalid_versions]
|
234
283
|
opts[:semantic_select] = opts[:semantic_select].split(',') unless opts.fetch(:semantic_select, nil).nil?
|
235
284
|
package = Getv::Package.new args[0], { type: c.name.to_s }.merge(opts)
|
data/lib/getv/package.rb
CHANGED
@@ -24,7 +24,7 @@ module Getv
|
|
24
24
|
end
|
25
25
|
opts = {
|
26
26
|
type: 'github_release',
|
27
|
-
select_search: '^\s*v?(
|
27
|
+
select_search: '^\s*v?(.*)\s*$',
|
28
28
|
select_replace: '\1',
|
29
29
|
reject: nil,
|
30
30
|
semantic_only: true,
|
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.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- harbottle
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-01-
|
11
|
+
date: 2022-01-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gli
|
@@ -118,20 +118,9 @@ executables:
|
|
118
118
|
extensions: []
|
119
119
|
extra_rdoc_files: []
|
120
120
|
files:
|
121
|
-
- ".bundle/config"
|
122
|
-
- ".github/workflows/ruby.yml"
|
123
|
-
- ".gitignore"
|
124
|
-
- ".rspec"
|
125
|
-
- ".rubocop.yml"
|
126
|
-
- ".travis.yml"
|
127
|
-
- Gemfile
|
128
121
|
- LICENSE.txt
|
129
122
|
- README.md
|
130
|
-
- Rakefile
|
131
|
-
- bin/console
|
132
|
-
- bin/setup
|
133
123
|
- exe/getv
|
134
|
-
- getv.gemspec
|
135
124
|
- lib/getv.rb
|
136
125
|
- lib/getv/package.rb
|
137
126
|
- lib/getv/version.rb
|
@@ -142,7 +131,7 @@ metadata:
|
|
142
131
|
homepage_uri: https://github.com/liger1978/getv
|
143
132
|
source_code_uri: https://github.com/liger1978/getv
|
144
133
|
changelog_uri: https://github.com/liger1978/getv
|
145
|
-
post_install_message:
|
134
|
+
post_install_message:
|
146
135
|
rdoc_options: []
|
147
136
|
require_paths:
|
148
137
|
- lib
|
@@ -157,8 +146,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
157
146
|
- !ruby/object:Gem::Version
|
158
147
|
version: '0'
|
159
148
|
requirements: []
|
160
|
-
rubygems_version: 3.
|
161
|
-
signing_key:
|
149
|
+
rubygems_version: 3.0.3
|
150
|
+
signing_key:
|
162
151
|
specification_version: 4
|
163
152
|
summary: Pull package version numbers from the web in various ways.
|
164
153
|
test_files: []
|
data/.bundle/config
DELETED
data/.github/workflows/ruby.yml
DELETED
@@ -1,37 +0,0 @@
|
|
1
|
-
# This workflow uses actions that are not certified by GitHub.
|
2
|
-
# They are provided by a third-party and are governed by
|
3
|
-
# separate terms of service, privacy policy, and support
|
4
|
-
# documentation.
|
5
|
-
# This workflow will download a prebuilt Ruby version, install dependencies and run tests with Rake
|
6
|
-
# For more information see: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby
|
7
|
-
|
8
|
-
name: Ruby
|
9
|
-
|
10
|
-
on:
|
11
|
-
push:
|
12
|
-
branches: [ main ]
|
13
|
-
pull_request:
|
14
|
-
branches: [ main ]
|
15
|
-
|
16
|
-
jobs:
|
17
|
-
test:
|
18
|
-
|
19
|
-
runs-on: ubuntu-latest
|
20
|
-
strategy:
|
21
|
-
matrix:
|
22
|
-
ruby-version: ['2.6', '2.7', '3.0']
|
23
|
-
|
24
|
-
steps:
|
25
|
-
- uses: actions/checkout@v2
|
26
|
-
- name: Set up Ruby
|
27
|
-
# To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
|
28
|
-
# change this to (see https://github.com/ruby/setup-ruby#versioning):
|
29
|
-
# uses: ruby/setup-ruby@v1
|
30
|
-
uses: ruby/setup-ruby@v1
|
31
|
-
with:
|
32
|
-
ruby-version: ${{ matrix.ruby-version }}
|
33
|
-
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
34
|
-
- name: Run linter
|
35
|
-
run: bundle exec rake rubocop
|
36
|
-
- name: Run unit tests
|
37
|
-
run: bundle exec rake
|
data/.gitignore
DELETED
data/.rspec
DELETED
data/.rubocop.yml
DELETED
data/.travis.yml
DELETED
data/Gemfile
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
source 'https://rubygems.org'
|
4
|
-
|
5
|
-
# Specify your gem's dependencies in getv.gemspec
|
6
|
-
gemspec
|
7
|
-
|
8
|
-
gem 'docker_registry2', '~> 1.10'
|
9
|
-
gem 'gli', '~> 2.20'
|
10
|
-
gem 'irb', '~> 1.4'
|
11
|
-
gem 'nokogiri', '~> 1.13'
|
12
|
-
gem 'octokit', '~> 4.21'
|
13
|
-
gem 'rake', '~> 12.0'
|
14
|
-
gem 'rdoc', '~> 6.4'
|
15
|
-
gem 'rspec', '~> 3.0'
|
16
|
-
gem 'rubocop', '~> 1.24', require: false
|
17
|
-
gem 'rubocop-rake', '~> 0.6', require: false
|
18
|
-
gem 'rubocop-rspec', '~> 2.7', require: false
|
19
|
-
gem 'semantic', '~> 1.6'
|
20
|
-
gem 'vcr', '~> 6.0'
|
21
|
-
gem 'webmock', '~> 3.0'
|
data/Rakefile
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'bundler/gem_tasks'
|
4
|
-
require 'rspec/core/rake_task'
|
5
|
-
require 'rubocop/rake_task'
|
6
|
-
|
7
|
-
RSpec::Core::RakeTask.new(:spec)
|
8
|
-
|
9
|
-
RuboCop::RakeTask.new do |task|
|
10
|
-
task.requires << 'rubocop-rspec'
|
11
|
-
end
|
12
|
-
|
13
|
-
task default: :spec
|
data/bin/console
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
require "bundler/setup"
|
4
|
-
require "getv"
|
5
|
-
|
6
|
-
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
-
# with your gem easier. You can also use a different console, if you like.
|
8
|
-
|
9
|
-
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
-
# require "pry"
|
11
|
-
# Pry.start
|
12
|
-
|
13
|
-
require "irb"
|
14
|
-
IRB.start(__FILE__)
|
data/bin/setup
DELETED
data/getv.gemspec
DELETED
@@ -1,34 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require_relative 'lib/getv/version'
|
4
|
-
|
5
|
-
Gem::Specification.new do |spec|
|
6
|
-
spec.name = 'getv'
|
7
|
-
spec.version = Getv::VERSION
|
8
|
-
spec.authors = ['harbottle']
|
9
|
-
spec.email = ['harbottle@room3d3.com']
|
10
|
-
|
11
|
-
spec.summary = 'Pull package version numbers from the web in various ways.'
|
12
|
-
spec.description = 'Pull package version numbers from the web in various ways.'
|
13
|
-
spec.homepage = 'https://github.com/liger1978/getv'
|
14
|
-
spec.license = 'MIT'
|
15
|
-
|
16
|
-
spec.metadata['homepage_uri'] = spec.homepage
|
17
|
-
spec.metadata['source_code_uri'] = 'https://github.com/liger1978/getv'
|
18
|
-
spec.metadata['changelog_uri'] = 'https://github.com/liger1978/getv'
|
19
|
-
|
20
|
-
# Specify which files should be added to the gem when it is released.
|
21
|
-
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
22
|
-
spec.files = Dir.chdir(File.expand_path(__dir__)) do
|
23
|
-
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
24
|
-
end
|
25
|
-
spec.bindir = 'exe'
|
26
|
-
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
27
|
-
spec.require_paths = ['lib']
|
28
|
-
|
29
|
-
spec.add_dependency('gli', '>= 2.20.1', '< 3.0.0')
|
30
|
-
spec.add_dependency('docker_registry2', '>= 1.0.0', '< 2.0.0')
|
31
|
-
spec.add_dependency('nokogiri', '>= 1.0.0', '< 2.0.0')
|
32
|
-
spec.add_dependency('octokit', '>= 3.0.0', '< 5.0.0')
|
33
|
-
spec.add_dependency('semantic', '>= 1.0.0', '< 2.0.0')
|
34
|
-
end
|