Class: GitHelper::HighlineCli
- Inherits:
-
Object
- Object
- GitHelper::HighlineCli
- Defined in:
- lib/git_helper/highline_cli.rb
Instance Method Summary collapse
Instance Method Details
#ask(prompt) ⇒ Object
5 6 7 8 9 |
# File 'lib/git_helper/highline_cli.rb', line 5 def ask(prompt) cli.ask(prompt) do |conf| conf.readline = true end.to_s end |
#ask_options(prompt, choices) ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/git_helper/highline_cli.rb', line 11 def (prompt, choices) = '' choices.each { |choice| << "#{choices.index(choice) + 1}. #{choice}\n" } compiled_prompt = "#{prompt}\n#{.strip}" cli.ask(compiled_prompt) do |conf| conf.readline = true end.to_i - 1 end |