io-console 0.5.0 → 0.5.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/ext/io/console/console.c +9 -5
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cfa5eeace30a7b2e59d986f4eaa5ed2bea9f5c2e04aa6b029d7ce59ef28e2c6f
4
- data.tar.gz: c719d7a8e91b4ae909602bacdab03267a341a11430068ba737cc43a79392c63f
3
+ metadata.gz: f87daa288fc605a3bf48b70558316f9427552fcf895e3a40363f71ba095d3e1b
4
+ data.tar.gz: bddde3f65430cad405fdd4ef576f9d18b85368001f5ea27dc16fb941e0065a04
5
5
  SHA512:
6
- metadata.gz: bd166f563c0c8cda6ee94eacd6292068e4d681539a6f3ce42872896031634ca944a3b538f6e36232b8227c6d8cf1b95d8a94637c06c83d83a801d0fc347a5a0a
7
- data.tar.gz: 84677613df9260493c5e9ed33e490cf520a21eb50daace16e42503cc7a70885674baa662c015c3f020ba1b076cccba01f75721539d9fec0439751613b8936a0f
6
+ metadata.gz: bd7bb0e4285b7a3de96006386f262cc74fde97fc34a157ad8b834661e52a1aefe210d683c8264e6a98cf8ce80610b7fa8917e79d2b80f87ea4ae052e60c98839
7
+ data.tar.gz: 23a0ac10ecd3f77ca899f5c00a9cc0689bc1c593540b116a6656eaef7d50aad887a3cfbcd66e6f954ebcac3e93f7f9eddbcda0f620d7804a196d541359e230bc
@@ -4,6 +4,7 @@
4
4
  */
5
5
  #include "ruby.h"
6
6
  #include "ruby/io.h"
7
+ #include "ruby/thread.h"
7
8
 
8
9
  #ifdef HAVE_UNISTD_H
9
10
  #include <unistd.h>
@@ -186,9 +187,10 @@ set_rawmode(conmode *t, void *arg)
186
187
  #ifdef ISIG
187
188
  if (r->intr) {
188
189
  t->c_iflag |= BRKINT|IXON;
189
- t->c_lflag |= ISIG|IEXTEN;
190
+ t->c_lflag |= ISIG;
190
191
  }
191
192
  #endif
193
+ (void)r;
192
194
  }
193
195
  }
194
196
 
@@ -454,7 +456,7 @@ getc_call(VALUE io)
454
456
  return rb_funcallv(io, id_getc, 0, 0);
455
457
  }
456
458
  #else
457
- static VALUE
459
+ static void *
458
460
  nogvl_getch(void *p)
459
461
  {
460
462
  int len = 0;
@@ -463,7 +465,6 @@ nogvl_getch(void *p)
463
465
  switch (c) {
464
466
  case WEOF:
465
467
  break;
466
- return (VALUE)0;
467
468
  case 0x00:
468
469
  case 0xe0:
469
470
  buf[len++] = c;
@@ -473,7 +474,7 @@ nogvl_getch(void *p)
473
474
  buf[len++] = c;
474
475
  break;
475
476
  }
476
- return (VALUE)len;
477
+ return (void *)(VALUE)len;
477
478
  }
478
479
  #endif
479
480
 
@@ -517,8 +518,11 @@ console_getch(int argc, VALUE *argv, VALUE io)
517
518
  if (w < 0) rb_eof_error();
518
519
  if (!(w & RB_WAITFD_IN)) return Qnil;
519
520
  }
521
+ else {
522
+ rb_warning("vtime option ignored if intr flag is unset");
523
+ }
520
524
  }
521
- len = (int)rb_thread_io_blocking_region(nogvl_getch, wbuf, fptr->fd);
525
+ len = (int)(VALUE)rb_thread_call_without_gvl(nogvl_getch, wbuf, RUBY_UBF_IO, 0);
522
526
  switch (len) {
523
527
  case 0:
524
528
  return Qnil;
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.0
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nobu Nakada
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-06-05 00:00:00.000000000 Z
11
+ date: 2019-12-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