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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/console.c +17 -5
- data/extconf.rb +2 -0
- metadata +3 -3
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f8d3fd4be9c651e29db2894938f1b5f0ed2708b4
|
4
|
+
data.tar.gz: 1f72c3a0495569b56be0e7aefe1a0316fbd36e05
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b60d56f813d8e18fba029a14daa433077529c9fe9abf61993ab11919de7df35d2ef028ba22c7aca43cecece9f931e93983e5f4ab9d31d30ebb10bb4897a053e3
|
7
|
+
data.tar.gz: 7076dc9ecb5b769995807fc7a9e583432c76bd8690aabd4ee93691e4a0f1d9d02f6b288594e4fde59d9fc3c5611b3b6b0e77f87c9bf2accaabe5fb8796e7caa7
|
checksums.yaml.gz.sig
CHANGED
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
|
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
|
-
|
737
|
+
kn = StringValuePtr(k);
|
726
738
|
}
|
727
|
-
t = console_win32_vk(
|
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
|
859
|
+
return rb_funcallv(io, id_getc, argc, argv);
|
848
860
|
}
|
849
861
|
|
850
862
|
#if ENABLE_IO_GETPASS
|
data/extconf.rb
CHANGED
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.
|
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-
|
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.
|
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
|