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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: decdf097b0ff0dfc69754156a1cb766b68b45fc5007bb845b38e15c6b4190230
4
- data.tar.gz: f8c2f4ccc7aa3fcc4ad95467a752e313cb86e2473ff2356ccf01ee792d3e7315
3
+ metadata.gz: d4124dc490e2ac47dda9ad9283023351e95d781ac40af9a22f012a25c3b3eb15
4
+ data.tar.gz: 9ff304d0831ef2d5486f02c5da57fbe91ae960c4d3f1f28057e8e55a7fc7507a
5
5
  SHA512:
6
- metadata.gz: e1bd8dab05ec7e64ee220b39be6aa5429796f6c179b1ac6b300a91cce69469b8e3785d7bc03ab97eb2c22b88e21da1674891fd1574c0cc9affc69a2b084c0f33
7
- data.tar.gz: 9a8445e54933da15df523fb6dc71670b0ab6c9db4e2fcc2c39ae9df4b4be6887bf590410e722e96caa21858cac753e0b3d330645f7745392b2f91bfab8c7ad4d
6
+ metadata.gz: c8f277a43454e22b0c43beee7eba4069eac9db3b369a4ce0799259d482606a212fbb1d3deae07031703840add83fd5561dfe7170bc62f60675aabf695613e493
7
+ data.tar.gz: dfe52d8ca7becd7cf2aa8a27a56702380c1723bfd12393583cff7ad04c2996671b669476d8fd506c3e703d30b75c4084467ffcb8b0fcd7fe6e2be424f9d57c11
@@ -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
- #ifdef HAVE_RB_SCHEDULER_TIMEOUT
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 = rb_scheduler_timeout(&tv);
540
+ timeout = rb_fiber_scheduler_make_timeout(&tv);
538
541
  # endif
539
542
  }
540
543
  switch (optp->vmin) {
@@ -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 have_func("rb_scheduler_timeout")
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.8
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-02-11 00:00:00.000000000 Z
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