Module: Cli
Class Method Summary collapse
Class Method Details
.list_options(message, items, opts = {}) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/sqs_cli/cli.rb', line 13 def self.(, items, opts={}) items += ["File..."] if opts[:include_file] items += ["STDOUT"] if opts[:include_stdout] index = Ask.list , items if opts[:include_file] && items[index] == "File..." { filename: (Ask.input "Filename", default: "sqs-cli.b64") } elsif opts[:include_stdout] && items[index] == "STDOUT" { stream: $stdout } else { selected_item: items[index] } end end |
.wait_with_message(message) ⇒ Object
6 7 8 9 10 11 |
# File 'lib/sqs_cli/cli.rb', line 6 def self.() print result = yield if block_given? print "\r\e[K" result end |