add crystal prompt timeout

This commit is contained in:
Alexander Popov 2022-07-31 03:04:43 +03:00
parent b9e158a9eb
commit f3a447854f
Signed by: iiiypuk
GPG Key ID: D8C9B59A9F04A70C
2 changed files with 3 additions and 0 deletions

View File

@ -2,3 +2,4 @@
## std
- [Значение из Regex::MatchData](value_from_match.cr) - Получить значение из `Regex::MatchData("Happy")`
- [IO::TimeoutError](prompt_timeout.cr) - Установка тайм-аута на пользовательский ввод

View File

@ -0,0 +1,2 @@
STDIN.read_timeout = 1
STDIN.gets # raises IO::TimeoutError (after 1 second)