Sha256: bcc584863bd6a34e10ca7fe715fcf8ced8f2004097d753f79d41d0410d14baff

Contents?: true

Size: 282 Bytes

Versions: 54

Compression:

Stored size: 282 Bytes

Contents

#!/usr/bin/env ruby

require "rubygems"
require "highline/import"

choices = "ynaq"
answer = ask("Your choice [#{choices}]? ") do |q|
           q.echo      = false
           q.character = true
           q.validate  = /\A[#{choices}]\Z/
         end
say("Your choice: #{answer}")

Version data entries

54 entries across 53 versions & 10 rubygems

Version Path
brakeman-3.3.4 bundle/ruby/2.3.0/gems/highline-1.7.8/examples/get_character.rb
brakeman-3.3.3 bundle/ruby/2.3.0/gems/highline-1.7.8/examples/get_character.rb
windows-pr-1.2.5 vendor/bundle/ruby/2.2.0/gems/win32-api-1.6.0-universal-mingw32/vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/examples/get_character.rb
brakeman-3.3.2 bundle/ruby/2.3.0/gems/highline-1.7.8/examples/get_character.rb
win32-api-1.6.0-universal-mingw32 vendor/bundle/ruby/2.2.0/gems/highline-1.7.8/examples/get_character.rb
brakeman-3.3.1 bundle/ruby/2.3.0/gems/highline-1.7.8/examples/get_character.rb
brakeman-3.3.0 bundle/ruby/2.3.0/gems/highline-1.7.8/examples/get_character.rb
highline-1.7.8 examples/get_character.rb
highline-1.7.7 examples/get_character.rb
highline-1.7.6 examples/get_character.rb
highline-1.7.5 examples/get_character.rb
highline-1.7.3 examples/get_character.rb
solidus_backend-1.0.0.pre3 vendor/bundle/gems/highline-1.6.21/examples/get_character.rb
solidus_backend-1.0.0.pre2 vendor/bundle/gems/highline-1.6.21/examples/get_character.rb
scoot-0.0.4 .bundle/gems/ruby/2.2.0/gems/highline-1.7.2/examples/get_character.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/highline-1.6.21/examples/get_character.rb
highline-1.7.2 examples/get_character.rb
highline-1.7.1 examples/get_character.rb
asana2flowdock-1.0.0 vendor/bundle/ruby/1.9.1/gems/highline-1.6.21/examples/get_character.rb
clone-1.0.0.beta2 module/gems/highline-1.6.19/examples/get_character.rb