Support Ruby < 1.8.7

This commit is contained in:
Max Howell 2010-06-05 12:29:37 +01:00
parent 97b5808cac
commit 7a193f39b7

View File

@ -72,7 +72,11 @@ end
def getc # NOTE only tested on OS X
system "/bin/stty raw -echo"
STDIN.getbyte
if RUBY_VERSION >= '1.8.7'
STDIN.getbyte
else
STDIN.getc
end
ensure
system "/bin/stty -raw echo"
end