-
Notifications
You must be signed in to change notification settings - Fork 139
Open
Labels
Description
The RDoc says to use the gather attribute of a Question to select multiple items. This works when using ask, but it fails when using choose. This seems odd since Menu (passed to the choose block) inherits from Question (passed to the ask block)
This code
#!/usr/bin/env ruby
require 'highline/import'
require 'rb-readline'
choices = %w[ rabbit caterpillar frog ]
x = choose do |menu|
menu.prompt = "Animal? "
menu.choices(*choices)
menu.gather = 3
endgenerates, after entering three choices, this error:
/Users/seanmackesey/.rvm/gems/ruby-1.9.3-p194/gems/highline-1.6.15/lib/highline/menu.rb:303:in `[]': no implicit conversion from nil to integer (TypeError)
It seems like menu should work with gather. Is it not intended to? You also get an error if you set gather to a string/regexp.
mradcliffe