question 0.2.1 → 0.2.2

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: 83f901591d98f8a0534d70563b276c204bbe4451
4
- data.tar.gz: e0e3997370cd08a073a09022c742e4155516d40c
3
+ metadata.gz: 7c6221ba692ba5ab29d3a1d8d01913ac92efd67a
4
+ data.tar.gz: 44f6b1edcfa1ee780bdfe2c68e4d05df781fbb1a
5
5
  SHA512:
6
- metadata.gz: 4fa04fab0bbd57cecd148baaea5049136816bacffdfdfc9e69e393630044ac8651ef52eaf50aa219e19047519a6a43f84f68f2342b35ef9fc5183c54305dad2c
7
- data.tar.gz: 114a80ff4b12e5001a58b7a3fc3787a7de8cfdaa797615bca519e0f69ce4f569488e76e0768c9235fbb4e7b826c8396952bd13698f4530ddedb83a9c0e16dd24
6
+ metadata.gz: eeb5997c4743f9171cd08bc80ae58342a35518bf77de00bf20f16a1eac4c0b54eabc20042a31fd8db7a7ece9e5bd13a229b45a49909b380af56acd3fdd20e521
7
+ data.tar.gz: 4edd04fe42eff294e26726c9d3315a8976723104b23737a9a099e953d3eaa5fe9d690fc9dee40595f0f726ad3b5651fb5dcd34abe762a56e755d2c38f2c12d7b
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  UI elements for cli apps (inspired by [Inquirer.js](https://github.com/SBoudrias/Inquirer.js/))
4
4
 
5
- ![cd616c38e4be55ddc71072b8e435bbc5](https://cloud.githubusercontent.com/assets/596/5765298/359651d0-9cad-11e4-8f32-8540b6ddf0c3.gif)
5
+ ![ef97a66a98e2e9af8b169c34adb9e91e](https://cloud.githubusercontent.com/assets/596/5766798/10489e5e-9cb9-11e4-96ae-1fd23ebab616.gif)
6
6
 
7
7
  ## Installation
8
8
 
@@ -88,6 +88,7 @@ module Question
88
88
  print label_for_choice(choice)
89
89
  print "\n"
90
90
  end
91
+ print TTY::CODE::NOOP
91
92
  end
92
93
  end
93
94
  end
@@ -17,7 +17,7 @@ module Question
17
17
  end
18
18
 
19
19
  # Use readline so keyboard shortcuts like alt-backspace work
20
- @answer = Readline.readline(question, true)
20
+ @answer = Readline.readline(question + TTY::CODE::NOOP, true)
21
21
  @answer = if @answer =~ /^y/i
22
22
  true
23
23
  elsif @answer =~ /^n/i
@@ -13,7 +13,7 @@ module Question
13
13
  question += "(#{@default}) ".light_white if @default
14
14
 
15
15
  # Use readline so keyboard shortcuts like alt-backspace work
16
- @answer = Readline.readline(question, true)
16
+ @answer = Readline.readline(question + TTY::CODE::NOOP, true)
17
17
  @answer = @default if @default && @answer.length == 0
18
18
 
19
19
  render
@@ -69,7 +69,9 @@ module Question
69
69
  end
70
70
  print "\n"
71
71
  end
72
+ print TTY::CODE::NOOP
72
73
  end
74
+
73
75
  end
74
76
  end
75
77
  end
@@ -40,6 +40,7 @@ module Question
40
40
  print ": "
41
41
  print @finished ? obscured_password.green : obscured_password
42
42
  print "\n"
43
+ print TTY::CODE::NOOP unless @finished
43
44
  end
44
45
  end
45
46
  end
@@ -24,6 +24,8 @@ module Question
24
24
  CLEAR_DOWN = "\e[0J"
25
25
  SAVE = "\e7"
26
26
  RESTORE = "\e8"
27
+
28
+ NOOP = "\e[0n" # Used in tests to determine if a question requires input.
27
29
  end
28
30
 
29
31
  module UI
@@ -1,3 +1,3 @@
1
1
  module Question
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: question
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - probablycorey
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-15 00:00:00.000000000 Z
11
+ date: 2015-02-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler