run_tasks 1.6.1 → 1.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/src/run.rb +32 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz: '
|
3
|
+
metadata.gz: 4d912c814601289934a2471492548e2ee035c4b8
|
4
|
+
data.tar.gz: '081ac573f9c65a8438a4a29b80014f7280c3a611'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f49f2ab04d2b205a209e1202762055133576d52cb5d9c9a323745c45b112c4309dc8c3bc39b53d24502d87a54a1127309cb01fc992469f13091916ca68302be5
|
7
|
+
data.tar.gz: 406c174d72ab2608f55ab7e1977ea1b76ead887c8d7a95992916d8df68e50409d181197da4586719ca005771a349185bdcf4e999697760050251a832037f7fba
|
data/src/run.rb
CHANGED
@@ -98,10 +98,39 @@ def are_you_sure?(text = "Are you sure?")
|
|
98
98
|
exit 9 unless answer == "y"
|
99
99
|
end
|
100
100
|
|
101
|
+
def menu(text, choices)
|
102
|
+
labels = nil
|
103
|
+
values = nil
|
104
|
+
choice = nil
|
105
|
+
|
106
|
+
if choices.is_a?(Array)
|
107
|
+
labels = choices
|
108
|
+
values = choices
|
109
|
+
elsif choices.is_a?(Hash)
|
110
|
+
labels = choices.keys
|
111
|
+
values = choices.values
|
112
|
+
else
|
113
|
+
puts "menu() 'choices' parameter must be an Array or an Hash".red
|
114
|
+
exit 10
|
115
|
+
end
|
116
|
+
|
117
|
+
loop do
|
118
|
+
labels.each_with_index do |label, index|
|
119
|
+
puts "#{index + 1}. #{label}"
|
120
|
+
end
|
121
|
+
puts text
|
122
|
+
choice = STDIN.gets.chomp.to_i
|
123
|
+
break if !values[choice - 1].nil?
|
124
|
+
end
|
125
|
+
puts
|
126
|
+
|
127
|
+
values[choice - 1]
|
128
|
+
end
|
129
|
+
|
101
130
|
# @param uri [String]
|
102
131
|
def require_remote(uri)
|
103
132
|
cache_path = "/tmp/run_cache_#{Digest::MD5.hexdigest(uri)}"
|
104
|
-
if !File.
|
133
|
+
if !File.exist? cache_path
|
105
134
|
File.write(cache_path, URI.parse(uri).open.read)
|
106
135
|
end
|
107
136
|
eval File.read(cache_path)
|
@@ -122,7 +151,7 @@ end
|
|
122
151
|
|
123
152
|
RUNFILE = "Runfile.rb"
|
124
153
|
|
125
|
-
if !File.
|
154
|
+
if !File.exist?(RUNFILE)
|
126
155
|
puts
|
127
156
|
puts "#{RUNFILE} does not exist".red
|
128
157
|
exit 7
|
@@ -180,7 +209,7 @@ if VERSION && HOMEPAGE
|
|
180
209
|
.read
|
181
210
|
version = /^\s*s.version\s*=\s*"(.+?)"\s*$/.match(contents)
|
182
211
|
if !version.nil?
|
183
|
-
next if File.
|
212
|
+
next if File.exist?("/tmp/run_dismiss_#{version}")
|
184
213
|
current = VERSION.split "."
|
185
214
|
latest = version[1].split "."
|
186
215
|
if current[0].to_i < latest[0].to_i ||
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: run_tasks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Aurélien Delogu
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-08-08 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email: aurelien.delogu@gmail.com
|