fancy_gets 0.1.8 → 0.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/fancy_gets.rb +4 -4
- data/lib/fancy_gets/version.rb +1 -1
- 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: 71e6d543b0daf8b20b20b1989906a112a880d23d
|
4
|
+
data.tar.gz: 94b96b2bc2ffdd3f58c8adadbb0dd85bab7ecbc4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cf666cb9f9b1dc866dcfa2f451c975ae83814b7d156afa912b0f39a20c92adb4bcd772c929329d996470d92261a6fb1b1ff86f6ee81574a86cc5f12b0674bbd3
|
7
|
+
data.tar.gz: 0724abbfc5585e79ba86337726f4c3c7380074376b2e12f7ee7bf109890e6f902fbdf5affe87ff63112ef22d3dc47ecac421663cf892770cc3e1597b9b0cd093
|
data/lib/fancy_gets.rb
CHANGED
@@ -43,7 +43,7 @@ module FancyGets
|
|
43
43
|
unless word_objects.nil? || is_list
|
44
44
|
word_objects.sort! {|wo1, wo2| wo1.to_s <=> wo2.to_s}
|
45
45
|
end
|
46
|
-
words = word_objects.map(&:to_s)
|
46
|
+
words = word_objects.nil? ? [] : word_objects.map(&:to_s)
|
47
47
|
if is_multiple
|
48
48
|
chosen ||= [0] unless is_multiple
|
49
49
|
else
|
@@ -367,7 +367,7 @@ module FancyGets
|
|
367
367
|
when 127 # Backspace
|
368
368
|
if !is_list && position > 0
|
369
369
|
string = string[0...position - 1] + string[position..-1]
|
370
|
-
if words.
|
370
|
+
if words.empty?
|
371
371
|
position -= 1
|
372
372
|
print "\b#{is_password ? "*" * (string.length - position) : string[position..-1]} #{"\b" * (string.length - position + 1)}"
|
373
373
|
else
|
@@ -379,7 +379,7 @@ module FancyGets
|
|
379
379
|
when 126 # Delete (forwards)
|
380
380
|
if !is_list && position < string.length
|
381
381
|
string = string[0...position] + string[position + 1..-1]
|
382
|
-
if words.
|
382
|
+
if words.empty?
|
383
383
|
print "#{is_password ? "*" * (string.length - position) : string[position..-1]} #{"\b" * (string.length - position + 1)}"
|
384
384
|
else
|
385
385
|
prev_sugg = sugg
|
@@ -439,7 +439,7 @@ module FancyGets
|
|
439
439
|
end
|
440
440
|
else
|
441
441
|
string = string[0...position] + ch + string[position..-1]
|
442
|
-
if words.
|
442
|
+
if words.empty?
|
443
443
|
ch = "*" if is_password
|
444
444
|
position += 1
|
445
445
|
print "#{ch}#{is_password ? "*" * (string.length - position) : string[position..-1]}#{"\b" * (string.length - position)}"
|
data/lib/fancy_gets/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fancy_gets
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lorin Thwaits
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-05-
|
11
|
+
date: 2017-05-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|