fancy_gets 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fancy_gets/version.rb +1 -1
- data/lib/fancy_gets.rb +9 -9
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7b272606703927506851d9c9025118cbbbc58474
|
4
|
+
data.tar.gz: 0c822de7e9d818be0f98b568adc05bc45130c082
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0659e47c8b0cd86d194d452097865729e7951aaeaf9eb49eacc81d1bc4aadbf57557c18b5897703955efbc365ee0f48967729e14ab7d797e3dc8b8be5e75e19b
|
7
|
+
data.tar.gz: e29eb11a5b04806c20935a61060b2445ce16fa8fdffe9abd545fc871deaaff6bb01c9968060dde835ecaf8d7193c04a7532e79859fb8338fde2c62c4833cc612
|
data/lib/fancy_gets/version.rb
CHANGED
data/lib/fancy_gets.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
require_relative "fancy_gets/version"
|
2
2
|
require 'io/console'
|
3
3
|
|
4
4
|
module FancyGets
|
@@ -26,7 +26,7 @@ module FancyGets
|
|
26
26
|
words = words[:list]
|
27
27
|
else
|
28
28
|
# Trying to supply parameters but left out a "true" for is_multiple?
|
29
|
-
if is_multiple.is_a?(Enumerable) || is_multiple.is_a?(String) || is_multiple.is_a?(
|
29
|
+
if is_multiple.is_a?(Enumerable) || is_multiple.is_a?(String) || is_multiple.is_a?(Numeric)
|
30
30
|
chosen = is_multiple
|
31
31
|
is_multiple = false
|
32
32
|
end
|
@@ -237,21 +237,21 @@ module FancyGets
|
|
237
237
|
# Initialize everything
|
238
238
|
if is_list
|
239
239
|
# Maybe confirm the height is adequate by checking out IO.console.winsize
|
240
|
-
case
|
241
|
-
when
|
240
|
+
case
|
241
|
+
when chosen.is_a?(Numeric)
|
242
242
|
chosen = [chosen]
|
243
|
-
when
|
243
|
+
when chosen.is_a?(String)
|
244
244
|
if words.include?(chosen)
|
245
245
|
chosen = [words.index(chosen)]
|
246
246
|
else
|
247
247
|
chosen = []
|
248
248
|
end
|
249
|
-
when
|
249
|
+
when chosen.is_a?(Array)
|
250
250
|
chosen.each_with_index do |item, i|
|
251
|
-
case
|
252
|
-
when
|
251
|
+
case
|
252
|
+
when item.is_a?(String)
|
253
253
|
chosen[i] = words.index(item)
|
254
|
-
when
|
254
|
+
when item.is_a?(Numeric)
|
255
255
|
chosen[i] = nil if item < 0 || item >= words.length
|
256
256
|
else
|
257
257
|
chosen[i] = word_objects.index(item)
|
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.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lorin Thwaits
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-05-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -101,7 +101,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
101
101
|
version: '0'
|
102
102
|
requirements: []
|
103
103
|
rubyforge_project:
|
104
|
-
rubygems_version: 2.
|
104
|
+
rubygems_version: 2.6.7
|
105
105
|
signing_key:
|
106
106
|
specification_version: 4
|
107
107
|
summary: Enhanced gets with listbox, auto-complete, and password support
|