cliprompt 0.0.5 → 0.0.6
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/CHANGELOG.md +5 -0
- data/lib/cliprompt.rb +1 -0
- data/lib/cliprompt/optionset.rb +1 -0
- data/lib/cliprompt/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: 04f12cf2b8e82c51df71fe099a3708d979b3a3dd
|
4
|
+
data.tar.gz: 56289bd518a61668d9cff09de0a41f092b7a513e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4ba1d3c8c114c98739e4269c2a783bc1217f5fa50a468ffb385922485e84615d74af2f12e0f0094a4dacf2256f6f0510d0311c84052f74a96780a54d2a78962e
|
7
|
+
data.tar.gz: e4d6edcc4455ee944299c57892022be2798869068f8a483a2b62babc35cf71cac5fd01f087fdcdb19064b4c10b0d059a234f1dc087c46e3268a7afb1732edfa6
|
data/CHANGELOG.md
CHANGED
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)
|
data/lib/cliprompt/optionset.rb
CHANGED
@@ -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
|
|
data/lib/cliprompt/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2014-08-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: paint
|