class Protobox::Util::Input

Public Class Methods

enter_or_abort() click to toggle source
# File lib/protobox/util.rb, line 63
def enter_or_abort
  puts
  puts "Press ENTER to continue or any other key to abort"
  c = get_char
  #p c
  abort unless c == "\r"
end
get_char() click to toggle source
# File lib/protobox/util.rb, line 53
def get_char
  begin
    system("stty raw -echo")
    str = STDIN.getc
  ensure
    system("stty -raw echo")
  end
  str.chr
end
get_input() click to toggle source
# File lib/protobox/util.rb, line 49
def get_input 
  STDIN.gets.chomp
end