micromenu 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/um +12 -10
- 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: e8110a88cf939a9561fb6d835016144262e241c92bfc93f5438324205f5c4e80
|
4
|
+
data.tar.gz: d41cbbfbc078055e2320c0f9464c1c83a5e6d158173d09f17e32a92385b178f2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6616c5d4307c686f2a88e8e75262a2b19d515c3711e21da24c1e257a04783010fce6156d2b9b5c4c00978d733dd19781f53a64a016a52d3588b8ffc18eca855f
|
7
|
+
data.tar.gz: 18b6eb6a18d2078d4dd6451d6611cd4fa23fabb9ad097b66bfeee01989ca4aefcea919a668c4f6ae5b0e06780c7400d6b6101be043c21d765de20e895f0f6c77
|
data/bin/um
CHANGED
@@ -4,8 +4,8 @@ require 'tty-prompt'
|
|
4
4
|
|
5
5
|
home = Dir.getwd
|
6
6
|
|
7
|
-
if ARGV.length
|
8
|
-
# if the first argument looks like something other than a
|
7
|
+
if ARGV.length.positive?
|
8
|
+
# if the first argument looks like something other than a number
|
9
9
|
if ARGV[0].to_i.to_s != ARGV[0]
|
10
10
|
dir = ARGV.shift
|
11
11
|
Dir.chdir dir
|
@@ -33,21 +33,23 @@ def prompt
|
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
36
|
+
def show_prompt(options)
|
37
|
+
help = "(Use ↑/↓ arrow keys or numbers to select)"
|
38
|
+
prompt.select('Select an action:', options, enum: ')', cycle: true, help: help)
|
39
|
+
rescue TTY::Reader::InputInterrupt
|
40
|
+
bye
|
41
|
+
end
|
42
|
+
|
36
43
|
def choose(options)
|
37
|
-
if ARGV.length
|
44
|
+
if ARGV.length.positive?
|
38
45
|
ARGV.shift
|
39
46
|
else
|
40
|
-
|
41
|
-
help = "(Use ↑/↓ arrow keys or numbers to select)"
|
42
|
-
prompt.select('Select an action:', options, enum: ')', cycle: true, help: help)
|
43
|
-
rescue TTY::Reader::InputInterrupt
|
44
|
-
bye
|
45
|
-
end
|
47
|
+
show_prompt(options)
|
46
48
|
end
|
47
49
|
end
|
48
50
|
|
49
51
|
def args
|
50
|
-
if ARGV.length
|
52
|
+
if ARGV.length.positive?
|
51
53
|
ARGV
|
52
54
|
else
|
53
55
|
prompt.ask('Arguments:')&.split || []
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: micromenu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tristan Penman
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-05-
|
11
|
+
date: 2022-05-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tty-prompt
|