Top Level Namespace

Defined Under Namespace

Classes: LibrarianChefDSLParser, RightScaleMetadata

Instance Method Summary collapse

Instance Method Details

#yesnoObject



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/yesno.rb', line 1

def yesno
  begin
    system("stty raw -echo")
    str = STDIN.getc
  ensure
    system("stty -raw echo")
  end
  if str.downcase == "y"
    return true
  elsif str.downcase == "n"
    return false
  else
    raise "Invalid response. Please enter y/n."
  end
end