question 0.2.0 → 0.2.1

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: 663229bc3195354972ced413cb6299ab39dcd242
4
- data.tar.gz: e75dda15df55b7f7455525fb8d4b024241ac6227
3
+ metadata.gz: 83f901591d98f8a0534d70563b276c204bbe4451
4
+ data.tar.gz: e0e3997370cd08a073a09022c742e4155516d40c
5
5
  SHA512:
6
- metadata.gz: e49c381bae23ff13be2a3cc506f4b6e973b29ddff3103038c8f09310097f17238f3091f34c15d9b01a07ab319b2a577bb3d3f5529305ece15c08b59f4476f248
7
- data.tar.gz: c37c13bfce998409f1617aa8bc3595c66019e70e8e54ee514fc41b3656c9332982a988ab12d3c6aee4592d6a40ac7ebc1385c3a245c991fca151848d6f3ce5dd
6
+ metadata.gz: 4fa04fab0bbd57cecd148baaea5049136816bacffdfdfc9e69e393630044ac8651ef52eaf50aa219e19047519a6a43f84f68f2342b35ef9fc5183c54305dad2c
7
+ data.tar.gz: 114a80ff4b12e5001a58b7a3fc3787a7de8cfdaa797615bca519e0f69ce4f569488e76e0768c9235fbb4e7b826c8396952bd13698f4530ddedb83a9c0e16dd24
data/.gitignore CHANGED
@@ -1 +1 @@
1
- /vendor
1
+ /pkg
data/README.md CHANGED
@@ -1,22 +1,8 @@
1
1
  # Question
2
2
 
3
- Inspired by [Inquirer.js](https://github.com/SBoudrias/Inquirer.js/)
3
+ UI elements for cli apps (inspired by [Inquirer.js](https://github.com/SBoudrias/Inquirer.js/))
4
4
 
5
- ### Checkbox List
6
-
7
- ![http://cl.ly/image/3h1G1a1S3X0A/Image%202015-01-14%20at%2012.51.16%20PM.png](http://cl.ly/image/3h1G1a1S3X0A/Image%202015-01-14%20at%2012.51.16%20PM.png)
8
-
9
- ### List
10
- ![http://cl.ly/image/0s1E0S2f0c3M/Image%202015-01-14%20at%2012.51.45%20PM.png](http://cl.ly/image/0s1E0S2f0c3M/Image%202015-01-14%20at%2012.51.45%20PM.png)
11
-
12
- ### Input
13
- ![http://cl.ly/image/1c3i2d3e3z2v/Image%202015-01-14%20at%2012.52.01%20PM.png](http://cl.ly/image/1c3i2d3e3z2v/Image%202015-01-14%20at%2012.52.01%20PM.png)
14
-
15
- ### Confirm
16
- ![http://cl.ly/image/2H0e101H1q3W/Image%202015-01-14%20at%2012.52.26%20PM.png](http://cl.ly/image/2H0e101H1q3W/Image%202015-01-14%20at%2012.52.26%20PM.png)
17
-
18
- ### End Result
19
- ![https://s3.amazonaws.com/f.cl.ly/items/2K3w1Y0F2T2o1505191J/Image%202015-01-14%20at%2012.35.04%20PM.png](https://s3.amazonaws.com/f.cl.ly/items/2K3w1Y0F2T2o1505191J/Image%202015-01-14%20at%2012.35.04%20PM.png)
5
+ ![cd616c38e4be55ddc71072b8e435bbc5](https://cloud.githubusercontent.com/assets/596/5765298/359651d0-9cad-11e4-8f32-8540b6ddf0c3.gif)
20
6
 
21
7
  ## Installation
22
8
 
data/Rakefile CHANGED
@@ -6,4 +6,3 @@ Rake::TestTask.new(:test) do |t|
6
6
  end
7
7
 
8
8
  task :default => :test
9
-
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
@@ -1,3 +1,3 @@
1
1
  module Question
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: question
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - probablycorey