64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
|
# File 'lib/kontena/light_prompt.rb', line 64
def multi_select(*args, &block)
choice_collector = Menu.new
yield choice_collector
choice_collector.add_quit_choice
selections = []
loop do
choice_collector.remove_choices(selections)
answer = prompt.enum_select(*args) do ||
choice_collector.calls.each do |meth, args|
if .respond_to?(meth)
.send(meth, *args)
end
end
choice_collector.choices.each do |choice|
.choice choice.first, choice.last
end
end
break if answer == :done
selections << answer
end
selections
end
|