io-console 0.5.8 → 0.5.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/ext/io/console/console.c +5 -2
- data/ext/io/console/extconf.rb +4 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d4124dc490e2ac47dda9ad9283023351e95d781ac40af9a22f012a25c3b3eb15
|
4
|
+
data.tar.gz: 9ff304d0831ef2d5486f02c5da57fbe91ae960c4d3f1f28057e8e55a7fc7507a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c8f277a43454e22b0c43beee7eba4069eac9db3b369a4ce0799259d482606a212fbb1d3deae07031703840add83fd5561dfe7170bc62f60675aabf695613e493
|
7
|
+
data.tar.gz: dfe52d8ca7becd7cf2aa8a27a56702380c1723bfd12393583cff7ad04c2996671b669476d8fd506c3e703d30b75c4084467ffcb8b0fcd7fe6e2be424f9d57c11
|
data/ext/io/console/console.c
CHANGED
@@ -80,8 +80,11 @@ static ID id_getc, id_console, id_close, id_min, id_time, id_intr;
|
|
80
80
|
static ID id_gets, id_chomp_bang;
|
81
81
|
#endif
|
82
82
|
|
83
|
-
#
|
83
|
+
#if defined HAVE_RUBY_FIBER_SCHEDULER_H
|
84
|
+
# include "ruby/fiber/scheduler.h"
|
85
|
+
#elif defined HAVE_RB_SCHEDULER_TIMEOUT
|
84
86
|
extern VALUE rb_scheduler_timeout(struct timeval *timeout);
|
87
|
+
# define rb_fiber_scheduler_make_timeout rb_scheduler_timeout
|
85
88
|
#endif
|
86
89
|
|
87
90
|
#define sys_fail_fptr(fptr) rb_sys_fail_str((fptr)->pathv)
|
@@ -534,7 +537,7 @@ console_getch(int argc, VALUE *argv, VALUE io)
|
|
534
537
|
tv.tv_sec = optp->vtime / 10;
|
535
538
|
tv.tv_usec = (optp->vtime % 10) * 100000;
|
536
539
|
# ifdef HAVE_RB_IO_WAIT
|
537
|
-
timeout =
|
540
|
+
timeout = rb_fiber_scheduler_make_timeout(&tv);
|
538
541
|
# endif
|
539
542
|
}
|
540
543
|
switch (optp->vmin) {
|
data/ext/io/console/extconf.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: false
|
2
2
|
require 'mkmf'
|
3
3
|
|
4
|
-
ok = true if RUBY_ENGINE == "ruby"
|
4
|
+
ok = true if RUBY_ENGINE == "ruby" || RUBY_ENGINE == "truffleruby"
|
5
5
|
hdr = nil
|
6
6
|
case
|
7
7
|
when macro_defined?("_WIN32", "")
|
@@ -24,7 +24,9 @@ when true
|
|
24
24
|
# rb_funcallv: 2.1.0
|
25
25
|
# RARRAY_CONST_PTR: 2.1.0
|
26
26
|
# rb_sym2str: 2.2.0
|
27
|
-
if
|
27
|
+
if have_macro("HAVE_RUBY_FIBER_SCHEDULER_H")
|
28
|
+
$defs << "-D""HAVE_RB_IO_WAIT=1"
|
29
|
+
elsif have_func("rb_scheduler_timeout") # 3.0
|
28
30
|
have_func("rb_io_wait")
|
29
31
|
end
|
30
32
|
$defs << "-D""ENABLE_IO_GETPASS=1"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: io-console
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nobu Nakada
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-03-10 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: add console capabilities to IO instances.
|
14
14
|
email: nobu@ruby-lang.org
|