cliprompt 0.0.5 → 0.0.6

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: 61b352cf68eda3ca18f4051cacd85dd3047ac665
4
- data.tar.gz: 156fb8f2414b6f4eee18ddb63ac8c05b25f33673
3
+ metadata.gz: 04f12cf2b8e82c51df71fe099a3708d979b3a3dd
4
+ data.tar.gz: 56289bd518a61668d9cff09de0a41f092b7a513e
5
5
  SHA512:
6
- metadata.gz: be597dccf32f0a9c761b2b7d88b4af36040cfa91942371f8f64d99263ad5346e976d36b66bb38b9b8e4449b43ca023ba1b3d787142136a9ee8a970c07843520a
7
- data.tar.gz: 03fd5bd35e18510a1b30c06e87c46e6122948f05ae2629bf23b6b2346fb5b15407d539feede545c4b69e3cc78dab94c6bcb0c176b194e5f3119819c33b1db79c
6
+ metadata.gz: 4ba1d3c8c114c98739e4269c2a783bc1217f5fa50a468ffb385922485e84615d74af2f12e0f0094a4dacf2256f6f0510d0311c84052f74a96780a54d2a78962e
7
+ data.tar.gz: e4d6edcc4455ee944299c57892022be2798869068f8a483a2b62babc35cf71cac5fd01f087fdcdb19064b4c10b0d059a234f1dc087c46e3268a7afb1732edfa6
data/CHANGELOG.md CHANGED
@@ -1,6 +1,11 @@
1
1
  Cliprompt Changelog
2
2
  =====================
3
3
 
4
+ v0.0.6 - 2014-08-10
5
+ --------------------
6
+
7
+ - fix validation of list type to be a number
8
+
4
9
  v0.0.5 - 2014-05-27
5
10
  --------------------
6
11
 
data/lib/cliprompt.rb CHANGED
@@ -10,6 +10,7 @@ module Cliprompt
10
10
  MSG_MANDATORY_TEXT = "Sorry you need to fill that information."
11
11
  MSG_YES_OR_NO = "You need to answer by yes, no, y, n, 1 or 0."
12
12
  MSG_CHOSE_IN_LIST = "You need to chose between the available options."
13
+ MSG_INPUT_A_NUMBER = "You need input a number."
13
14
  MSG_CHOSE_A_NUMBER = "Choose a number:"
14
15
 
15
16
  def ask(question, *options)
@@ -157,6 +157,7 @@ module Cliprompt
157
157
 
158
158
  def check_list(question, answer)
159
159
  return ask_again(question, Cliprompt::MSG_CHOSE_IN_LIST) unless answer.to_i < @choices.count
160
+ return ask_again(question, Cliprompt::MSG_INPUT_A_NUMBER) unless /[0-9]+/.match(answer)
160
161
  @choices[answer.to_i]
161
162
  end
162
163
 
@@ -1,3 +1,3 @@
1
1
  module Cliprompt
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.6"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cliprompt
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - mose
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-27 00:00:00.000000000 Z
11
+ date: 2014-08-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: paint