module MotionVj::Helpers::Input

Public Class Methods

gets_until_not_blank(input_name = :input) click to toggle source
# File lib/motion_vj/helpers/input.rb, line 4
def self.gets_until_not_blank(input_name = :input)
  loop do
    value = $stdin.gets.to_s.strip
    if value.empty?
      print("Please provide a valid #{ input_name }: ")
    else
      return value  
    end
  end
end