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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9efa398b5efae7c257b7db93c326bdca21a590f4
4
- data.tar.gz: 84b22e1be7a644315a96f6b578638f11d09560da
3
+ metadata.gz: 7b272606703927506851d9c9025118cbbbc58474
4
+ data.tar.gz: 0c822de7e9d818be0f98b568adc05bc45130c082
5
5
  SHA512:
6
- metadata.gz: bd46857742342f3e1e7a4e875a233c789c80c606bcc2749d7345a65c31224d130b25a7cddf880b1b11a7737831d872c781c196a458a46bc892dccd7074297549
7
- data.tar.gz: eb1470ff54a0d99c48602af296e4e44f7f6d0b88ed808db05e406739efe4942c5396982727b83957ab5fbadf9debae471d8a85d3bf0c7f891e28c97007f1905d
6
+ metadata.gz: 0659e47c8b0cd86d194d452097865729e7951aaeaf9eb49eacc81d1bc4aadbf57557c18b5897703955efbc365ee0f48967729e14ab7d797e3dc8b8be5e75e19b
7
+ data.tar.gz: e29eb11a5b04806c20935a61060b2445ce16fa8fdffe9abd545fc871deaaff6bb01c9968060dde835ecaf8d7193c04a7532e79859fb8338fde2c62c4833cc612
@@ -1,3 +1,3 @@
1
1
  module FancyGets
2
- VERSION = "0.1.6"
2
+ VERSION = "0.1.7"
3
3
  end
data/lib/fancy_gets.rb CHANGED
@@ -1,4 +1,4 @@
1
- require "fancy_gets/version"
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?(Fixnum)
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 chosen.class.name
241
- when "Fixnum"
240
+ case
241
+ when chosen.is_a?(Numeric)
242
242
  chosen = [chosen]
243
- when "String"
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 "Array"
249
+ when chosen.is_a?(Array)
250
250
  chosen.each_with_index do |item, i|
251
- case item.class.name
252
- when "String"
251
+ case
252
+ when item.is_a?(String)
253
253
  chosen[i] = words.index(item)
254
- when "Fixnum"
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.6
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: 2016-09-21 00:00:00.000000000 Z
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.5.1
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