supplement 2.31.1 → 2.32
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 +4 -4
- data/README.md +1 -1
- data/lib/mkrf_conf +2 -2
- data/lib/supplement/locked.c +0 -19
- data/lib/supplement/terminal.c +6 -30
- data/lib/supplement.c +0 -24
- data/lib/supplement.h +0 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9a7108dafb3707ef51a08d12ac718a6c00358bae7b3f98e32448886f8d9dd29b
|
|
4
|
+
data.tar.gz: d389cf607de0a21d6b4cd3a02550a25200f68205cbaad22ed442025123420bed
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e4006b5753eff8a4cce364b2e26a0717493948177e2476818113b7a62070fdf69ff71bc72105a14cf7d02a639471a282e99181e7f702f618678db63483dc7e1e
|
|
7
|
+
data.tar.gz: ae9e62b121909a5cdfb63abea92a3abd2ca71bf887a6364806dd2af55c7e44796bfcaa09cafb326f14f27ffa84332817630c8fb4aced20995220d4b43af0f5b5
|
data/README.md
CHANGED
data/lib/mkrf_conf
CHANGED
data/lib/supplement/locked.c
CHANGED
|
@@ -28,29 +28,14 @@
|
|
|
28
28
|
VALUE
|
|
29
29
|
rb_locked_init( int argc, VALUE *argv, VALUE self)
|
|
30
30
|
{
|
|
31
|
-
#ifdef FEATURE_OLD_IO_FUNCTIONS
|
|
32
|
-
rb_io_t *fptr;
|
|
33
|
-
#endif
|
|
34
31
|
struct timeval time;
|
|
35
32
|
int op;
|
|
36
33
|
|
|
37
|
-
#ifdef FEATURE_OLD_IO_FUNCTIONS
|
|
38
|
-
GetOpenFile( self, fptr);
|
|
39
|
-
#endif
|
|
40
|
-
|
|
41
34
|
rb_call_super_kw(argc, argv, RB_PASS_CALLED_KEYWORDS);
|
|
42
35
|
|
|
43
|
-
#ifdef FEATURE_OLD_IO_FUNCTIONS
|
|
44
|
-
op = fptr->mode & FMODE_WRITABLE ? LOCK_EX : LOCK_SH;
|
|
45
|
-
#else
|
|
46
36
|
op = rb_io_mode( self) & FMODE_WRITABLE ? LOCK_EX : LOCK_SH;
|
|
47
|
-
#endif
|
|
48
37
|
op |= LOCK_NB;
|
|
49
|
-
#ifdef FEATURE_OLD_IO_FUNCTIONS
|
|
50
|
-
while (flock( fptr->fd, op) < 0) {
|
|
51
|
-
#else
|
|
52
38
|
while (flock( rb_io_descriptor( self), op) < 0) {
|
|
53
|
-
#endif
|
|
54
39
|
static ID id_lock_failed = 0;
|
|
55
40
|
|
|
56
41
|
switch (errno) {
|
|
@@ -72,11 +57,7 @@ rb_locked_init( int argc, VALUE *argv, VALUE self)
|
|
|
72
57
|
}
|
|
73
58
|
break;
|
|
74
59
|
default:
|
|
75
|
-
#ifdef FEATURE_OLD_IO_FUNCTIONS
|
|
76
|
-
rb_sys_fail_str( fptr->pathv);
|
|
77
|
-
#else
|
|
78
60
|
rb_sys_fail_str( rb_io_path( self));
|
|
79
|
-
#endif
|
|
80
61
|
break;
|
|
81
62
|
}
|
|
82
63
|
}
|
data/lib/supplement/terminal.c
CHANGED
|
@@ -13,14 +13,6 @@ static VALUE io_unget( VALUE);
|
|
|
13
13
|
static VALUE io_reset( VALUE);
|
|
14
14
|
|
|
15
15
|
|
|
16
|
-
#ifdef FEATURE_OLD_IO_FUNCTIONS
|
|
17
|
-
#define RB_FAIL_PATH( io, fptr) ((fptr)->pathv)
|
|
18
|
-
#define RB_IO_VAR( io, fptr) fptr
|
|
19
|
-
#else
|
|
20
|
-
#define RB_FAIL_PATH( io, fptr) rb_io_path( io)
|
|
21
|
-
#define RB_IO_VAR( io, fptr) io
|
|
22
|
-
#endif
|
|
23
|
-
|
|
24
16
|
/*
|
|
25
17
|
* call-seq:
|
|
26
18
|
* io.unget(str, ...) -> nil
|
|
@@ -33,28 +25,20 @@ static VALUE io_reset( VALUE);
|
|
|
33
25
|
VALUE
|
|
34
26
|
rb_io_unget( int argc, VALUE *argv, VALUE io)
|
|
35
27
|
{
|
|
36
|
-
#ifdef FEATURE_OLD_IO_FUNCTIONS
|
|
37
|
-
rb_io_t *fptr;
|
|
38
|
-
#endif
|
|
39
28
|
int fd;
|
|
40
29
|
struct termios oldtio, newtio;
|
|
41
30
|
void *v[5];
|
|
42
31
|
|
|
43
|
-
#ifdef FEATURE_OLD_IO_FUNCTIONS
|
|
44
|
-
GetOpenFile( io, fptr);
|
|
45
|
-
fd = fptr->fd;
|
|
46
|
-
#else
|
|
47
32
|
fd = rb_io_descriptor( io);
|
|
48
|
-
#endif
|
|
49
33
|
|
|
50
34
|
if (tcgetattr( fd, &oldtio) < 0)
|
|
51
|
-
rb_sys_fail_str(
|
|
35
|
+
rb_sys_fail_str( rb_io_path( io));
|
|
52
36
|
newtio = oldtio;
|
|
53
37
|
newtio.c_iflag &= ~ICRNL;
|
|
54
38
|
if (tcsetattr( fd, TCSANOW, &newtio) < 0)
|
|
55
|
-
rb_sys_fail_str(
|
|
39
|
+
rb_sys_fail_str( rb_io_path( io));
|
|
56
40
|
|
|
57
|
-
v[0] = &fd, v[1] = (void *)
|
|
41
|
+
v[0] = &fd, v[1] = (void *) io, v[2] = &oldtio,
|
|
58
42
|
v[3] = &argc, v[4] = (void *) argv;
|
|
59
43
|
return rb_ensure( io_unget, (VALUE) v, io_reset, (VALUE) v);
|
|
60
44
|
}
|
|
@@ -76,7 +60,7 @@ io_unget( VALUE v)
|
|
|
76
60
|
p = RSTRING_PTR(str);
|
|
77
61
|
for (i = RSTRING_LEN(str); i; --i, ++p)
|
|
78
62
|
if (ioctl( *(int *) vp[0], TIOCSTI, p) < 0)
|
|
79
|
-
rb_sys_fail_str(
|
|
63
|
+
rb_sys_fail_str( rb_io_path( (VALUE) vp[1]));
|
|
80
64
|
}
|
|
81
65
|
return Qnil;
|
|
82
66
|
}
|
|
@@ -87,7 +71,7 @@ io_reset( VALUE v)
|
|
|
87
71
|
void **vp = (void **) v;
|
|
88
72
|
|
|
89
73
|
if (tcsetattr( *(int *) vp[0], TCSANOW, (struct termios *) vp[2]) < 0)
|
|
90
|
-
rb_sys_fail_str(
|
|
74
|
+
rb_sys_fail_str( rb_io_path( (VALUE) vp[1]));
|
|
91
75
|
|
|
92
76
|
return Qnil;
|
|
93
77
|
}
|
|
@@ -105,22 +89,14 @@ io_reset( VALUE v)
|
|
|
105
89
|
VALUE
|
|
106
90
|
rb_io_wingeom( VALUE self)
|
|
107
91
|
{
|
|
108
|
-
#ifdef FEATURE_OLD_IO_FUNCTIONS
|
|
109
|
-
rb_io_t *fptr;
|
|
110
|
-
#endif
|
|
111
92
|
int fd;
|
|
112
93
|
struct winsize w;
|
|
113
94
|
VALUE r;
|
|
114
95
|
|
|
115
|
-
#ifdef FEATURE_OLD_IO_FUNCTIONS
|
|
116
|
-
GetOpenFile( self, fptr);
|
|
117
|
-
fd = fptr->fd;
|
|
118
|
-
#else
|
|
119
96
|
fd = rb_io_descriptor( self);
|
|
120
|
-
#endif
|
|
121
97
|
|
|
122
98
|
if (ioctl( fd, TIOCGWINSZ, &w) < 0)
|
|
123
|
-
rb_sys_fail_str(
|
|
99
|
+
rb_sys_fail_str( rb_io_path( self));
|
|
124
100
|
r = rb_ary_new2( 4);
|
|
125
101
|
rb_ary_store( r, 0, INT2NUM( w.ws_col));
|
|
126
102
|
rb_ary_store( r, 1, INT2NUM( w.ws_row));
|
data/lib/supplement.c
CHANGED
|
@@ -110,28 +110,6 @@ rb_krn_tap_bang( VALUE obj)
|
|
|
110
110
|
}
|
|
111
111
|
|
|
112
112
|
|
|
113
|
-
/*
|
|
114
|
-
* call-seq:
|
|
115
|
-
* with { |x| ... } -> obj
|
|
116
|
-
*
|
|
117
|
-
* Warning. This method will be removed. Use +Kernel#then+ instead.
|
|
118
|
-
*
|
|
119
|
-
* Yields +x+ to the block.
|
|
120
|
-
* The difference to +tap+ is that the block's result will be returned.
|
|
121
|
-
*
|
|
122
|
-
* Use this to narrow your namespace.
|
|
123
|
-
*
|
|
124
|
-
*/
|
|
125
|
-
|
|
126
|
-
VALUE
|
|
127
|
-
rb_krn_with( VALUE obj)
|
|
128
|
-
{
|
|
129
|
-
rb_category_warning(RB_WARN_CATEGORY_DEPRECATED,
|
|
130
|
-
"Kernel#with will be removed from the supplement gem. Use Kernel#then instead.");
|
|
131
|
-
return rb_yield( obj);
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
|
|
135
113
|
/*
|
|
136
114
|
* Document-class: Module
|
|
137
115
|
*/
|
|
@@ -432,7 +410,6 @@ rb_str_axe( int argc, VALUE *argv, VALUE str)
|
|
|
432
410
|
if (newlen < 0)
|
|
433
411
|
return Qnil;
|
|
434
412
|
|
|
435
|
-
|
|
436
413
|
oldlen = rb_str_strlen( str);
|
|
437
414
|
if (newlen < oldlen) {
|
|
438
415
|
VALUE ell;
|
|
@@ -1224,7 +1201,6 @@ void Init_supplement( void)
|
|
|
1224
1201
|
rb_define_method( rb_cObject, "new_string", rb_obj_new_string, 0);
|
|
1225
1202
|
rb_define_method( rb_cObject, "nil_if", rb_obj_nil_if, 1);
|
|
1226
1203
|
rb_define_method( rb_mKernel, "tap!", rb_krn_tap_bang, 0);
|
|
1227
|
-
rb_define_method( rb_mKernel, "with", rb_krn_with, 0);
|
|
1228
1204
|
|
|
1229
1205
|
rb_define_method( rb_cModule, "plain_name", rb_module_plain_name, 0);
|
|
1230
1206
|
|
data/lib/supplement.h
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: supplement
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.
|
|
4
|
+
version: '2.32'
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Bertram Scharpf
|
|
@@ -81,7 +81,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
81
81
|
requirements:
|
|
82
82
|
- - ">="
|
|
83
83
|
- !ruby/object:Gem::Version
|
|
84
|
-
version: 3.
|
|
84
|
+
version: 3.3.0
|
|
85
85
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
86
86
|
requirements:
|
|
87
87
|
- - ">="
|