Skip to content

Instantly share code, notes, and snippets.

@mixdev
Created May 6, 2017 15:35
Show Gist options
  • Save mixdev/d51a204a905c02ce648fd4a4d7c050d7 to your computer and use it in GitHub Desktop.
Save mixdev/d51a204a905c02ce648fd4a4d7c050d7 to your computer and use it in GitHub Desktop.
Signal.trap("SIGINT") do # SIGINT = control-C
exit
end
str =''
system("say 'Hi, whats your name?'")
sleep(0.5)
loop do
begin
system("stty raw -echo")
str << STDIN.getc
ensure
system("stty -raw echo")
end
break if str.length > 3
end
p str
sleep(0.5)
system("say 'hello #{str}, nice to meet you!'")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment