inquirer.rb 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/lib/inquirer/prompts/checkbox.rb +5 -0
- data/lib/inquirer/prompts/checkbox_filterable.rb +9 -1
- data/lib/inquirer/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: 95687b75315b907d171b0d7ac849cb099b7a01c0
|
4
|
+
data.tar.gz: 63e2c2c70d7b6aa007acd3851b8922c78de57151
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
data/lib/inquirer/version.rb
CHANGED