io-console 0.5.5 → 0.5.6

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: 1e486d10b5ba65f4c26eaaf789c1192ed009f2f9db325329d38b1feb465d0685
4
- data.tar.gz: 261978c79e35ea26175b6f327899e7347bdb0b7ea81ef67642454961a49dc313
3
+ metadata.gz: 823fa2d6014a030a75d08f381bfad31a713e5df4202b627312214b3f0c1d7885
4
+ data.tar.gz: 557347a5cbf21d2a5f8ca52c06c53d774f88905642b2dcd43b176809a1e16d06
5
5
  SHA512:
6
- metadata.gz: 97845b73825fb616407f6ed8a5258854a3cace592fb6c8404bef16810b52067baa3601b2570c6390ab80076ce64c586d2b8b7d998291ac515b5c1e25b7e2e193
7
- data.tar.gz: 6f3713c8608228c7c4fe0438c21e8cb67e4f3f0379805fb4daf6b846891f68c417c2446dff6dc1fee8a56d278005ddd5d630117dca2f78d523aad8ce43d58ffa
6
+ metadata.gz: cd2b8410bc0c0310e6961ff6883c794d672bf6ed1a2898e21ab44383ca863bc54a859931623a33548c120b7830d6309f5bc971f4d5e52777857958893687abcc
7
+ data.tar.gz: fb798eaa2a77a7efa26c433b7481a706f27b020259dc64caa01a87185d755a8078ac63a7987c6b37caf916836d1b8342f7e5bd520cdee5ae921b7e864c08cfed
@@ -111,6 +111,9 @@ rawmode_opt(int *argcp, VALUE *argv, int min_argc, int max_argc, rawmode_arg_t *
111
111
  int argc = *argcp;
112
112
  rawmode_arg_t *optp = NULL;
113
113
  VALUE vopts = Qnil;
114
+ #ifdef RB_SCAN_ARGS_PASS_CALLED_KEYWORDS
115
+ argc = rb_scan_args(argc, argv, "*:", NULL, &vopts);
116
+ #else
114
117
  if (argc > min_argc) {
115
118
  vopts = rb_check_hash_type(argv[argc-1]);
116
119
  if (!NIL_P(vopts)) {
@@ -120,6 +123,7 @@ rawmode_opt(int *argcp, VALUE *argv, int min_argc, int max_argc, rawmode_arg_t *
120
123
  if (!vopts) vopts = Qnil;
121
124
  }
122
125
  }
126
+ #endif
123
127
  rb_check_arity(argc, min_argc, max_argc);
124
128
  if (!NIL_P(vopts)) {
125
129
  VALUE vmin = rb_hash_aref(vopts, ID2SYM(id_min));
@@ -356,9 +360,9 @@ ttymode_with_io(VALUE io, VALUE (*func)(VALUE, VALUE), VALUE farg, void (*setter
356
360
 
357
361
  /*
358
362
  * call-seq:
359
- * io.raw(min: nil, time: nil) {|io| }
363
+ * io.raw(min: nil, time: nil, intr: nil) {|io| }
360
364
  *
361
- * Yields +self+ within raw mode.
365
+ * Yields +self+ within raw mode, and returns the result of the block.
362
366
  *
363
367
  * STDIN.raw(&:gets)
364
368
  *
@@ -370,6 +374,9 @@ ttymode_with_io(VALUE io, VALUE (*func)(VALUE, VALUE), VALUE farg, void (*setter
370
374
  * The parameter +time+ specifies the timeout in _seconds_ with a
371
375
  * precision of 1/10 of a second. (default: 0)
372
376
  *
377
+ * If the parameter +intr+ is +true+, enables break, interrupt, quit,
378
+ * and suspend special characters.
379
+ *
373
380
  * Refer to the manual page of termios for further details.
374
381
  *
375
382
  * You must require 'io/console' to use this method.
@@ -383,11 +390,11 @@ console_raw(int argc, VALUE *argv, VALUE io)
383
390
 
384
391
  /*
385
392
  * call-seq:
386
- * io.raw!(min: nil, time: nil)
393
+ * io.raw!(min: nil, time: nil, intr: nil) -> io
387
394
  *
388
- * Enables raw mode.
395
+ * Enables raw mode, and returns +io+.
389
396
  *
390
- * If the terminal mode needs to be back, use io.raw { ... }.
397
+ * If the terminal mode needs to be back, use <code>io.raw { ... }</code>.
391
398
  *
392
399
  * See IO#raw for details on the parameters.
393
400
  *
@@ -483,7 +490,7 @@ nogvl_getch(void *p)
483
490
 
484
491
  /*
485
492
  * call-seq:
486
- * io.getch(min: nil, time: nil) -> char
493
+ * io.getch(min: nil, time: nil, intr: nil) -> char
487
494
  *
488
495
  * Reads and returns a character in raw mode.
489
496
  *
@@ -1490,7 +1497,7 @@ console_dev(int argc, VALUE *argv, VALUE klass)
1490
1497
 
1491
1498
  /*
1492
1499
  * call-seq:
1493
- * io.getch(min: nil, time: nil) -> char
1500
+ * io.getch(min: nil, time: nil, intr: nil) -> char
1494
1501
  *
1495
1502
  * See IO#getch.
1496
1503
  */
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: false
2
2
  require 'mkmf'
3
3
 
4
- ok = true
4
+ ok = true if RUBY_ENGINE == "ruby"
5
5
  hdr = nil
6
6
  case
7
7
  when macro_defined?("_WIN32", "")
@@ -14,8 +14,9 @@ when have_header(hdr = "sgtty.h")
14
14
  %w"stty gtty".each {|f| have_func(f, hdr)}
15
15
  else
16
16
  ok = false
17
- end
18
- if ok
17
+ end if ok
18
+ case ok
19
+ when true
19
20
  have_header("sys/ioctl.h") if hdr
20
21
  # rb_check_hash_type: 1.9.3
21
22
  # rb_io_get_write_io: 1.9.1
@@ -27,4 +28,6 @@ if ok
27
28
  create_makefile("io/console") {|conf|
28
29
  conf << "\n""VK_HEADER = #{vk_header}\n"
29
30
  }
31
+ when nil
32
+ File.write("Makefile", dummy_makefile($srcdir).join(""))
30
33
  end
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.5
4
+ version: 0.5.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nobu Nakada
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-01-17 00:00:00.000000000 Z
11
+ date: 2020-02-17 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: add console capabilities to IO instances.
14
14
  email: nobu@ruby-lang.org
@@ -43,7 +43,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
43
43
  - !ruby/object:Gem::Version
44
44
  version: '0'
45
45
  requirements: []
46
- rubygems_version: 3.1.2
46
+ rubygems_version: 3.2.0.pre1
47
47
  signing_key:
48
48
  specification_version: 4
49
49
  summary: Console interface