Sha256: 867f4952db08653271daeb71055660ac7df49a09bf9c6d30d82644108ffb2d7e
Contents?: true
Size: 615 Bytes
Versions: 29
Compression:
Stored size: 615 Bytes
Contents
require 'fileutils' def app_root root = File.expand_path('..', __dir__) FileUtils.chdir(root) do yield end end def run!(*args) system(*args) || abort("\nCommand `#{args}` failed") end def header(msg) divider = '=' * msg.length puts "\n\e\u001b[1m#{divider}\e[0m" puts "\u001b[1m#{msg}\e[0m" puts "\e\u001b[1m#{divider}\e[0m\n\n" end def ask(question:, valid_answers: []) puts "\n#{question} (#{valid_answers.join('/')})" input = gets.downcase.chomp while !valid_answers.include?(input) puts 'Invalid input, please try again.' input = gets.downcase.chomp end input end
Version data entries
29 entries across 29 versions & 1 rubygems