Sha256: 20d2cfc80b0b3c3247b496e82e7bc4cc5b55bb14d0154c95e5720227b2874f61
Contents?: true
Size: 334 Bytes
Versions: 10
Compression:
Stored size: 334 Bytes
Contents
# encoding: utf-8 require 'tty-prompt' prompt = TTY::Prompt.new prompt.ask('What is your name?', default: ENV['USER']) prompt.ask('Folder name?') do |q| q.required(true) q.validate ->(v) { return !Dir.exist?(v) } q.messages[:valid?] = 'Folder already exists?' q.messages[:required?] = 'Folder name must not be empty' end
Version data entries
10 entries across 10 versions & 2 rubygems