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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 274606db5f52db34b0cf2a30e93e937d35f2318f
4
- data.tar.gz: 713e3c90a53dba4072454091db98d7172f93f589
3
+ metadata.gz: 71e6d543b0daf8b20b20b1989906a112a880d23d
4
+ data.tar.gz: 94b96b2bc2ffdd3f58c8adadbb0dd85bab7ecbc4
5
5
  SHA512:
6
- metadata.gz: 5c435f2ee2daae5308f6a454f75e8094922866567a877e559d8500a1823a99f2358d581762ba422da17676a47990b5ed371ee8eea802abc66e11860f0f2bf47c
7
- data.tar.gz: 423eec52b1efabfc1c025b023c41312b9a7ca946aa369cd7ab3878aba2e12edd69adc47cae5f43ce6a830363b62c9d4c3e877ef32ef25334d24daafd7e1f73db
6
+ metadata.gz: cf666cb9f9b1dc866dcfa2f451c975ae83814b7d156afa912b0f39a20c92adb4bcd772c929329d996470d92261a6fb1b1ff86f6ee81574a86cc5f12b0674bbd3
7
+ data.tar.gz: 0724abbfc5585e79ba86337726f4c3c7380074376b2e12f7ee7bf109890e6f902fbdf5affe87ff63112ef22d3dc47ecac421663cf892770cc3e1597b9b0cd093
@@ -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.nil?
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.nil?
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.nil?
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)}"
@@ -1,3 +1,3 @@
1
1
  module FancyGets
2
- VERSION = "0.1.8"
2
+ VERSION = "0.1.9"
3
3
  end
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.8
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-16 00:00:00.000000000 Z
11
+ date: 2017-05-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler