io-console 0.4.5 → 0.4.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b8b1a359f6f19ba1ff5ba0afb46398547b33b600
4
- data.tar.gz: 7ab4864fa4909efabba6c472b6a04612316be845
3
+ metadata.gz: f8d3fd4be9c651e29db2894938f1b5f0ed2708b4
4
+ data.tar.gz: 1f72c3a0495569b56be0e7aefe1a0316fbd36e05
5
5
  SHA512:
6
- metadata.gz: dcfe215f5ad7a1f0cbc2e9440ab5bae8f481b6eaa9f0658eff2b0d95fb0402d2619ce311b5978060a5f7f14e3252728b9b1170e2fd5f864c816e6f546d4fa372
7
- data.tar.gz: e02e7f3e0f4db8e931a558e0e8cf46eb400886af7a96921448c321b3d49e94d1b629a78e7234cbc5e0bb7027985b5cd0a3989b1e9a4f0e112e238841aae8fe1b
6
+ metadata.gz: b60d56f813d8e18fba029a14daa433077529c9fe9abf61993ab11919de7df35d2ef028ba22c7aca43cecece9f931e93983e5f4ab9d31d30ebb10bb4897a053e3
7
+ data.tar.gz: 7076dc9ecb5b769995807fc7a9e583432c76bd8690aabd4ee93691e4a0f1d9d02f6b288594e4fde59d9fc3c5611b3b6b0e77f87c9bf2accaabe5fb8796e7caa7
Binary file
data.tar.gz.sig CHANGED
Binary file
data/console.c CHANGED
@@ -14,6 +14,12 @@
14
14
  #ifdef HAVE_SYS_IOCTL_H
15
15
  #include <sys/ioctl.h>
16
16
  #endif
17
+ #ifndef RARRAY_CONST_PTR
18
+ # define RARRAY_CONST_PTR(ary) RARRAY_PTR(ary)
19
+ #endif
20
+ #ifndef HAVE_RB_FUNCALLV
21
+ # define rb_funcallv rb_funcall2
22
+ #endif
17
23
 
18
24
  #if defined HAVE_TERMIOS_H
19
25
  # include <termios.h>
@@ -97,6 +103,10 @@ rb_f_send(int argc, VALUE *argv, VALUE recv)
97
103
  }
98
104
  #endif
99
105
 
106
+ #ifndef HAVE_RB_SYM2STR
107
+ # define rb_sym2str(sym) rb_id2str(SYM2ID(sym))
108
+ #endif
109
+
100
110
  typedef struct {
101
111
  int vmin;
102
112
  int vtime;
@@ -378,7 +388,7 @@ console_set_cooked(VALUE io)
378
388
  static VALUE
379
389
  getc_call(VALUE io)
380
390
  {
381
- return rb_funcall2(io, id_getc, 0, 0);
391
+ return rb_funcallv(io, id_getc, 0, 0);
382
392
  }
383
393
 
384
394
  /*
@@ -718,15 +728,17 @@ console_key_pressed_p(VALUE io, VALUE k)
718
728
  }
719
729
  else {
720
730
  const struct vktable *t;
731
+ const char *kn;
721
732
  if (SYMBOL_P(k)) {
722
733
  k = rb_sym2str(k);
734
+ kn = RSTRING_PTR(k);
723
735
  }
724
736
  else {
725
- StringValueCStr(k);
737
+ kn = StringValuePtr(k);
726
738
  }
727
- t = console_win32_vk(RSTRING_PTR(k), RSTRING_LEN(k));
739
+ t = console_win32_vk(kn, RSTRING_LEN(k));
728
740
  if (!t || (vk = (short)t->vk) == -1) {
729
- rb_raise(rb_eArgError, "unknown virtual key code: %"PRIsVALUE, k);
741
+ rb_raise(rb_eArgError, "unknown virtual key code: % "PRIsVALUE, k);
730
742
  }
731
743
  }
732
744
  return GetKeyState(vk) & 0x80 ? Qtrue : Qfalse;
@@ -844,7 +856,7 @@ console_dev(int argc, VALUE *argv, VALUE klass)
844
856
  static VALUE
845
857
  io_getch(int argc, VALUE *argv, VALUE io)
846
858
  {
847
- return rb_funcall2(io, id_getc, argc, argv);
859
+ return rb_funcallv(io, id_getc, argc, argv);
848
860
  }
849
861
 
850
862
  #if ENABLE_IO_GETPASS
data/extconf.rb CHANGED
@@ -17,6 +17,8 @@ else
17
17
  end
18
18
  if ok
19
19
  have_header("sys/ioctl.h") if hdr
20
+ have_func("rb_funcallv")
21
+ have_func("rb_sym2str")
20
22
  # rb_check_hash_type: 1.9.3
21
23
  # rb_io_get_write_io: 1.9.1
22
24
  # rb_cloexec_open: 2.0.0
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: io-console
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.5
4
+ version: 0.4.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nobu Nakada
@@ -30,7 +30,7 @@ cert_chain:
30
30
  ZgehHiYUmHxhsoXmVbst3GP52kHNAhVA7+pMpYuYT7glqpuM0sPxtXCucBCBc8Fw
31
31
  dUVKuhl19UL3hBtgLSctsrsoXuo=
32
32
  -----END CERTIFICATE-----
33
- date: 2015-12-24 00:00:00.000000000 Z
33
+ date: 2015-12-23 00:00:00.000000000 Z
34
34
  dependencies: []
35
35
  description: add console capabilities to IO instances.
36
36
  email: nobu@ruby-lang.org
@@ -64,7 +64,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
64
64
  version: '0'
65
65
  requirements: []
66
66
  rubyforge_project:
67
- rubygems_version: 2.5.1
67
+ rubygems_version: 2.6.3
68
68
  signing_key:
69
69
  specification_version: 4
70
70
  summary: Console interface
metadata.gz.sig CHANGED
Binary file