169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
|
# File 'lib/dialog_tui.rb', line 169
def act
dialog {
option '1. hey' do
puts 'you choose the first one!'
end
option '2. hi!' do
puts 'you choose the second one!'
end
option '3. bye' do
puts '*waving*'
end
ctrl_c do
puts 'ctrl+c worked!'
exit 0
end
before_draw do
system 'clear'
puts
puts ?_*10
puts 'manual testing here - use arrows and enter'
puts 'no way to fail it - just look at behavior'
puts 'ctrl+c when finished'
end
}.
tap { |result|
raise unless result.nil?
}
end
|