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

Version Path
avo-1.2.6 bin/helpers.rb
avo-1.2.6.pre.1 bin/helpers.rb
avo-1.2.5 bin/helpers.rb
avo-1.2.4 bin/helpers.rb
avo-1.2.3 bin/helpers.rb
avo-1.3.0.pre.1 bin/helpers.rb
avo-1.2.2 bin/helpers.rb
avo-1.1.0 bin/helpers.rb
avo-1.1.0.pre.1 bin/helpers.rb
avo-1.0.5 bin/helpers.rb
avo-1.0.4 bin/helpers.rb
avo-1.0.2 bin/helpers.rb
avo-1.0.1 bin/helpers.rb
avo-1.0.0 bin/helpers.rb
avo-0.5.0.beta15 bin/helpers.rb
avo-0.5.0.beta14 bin/helpers.rb
avo-0.5.0.beta13 bin/helpers.rb
avo-0.5.0.beta12 bin/helpers.rb
avo-0.5.0.beta11 bin/helpers.rb
avo-0.5.0.beta10 bin/helpers.rb