Sha256: c6678559f658bad28d19def80d1f3ebf14b7dff4223fa8edd4718516381a4a74

Contents?: true

Size: 249 Bytes

Versions: 6

Compression:

Stored size: 249 Bytes

Contents

# encoding: utf-8

require 'tty-prompt'
require 'pastel'

prompt = TTY::Prompt.new
heart = prompt.decorate('❤ ', :magenta)

res = prompt.mask('What is your secret?', mask: heart) do |q|
  q.validate(/[a-z\ ]{5,15}/)
end

puts "Secret: \"#{res}\""

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
tty-prompt-0.13.2 examples/mask.rb
tty-prompt-0.13.1 examples/mask.rb
tty-prompt-0.13.0 examples/mask.rb
austb-tty-prompt-0.13.0 examples/mask.rb
tty-prompt-0.12.0 examples/mask.rb
tty-prompt-0.11.0 examples/mask.rb