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)
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/github/ui.rb', line 9 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 |