fancy_gets 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/fancy_gets/version.rb +1 -1
- data/lib/fancy_gets.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ff5d475c55794cbbeb171f984781e0e9e953f786
|
4
|
+
data.tar.gz: c1ee7c43108ebdee5d411f77ce00adee5979d028
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 55d84b9ec732bcaf7346715fc3708be30480071888dbce1b3a7072ec69c8e44022a45fee5923b0dd0707005df13055603bb0f75507c9721036c0c42e87cdbccc
|
7
|
+
data.tar.gz: bfb4ba37970492e8a901cdd09621daa212b0cdae6e9805ab2bb6544c9edbe87a9cc5b3178330f29c08950d57de0f4fabf0c5025c75d8640567b2bd269d7a257f
|
data/README.md
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
This gem exists to banish crusty UX that our users endure at the command line.
|
4
4
|
|
5
5
|
For far too long we've been stuck with just gets and getc. When prompting the
|
6
|
-
user with a list of choices, wouldn't it be nice to have the feel of a <select>
|
6
|
+
user with a list of choices, wouldn't it be nice to have the feel of a < select >
|
7
7
|
in HTML? Or to auto-suggest options as they type? Or perhaps offer a password
|
8
8
|
entry with asterisks instead of just sitting silent, which confuses many users?
|
9
9
|
|
@@ -63,7 +63,7 @@ Another cool thing this allows is to change the color of selected items. You ma
|
|
63
63
|
to check out Michał Kalbarczyk's [colorize gem](https://github.com/fazibear/colorize "Michał loves all things \033") for more info.
|
64
64
|
|
65
65
|
```ruby
|
66
|
-
another_toy = gets_list(toys, false, nil, "
|
66
|
+
another_toy = gets_list(toys, false, nil, "\033[1;31m", "\033[0m <==", "Use arrows to pick something awesome.")
|
67
67
|
puts "\nSo much to love about #{another_toy}."
|
68
68
|
```
|
69
69
|
|
data/lib/fancy_gets/version.rb
CHANGED
data/lib/fancy_gets.rb
CHANGED
@@ -40,7 +40,7 @@ module FancyGets
|
|
40
40
|
|
41
41
|
write_sugg = lambda do
|
42
42
|
# Find first word that case-insensitive matches what they've typed
|
43
|
-
if string.
|
43
|
+
if string.empty?
|
44
44
|
sugg = ""
|
45
45
|
else
|
46
46
|
sugg = words.select { |word| uncolor.call(word).downcase.start_with? string.downcase }.first || ""
|