Sha256: c767c9e86392a7c3d6e80611e124e93c97b62ecd1ece1381d43dc80f10698e39
Contents?: true
Size: 606 Bytes
Versions: 123
Compression:
Stored size: 606 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.chomp while !valid_answers.include?(input) puts 'Invalid input, please try again.' input = gets.downcase.chomp end input end
Version data entries
123 entries across 123 versions & 1 rubygems