bunchcli 1.1.4 → 1.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile +1 -0
- data/Gemfile.lock +3 -1
- data/lib/bunch.rb +1 -0
- data/lib/bunch/url_generator.rb +6 -5
- data/lib/bunch/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 85429d178706578f82263c19457bf79b369efee746ac17172e1b065c6fb4a1eb
|
4
|
+
data.tar.gz: 12dc65b8c0c8c3b86c3ef050c30e4aa756b8596ca0388d4c4c89b1bdf0db3beb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b38da1ccef956f64112c4aa70f2f195b9200f134cf7415d7ed5651e93719acb2d289462b171d61ff7573566467b6804b0039f27ed681fbaf56e758c0428b713b
|
7
|
+
data.tar.gz: 57de9a2b54ad9f6de4bc9328c1badd2342e1b7c8ac6683d3aa4ef4a098d9fcdd03f6d6d01bf1b99b49faad27c4b675793256bbcf22c864d901a2bf6f57e64d07
|
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,12 +1,13 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
bunchcli (1.1.
|
4
|
+
bunchcli (1.1.4)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
8
8
|
specs:
|
9
9
|
rake (12.3.3)
|
10
|
+
term-colorizer (0.2.1)
|
10
11
|
|
11
12
|
PLATFORMS
|
12
13
|
x86_64-darwin-19
|
@@ -14,6 +15,7 @@ PLATFORMS
|
|
14
15
|
DEPENDENCIES
|
15
16
|
bunchcli!
|
16
17
|
rake (~> 12.0)
|
18
|
+
term-colorizer
|
17
19
|
|
18
20
|
BUNDLED WITH
|
19
21
|
2.2.4
|
data/lib/bunch.rb
CHANGED
data/lib/bunch/url_generator.rb
CHANGED
@@ -49,7 +49,8 @@ module Prompt
|
|
49
49
|
def get_line(query = '->')
|
50
50
|
stty_save = `stty -g`.chomp
|
51
51
|
begin
|
52
|
-
|
52
|
+
print query.bright_green
|
53
|
+
line = Readline.readline(": ", true)
|
53
54
|
rescue Interrupt
|
54
55
|
system('stty', stty_save) # Restore
|
55
56
|
exit
|
@@ -60,7 +61,7 @@ module Prompt
|
|
60
61
|
def get_text(query = 'Enter text, ^d to end')
|
61
62
|
stty_save = `stty -g`.chomp
|
62
63
|
lines = []
|
63
|
-
puts query
|
64
|
+
puts query.bright_green
|
64
65
|
begin
|
65
66
|
while (line = Readline.readline)
|
66
67
|
lines << line
|
@@ -102,15 +103,15 @@ class Menu
|
|
102
103
|
def choose(query = 'Select an item')
|
103
104
|
throw 'No items initialized' if @items.nil?
|
104
105
|
STDERR.puts
|
105
|
-
STDERR.puts "┌#{("─" * 74)}┐"
|
106
|
+
STDERR.puts "┌#{("─" * 74)}┐".yellow
|
106
107
|
intpad = Math::log10(@items.length).to_i + 1
|
107
108
|
@items.each_with_index do |item, idx|
|
108
109
|
idxstr = "%#{intpad}d" % (idx + 1)
|
109
110
|
line = "#{idxstr}: #{item.title}"
|
110
111
|
pad = 74 - line.length
|
111
|
-
STDERR.puts "
|
112
|
+
STDERR.puts "│".yellow + "#{line}#{" " * pad}".bright_white + "│".yellow
|
112
113
|
end
|
113
|
-
STDERR.puts "└┤ #{query} ├#{"─" * (70 - query.length)}┘"
|
114
|
+
STDERR.puts "└┤".yellow + " #{query} ".bright_green + "├#{"─" * (70 - query.length)}┘".yellow
|
114
115
|
sel = choose_number("> ", @items.length)
|
115
116
|
sel ? @items[sel.to_i - 1] : nil
|
116
117
|
end
|
data/lib/bunch/version.rb
CHANGED