inquirer.rb 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: 5c44e2fd3b578b73dd8b2e90646c06d01f7273ac
4
- data.tar.gz: df311f6b2c00c57154933765a6cd3acdf22622a1
3
+ metadata.gz: 95687b75315b907d171b0d7ac849cb099b7a01c0
4
+ data.tar.gz: 63e2c2c70d7b6aa007acd3851b8922c78de57151
5
5
  SHA512:
6
- metadata.gz: 4170679a66b06b13cd41cf169424802a6e0285f018f3949c51d52e559bda6eab4b1a2b48937398a1b12058e10fb50e13443b003776ed201e86f79ed3f37bf361
7
- data.tar.gz: 5e84ad5c8b9548729d521049510ef1f71ae00c7d62c7cb46572b2c3d387e09594e0e01ce9d9ee16f2f85df265c963be5a48d06e530b0b29ee4674cebd979b2f0
6
+ metadata.gz: b6f6fa4b57a411c6127353ab3fccb0ddbac4f4968a0a5bda9f0f0cd44e6fe8c38c71cd70c22b8f0f3f696c9e0ca3269b3ec41855b6140398a796bcef10006d74
7
+ data.tar.gz: 638ff1925b2eb812426f96f0584604f1f7d602eec91149dc256cba20aa319611b5021ac634af511e7213a7c7954be1dcf0ff300d86689fbc65a88508e4db3ebb
@@ -66,6 +66,11 @@ module Checkbox
66
66
  @position = (@position + 1) % @choices.length
67
67
  when 'space'
68
68
  @choices[@position][:checked] = !@choices[@position][:checked]
69
+ when 'escape'
70
+ @choices.map! { |choice|
71
+ choice[:checked] = false
72
+ choice
73
+ }
69
74
  when 'return'
70
75
  if opts[:validate] and opts[:validate].is_a?(Proc)
71
76
 
@@ -132,7 +132,15 @@ module CheckboxFilterable
132
132
 
133
133
  check_no_match
134
134
  when 'escape'
135
- @filter = ''
135
+
136
+ if @filter == ''
137
+ @choices.map! { |choice|
138
+ choice[:checked] = false
139
+ choice
140
+ }
141
+ else
142
+ @filter = ''
143
+ end
136
144
 
137
145
  filter_choices
138
146
  else
@@ -1,3 +1,3 @@
1
1
  module Inquirer
2
- VERSION = '0.0.5'
2
+ VERSION = '0.0.6'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inquirer.rb
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
  - Thorsten Eckel