question 0.2.0 → 0.2.1
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/.gitignore +1 -1
- data/README.md +2 -16
- data/Rakefile +0 -1
- data/examples/example.rb +4 -0
- data/lib/question/list.rb +2 -2
- data/lib/question/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 83f901591d98f8a0534d70563b276c204bbe4451
|
4
|
+
data.tar.gz: e0e3997370cd08a073a09022c742e4155516d40c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4fa04fab0bbd57cecd148baaea5049136816bacffdfdfc9e69e393630044ac8651ef52eaf50aa219e19047519a6a43f84f68f2342b35ef9fc5183c54305dad2c
|
7
|
+
data.tar.gz: 114a80ff4b12e5001a58b7a3fc3787a7de8cfdaa797615bca519e0f69ce4f569488e76e0768c9235fbb4e7b826c8396952bd13698f4530ddedb83a9c0e16dd24
|
data/.gitignore
CHANGED
@@ -1 +1 @@
|
|
1
|
-
/
|
1
|
+
/pkg
|
data/README.md
CHANGED
@@ -1,22 +1,8 @@
|
|
1
1
|
# Question
|
2
2
|
|
3
|
-
|
3
|
+
UI elements for cli apps (inspired by [Inquirer.js](https://github.com/SBoudrias/Inquirer.js/))
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-

|
8
|
-
|
9
|
-
### List
|
10
|
-

|
11
|
-
|
12
|
-
### Input
|
13
|
-

|
14
|
-
|
15
|
-
### Confirm
|
16
|
-

|
17
|
-
|
18
|
-
### End Result
|
19
|
-

|
5
|
+

|
20
6
|
|
21
7
|
## Installation
|
22
8
|
|
data/Rakefile
CHANGED
data/examples/example.rb
CHANGED
@@ -10,7 +10,11 @@ choices = [
|
|
10
10
|
]
|
11
11
|
|
12
12
|
pp Question.checkbox_list("What colors do you like", choices, default: choices[1..-1])
|
13
|
+
puts
|
13
14
|
pp Question.list("What is your FAVORITE color", choices)
|
15
|
+
puts
|
14
16
|
pp Question.input("What is your name?", default: ENV["USER"])
|
17
|
+
puts
|
15
18
|
pp Question.password("Enter something secret")
|
19
|
+
puts
|
16
20
|
pp Question.confirm("Do you understand")
|
data/lib/question/list.rb
CHANGED
@@ -33,10 +33,10 @@ module Question
|
|
33
33
|
exit 130
|
34
34
|
when TTY::CODE::RETURN, TTY::CODE::SPACE
|
35
35
|
@finished = true
|
36
|
-
when TTY::CODE::DOWN
|
36
|
+
when TTY::CODE::DOWN, TTY::CODE::CTRL_J, TTY::CODE::CTRL_N
|
37
37
|
@active_index += 1
|
38
38
|
@active_index = 0 if @active_index >= @choices.length
|
39
|
-
when TTY::CODE::UP
|
39
|
+
when TTY::CODE::UP, TTY::CODE::CTRL_K, TTY::CODE::CTRL_P
|
40
40
|
@active_index -= 1
|
41
41
|
@active_index = @choices.length - 1 if @active_index < 0
|
42
42
|
end
|
data/lib/question/version.rb
CHANGED