Sha256: a1ae94a618f35c1727bd37831014644d423d8af47ba24d5a1277bb4d5fd9dc8b

Contents?: true

Size: 478 Bytes

Versions: 14

Compression:

Stored size: 478 Bytes

Contents

# encoding: utf-8

require 'tty-prompt'

choices = [{
  key: 'y',
  name: 'overwrite this file',
  value: :yes
}, {
  key: 'n',
  name: 'do not overwrite this file',
  value: :no
}, {
  key: 'a',
  name: 'overwrite this file and all later files',
  value: :all
}, {
  key: 'd',
  name: 'show diff',
  value: :diff
}, {
  key: 'q',
  name: 'quit; do not overwrite this file ',
  value: :quit
}]

prompt = TTY::Prompt.new

prompt.expand('Overwrite Gemfile?', choices, default: 3)

Version data entries

14 entries across 14 versions & 2 rubygems

Version Path
tty-prompt-0.13.2 examples/expand.rb
tty-prompt-0.13.1 examples/expand.rb
tty-prompt-0.13.0 examples/expand.rb
austb-tty-prompt-0.13.0 examples/expand.rb
tty-prompt-0.12.0 examples/expand.rb
tty-prompt-0.11.0 examples/expand.rb
tty-prompt-0.10.1 examples/expand.rb
tty-prompt-0.10.0 examples/expand.rb
tty-prompt-0.9.0 examples/expand.rb
tty-prompt-0.8.0 examples/expand.rb
tty-prompt-0.7.1 examples/expand.rb
tty-prompt-0.7.0 examples/expand.rb
tty-prompt-0.6.0 examples/expand.rb
tty-prompt-0.5.0 examples/expand.rb