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

Version Path
avo-1.25.2 bin/helpers.rb
avo-2.1.2.pre2 bin/helpers.rb
avo-2.1.2.pre1 bin/helpers.rb
avo-1.25.1 bin/helpers.rb
avo-2.1.1 bin/helpers.rb
avo-2.1.0 bin/helpers.rb
avo-2.0.0 bin/helpers.rb
avo-1.25.0 bin/helpers.rb
avo-1.24.2 bin/helpers.rb
avo-1.24.1 bin/helpers.rb
avo-1.24.0 bin/helpers.rb
avo-1.23.0 bin/helpers.rb
avo-1.22.4 bin/helpers.rb
avo-1.22.3 bin/helpers.rb
avo-1.22.2 bin/helpers.rb
avo-1.22.1 bin/helpers.rb
avo-1.22.1.pre.2 bin/helpers.rb
avo-1.22.1.pre.1 bin/helpers.rb
avo-1.22.0 bin/helpers.rb
avo-1.22.0.pre.1 bin/helpers.rb