Module: GitHub::UI
Instance Method Summary collapse
-
#display_select_list(list) ⇒ Object
Take a list of items, including optional ‘ # some description’ on each and return the selected item (without the description).
Instance Method Details
#display_select_list(list) ⇒ Object
Take a list of items, including optional ‘ # some description’ on each and return the selected item (without the description)
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/github/ui.rb', line 8 def display_select_list(list) HighLine.track_eof = false long_result = HighLine.new.choose do || list.each_with_index do |item, i| .choice((i < 9) ? " #{item}" : item) end .header = "Select a repository to clone" end long_result && long_result.gsub(/\s+#.*$/,'').gsub(/^\ /,'') end |