Skip to content

Instantly share code, notes, and snippets.

@syrm

syrm/test.cr Secret

Created July 31, 2018 15:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save syrm/552543587862782f1a2daf5b7dd6d715 to your computer and use it in GitHub Desktop.
Save syrm/552543587862782f1a2daf5b7dd6d715 to your computer and use it in GitHub Desktop.
puts "Started"
spawn do
puts "Loop start"
STDIN.raw &.each_char do |char|
puts "Pressed: #{char}\r"
break if char == 'q' || char == '\u{3}' # Ctrl-C
end
puts "Loop end"
end
spawn do
puts "Send value"
STDIN.puts "a"
end
sleep 2.seconds
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment