kgio 2.9.2 → 2.9.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.document +0 -1
- data/.gitignore +1 -1
- data/{.wrongdoc.yml → .olddoc.yml} +5 -1
- data/GIT-VERSION-GEN +1 -1
- data/GNUmakefile +0 -5
- data/HACKING +2 -2
- data/ISSUES +10 -8
- data/LICENSE +3 -6
- data/README +3 -6
- data/TODO +2 -1
- data/archive/.gitignore +3 -0
- data/archive/slrnpull.conf +4 -0
- data/ext/kgio/connect.c +1 -4
- data/ext/kgio/kgio.h +3 -1
- data/ext/kgio/poll.c +1 -1
- data/ext/kgio/tryopen.c +1 -0
- data/ext/kgio/write.c +1 -1
- data/ext/kgio/writev.c +37 -23
- data/kgio.gemspec +7 -11
- data/pkg.mk +23 -48
- data/test/lib_read_write.rb +2 -1
- metadata +50 -30
- data/Rakefile +0 -32
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: b0740f772bbf0d1b65ee40ad553e466f396c1adc
|
4
|
+
data.tar.gz: 6e7de48ded07946409a01acd5d377127e61630cb
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 4cd8f71b71d6c85f934b4a2310834cc341c138bb11da67ef3fb2d17d123fa8d8c5e17f9fdd67ec3398491648a4c3d6ab1872b4195f4c4d6a36019a620afdbe16
|
7
|
+
data.tar.gz: 18055348aa99100d39c5277a86e2b572b62ea87b153c6fad4065d3c31fdb0720319094c5aa1ff539ec43beb47f1bc94be7fc293f4f7bf7f710861a10b2a5d581
|
data/.document
CHANGED
data/.gitignore
CHANGED
@@ -1,6 +1,10 @@
|
|
1
1
|
---
|
2
2
|
cgit_url: http://bogomips.org/kgio.git
|
3
3
|
git_url: git://bogomips.org/kgio.git
|
4
|
+
ml_url: http://bogomips.org/kgio-public/
|
4
5
|
rdoc_url: http://bogomips.org/kgio/
|
5
|
-
public_email: kgio@
|
6
|
+
public_email: kgio-public@bogomips.org
|
6
7
|
private_email: kgio@bogomips.org
|
8
|
+
noindex:
|
9
|
+
- LATEST
|
10
|
+
- TODO
|
data/GIT-VERSION-GEN
CHANGED
data/GNUmakefile
CHANGED
data/HACKING
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
=== Documentation
|
4
4
|
|
5
|
-
We use the latest version of {
|
5
|
+
We use the latest version of {olddoc}[http://80x24.org/olddoc/] as
|
6
6
|
much as possible.
|
7
7
|
|
8
8
|
Please wrap documentation at 72 characters-per-line or less (long URLs
|
@@ -29,7 +29,7 @@ characters wide) and NOT the indentation style of Matz Ruby.
|
|
29
29
|
|
30
30
|
Contributions are welcome in the form of patches, pull requests, code
|
31
31
|
review, testing, documentation, user support or any other feedback. The
|
32
|
-
{kgio mailing list}[mailto:kgio@
|
32
|
+
{kgio mailing list}[mailto:kgio-public@bogomips.org] is the
|
33
33
|
central coordination point for all user and developer feedback and bug
|
34
34
|
reports.
|
35
35
|
|
data/ISSUES
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
= Issues
|
2
2
|
|
3
|
-
The kgio {mailing list}[mailto:kgio@
|
3
|
+
The kgio {mailing list}[mailto:kgio-public@bogomips.org] is the best
|
4
4
|
place to report bugs, submit patches and/or obtain support after you
|
5
|
-
have searched the mailing list archives
|
6
|
-
{documentation}[http://bogomips.org/kgio].
|
5
|
+
have searched the mailing list archives at http://bogomips.org/kgio-public/
|
6
|
+
and {documentation}[http://bogomips.org/kgio].
|
7
7
|
|
8
8
|
* Do not {top post}[http://catb.org/jargon/html/T/top-post.html] in replies
|
9
9
|
* Quote only the relevant portions of the message you're replying to
|
@@ -24,11 +24,13 @@ guidelines for patch submission.
|
|
24
24
|
|
25
25
|
== Mailing List Info
|
26
26
|
|
27
|
-
* subscribe:
|
28
|
-
* post: mailto:kgio@
|
27
|
+
* subscribe: mailto:kgio-public+subscribe@bogomips.org
|
28
|
+
* post: mailto:kgio-public@bogomips.org
|
29
29
|
* private: mailto:kgio@bogomips.org
|
30
30
|
|
31
|
-
== Mailing List Archives
|
31
|
+
== Mailing List Archives
|
32
32
|
|
33
|
-
* http://bogomips.org/kgio/
|
34
|
-
*
|
33
|
+
* http://bogomips.org/kgio-public/
|
34
|
+
* git://bogomips.org/kgio-public/
|
35
|
+
(see http://ssoma.public-inbox.org/ for layout)
|
36
|
+
* NNTP coming soon
|
data/LICENSE
CHANGED
@@ -3,10 +3,8 @@ revision control for names and email addresses of all of them.
|
|
3
3
|
|
4
4
|
You can redistribute it and/or modify it under the terms of the GNU
|
5
5
|
Lesser General Public License (LGPL) as published by the Free Software
|
6
|
-
Foundation, version {2.1}[
|
7
|
-
|
8
|
-
The kgio project leader (Eric Wong) reserves the right to
|
9
|
-
relicense kgio under future versions of the LGPL.
|
6
|
+
Foundation, version {2.1}[https://www.gnu.org/licenses/lgpl-2.1.txt] or
|
7
|
+
(at your option) any later version.
|
10
8
|
|
11
9
|
kgio is distributed in the hope that it will be useful, but WITHOUT
|
12
10
|
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
@@ -14,5 +12,4 @@ FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
|
|
14
12
|
License for more details.
|
15
13
|
|
16
14
|
You should have received a copy of the GNU Lesser General Public License
|
17
|
-
along with kgio; if not,
|
18
|
-
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
|
15
|
+
along with kgio; if not, see: https://www.gnu.org/licenses/lgpl-2.1.txt
|
data/README
CHANGED
@@ -10,7 +10,7 @@ applications (that run on Unix-like platforms).
|
|
10
10
|
* Can avoid expensive exceptions on common EAGAIN/EINPROGRESS errors,
|
11
11
|
returning :wait_readable or :wait_writable instead.
|
12
12
|
These exceptions got more expensive to hit under Ruby 1.9.2
|
13
|
-
(but
|
13
|
+
(but were fixed in Ruby 1.9.3 and later to 1.9.1 performance levels)
|
14
14
|
|
15
15
|
* Returns the unwritten portion of the string on partial writes,
|
16
16
|
making it ideal for buffering unwritten data.
|
@@ -32,10 +32,7 @@ applications (that run on Unix-like platforms).
|
|
32
32
|
|
33
33
|
The library consists of a C extension so you'll need a Unix-like system
|
34
34
|
with a C compiler and Ruby development libraries/headers.
|
35
|
-
|
36
|
-
http://rubyforge.org/frs/?group_id=8977
|
37
|
-
|
38
|
-
You may also install it via RubyGems.org:
|
35
|
+
You may install it via RubyGems.org:
|
39
36
|
|
40
37
|
gem install kgio
|
41
38
|
|
@@ -58,7 +55,7 @@ from git.
|
|
58
55
|
|
59
56
|
All feedback (bug reports, user/development dicussion, patches, pull
|
60
57
|
requests) go to the mailing list/newsgroup. See the ISSUES document for
|
61
|
-
information on the {kgio mailing list}[mailto:kgio@
|
58
|
+
information on the {kgio mailing list}[mailto:kgio-public@bogomips.org]
|
62
59
|
|
63
60
|
For the latest on kgio releases, you may check our NEWS page (and
|
64
61
|
subscribe to our Atom feed).
|
data/TODO
CHANGED
@@ -1 +1,2 @@
|
|
1
|
-
*
|
1
|
+
* remove old autopush interface (for kgio 3.x)
|
2
|
+
* obsolete kgio by improving *_nonblock methods in Ruby itself
|
data/archive/.gitignore
ADDED
data/ext/kgio/connect.c
CHANGED
@@ -146,9 +146,6 @@ static const struct sockaddr *sockaddr_from(socklen_t *addrlen, VALUE addr)
|
|
146
146
|
}
|
147
147
|
|
148
148
|
#if defined(MSG_FASTOPEN) && defined(KGIO_WITHOUT_GVL)
|
149
|
-
#ifndef HAVE_RB_STR_SUBSEQ
|
150
|
-
#define rb_str_subseq rb_str_substr
|
151
|
-
#endif
|
152
149
|
struct tfo_args {
|
153
150
|
int fd;
|
154
151
|
const void *buf;
|
@@ -200,7 +197,7 @@ static VALUE fastopen(VALUE sock, VALUE buf, VALUE addr)
|
|
200
197
|
if ((size_t)w == a.buflen)
|
201
198
|
return Qnil;
|
202
199
|
|
203
|
-
return
|
200
|
+
return MY_STR_SUBSEQ(str, w, a.buflen - w);
|
204
201
|
}
|
205
202
|
#endif /* MSG_FASTOPEN */
|
206
203
|
|
data/ext/kgio/kgio.h
CHANGED
@@ -99,7 +99,9 @@ static inline void kgio_autopush_write(VALUE io) { kgio_autopush_send(io); }
|
|
99
99
|
|
100
100
|
/* prefer rb_str_subseq because we don't use negative offsets */
|
101
101
|
#ifndef HAVE_RB_STR_SUBSEQ
|
102
|
-
#define
|
102
|
+
#define MY_STR_SUBSEQ(str,beg,len) rb_str_substr((str),(beg),(len))
|
103
|
+
#else
|
104
|
+
#define MY_STR_SUBSEQ(str,beg,len) rb_str_subseq((str),(beg),(len))
|
103
105
|
#endif
|
104
106
|
|
105
107
|
#endif /* KGIO_H */
|
data/ext/kgio/poll.c
CHANGED
data/ext/kgio/tryopen.c
CHANGED
data/ext/kgio/write.c
CHANGED
data/ext/kgio/writev.c
CHANGED
@@ -27,7 +27,9 @@ static inline VALUE my_ary_subseq(VALUE ary, long idx, long len)
|
|
27
27
|
|
28
28
|
return rb_ary_aref(2, args, ary);
|
29
29
|
}
|
30
|
-
#define
|
30
|
+
#define MY_ARY_SUBSEQ(ary,idx,len) my_ary_subseq((ary),(idx),(len))
|
31
|
+
#else
|
32
|
+
#define MY_ARY_SUBSEQ(ary,idx,len) rb_ary_subseq((ary),(idx),(len))
|
31
33
|
#endif
|
32
34
|
|
33
35
|
static VALUE sym_wait_writable;
|
@@ -56,22 +58,22 @@ struct my_iovec {
|
|
56
58
|
* turns x/512 into x>>9 */
|
57
59
|
#define WRITEV_IMPL_THRESHOLD 512
|
58
60
|
|
59
|
-
static
|
61
|
+
static int iov_max = 1024; /* this could be overriden in init */
|
60
62
|
|
61
63
|
struct wrv_args {
|
62
64
|
VALUE io;
|
63
65
|
VALUE buf;
|
64
66
|
VALUE vec_buf; /* FIXME: this requires RSTRING_MODIFY for rbx */
|
65
67
|
struct iovec *vec;
|
66
|
-
|
68
|
+
int iov_cnt;
|
67
69
|
size_t batch_len;
|
68
70
|
int something_written;
|
69
71
|
int fd;
|
70
72
|
};
|
71
73
|
|
72
|
-
static ssize_t custom_writev(int fd, const struct iovec *vec,
|
74
|
+
static ssize_t custom_writev(int fd, const struct iovec *vec, int iov_cnt, size_t total_len)
|
73
75
|
{
|
74
|
-
|
76
|
+
int i;
|
75
77
|
ssize_t result;
|
76
78
|
char *buf, *curbuf;
|
77
79
|
const struct iovec *curvec = vec;
|
@@ -105,7 +107,7 @@ static void prepare_writev(struct wrv_args *a, VALUE io, VALUE ary)
|
|
105
107
|
|
106
108
|
if (TYPE(ary) == T_ARRAY)
|
107
109
|
/* rb_ary_subseq will not copy array unless it modified */
|
108
|
-
a->buf =
|
110
|
+
a->buf = MY_ARY_SUBSEQ(ary, 0, RARRAY_LEN(ary));
|
109
111
|
else
|
110
112
|
a->buf = rb_Array(ary);
|
111
113
|
|
@@ -113,12 +115,25 @@ static void prepare_writev(struct wrv_args *a, VALUE io, VALUE ary)
|
|
113
115
|
a->vec = NULL;
|
114
116
|
}
|
115
117
|
|
118
|
+
#ifndef RARRAY_LENINT
|
119
|
+
static inline int rarray_int(VALUE val)
|
120
|
+
{
|
121
|
+
long num = RARRAY_LEN(val);
|
122
|
+
|
123
|
+
if ((long)(int)num != num)
|
124
|
+
rb_raise(rb_eRangeError, "%ld cannot to be an int", num);
|
125
|
+
|
126
|
+
return (int)num;
|
127
|
+
}
|
128
|
+
#define RARRAY_LENINT(n) rarray_int(n)
|
129
|
+
#endif
|
130
|
+
|
116
131
|
static void fill_iovec(struct wrv_args *a)
|
117
132
|
{
|
118
|
-
|
133
|
+
int i;
|
119
134
|
struct iovec *curvec;
|
120
135
|
|
121
|
-
a->iov_cnt =
|
136
|
+
a->iov_cnt = RARRAY_LENINT(a->buf);
|
122
137
|
a->batch_len = 0;
|
123
138
|
if (a->iov_cnt == 0) return;
|
124
139
|
if (a->iov_cnt > iov_max) a->iov_cnt = iov_max;
|
@@ -150,18 +165,18 @@ static void fill_iovec(struct wrv_args *a)
|
|
150
165
|
}
|
151
166
|
}
|
152
167
|
|
153
|
-
static long trim_writev_buffer(struct wrv_args *a,
|
168
|
+
static long trim_writev_buffer(struct wrv_args *a, ssize_t n)
|
154
169
|
{
|
155
170
|
long i;
|
156
171
|
long ary_len = RARRAY_LEN(a->buf);
|
157
172
|
|
158
|
-
if (n == (
|
173
|
+
if (n == (ssize_t)a->batch_len) {
|
159
174
|
i = a->iov_cnt;
|
160
175
|
n = 0;
|
161
176
|
} else {
|
162
177
|
for (i = 0; n && i < ary_len; i++) {
|
163
178
|
VALUE entry = rb_ary_entry(a->buf, i);
|
164
|
-
n -= RSTRING_LEN(entry);
|
179
|
+
n -= (ssize_t)RSTRING_LEN(entry);
|
165
180
|
if (n < 0) break;
|
166
181
|
}
|
167
182
|
}
|
@@ -175,19 +190,20 @@ static long trim_writev_buffer(struct wrv_args *a, long n)
|
|
175
190
|
|
176
191
|
/* partially done, remove fully-written buffers */
|
177
192
|
if (i > 0)
|
178
|
-
a->buf =
|
193
|
+
a->buf = MY_ARY_SUBSEQ(a->buf, i, ary_len - i);
|
179
194
|
|
180
195
|
/* setup+replace partially written buffer */
|
181
196
|
if (n < 0) {
|
182
197
|
VALUE str = rb_ary_entry(a->buf, 0);
|
183
198
|
long str_len = RSTRING_LEN(str);
|
184
|
-
str =
|
199
|
+
str = MY_STR_SUBSEQ(str, str_len + n, -n);
|
185
200
|
rb_ary_store(a->buf, 0, str);
|
186
201
|
}
|
187
202
|
return RARRAY_LEN(a->buf);
|
188
203
|
}
|
189
204
|
|
190
|
-
static
|
205
|
+
static long
|
206
|
+
writev_check(struct wrv_args *a, ssize_t n, const char *msg, int io_wait)
|
191
207
|
{
|
192
208
|
if (n >= 0) {
|
193
209
|
if (n > 0) a->something_written = 1;
|
@@ -214,7 +230,7 @@ static int writev_check(struct wrv_args *a, long n, const char *msg, int io_wait
|
|
214
230
|
static VALUE my_writev(VALUE io, VALUE ary, int io_wait)
|
215
231
|
{
|
216
232
|
struct wrv_args a;
|
217
|
-
|
233
|
+
ssize_t n;
|
218
234
|
|
219
235
|
prepare_writev(&a, io, ary);
|
220
236
|
set_nonblocking(a.fd);
|
@@ -224,15 +240,13 @@ static VALUE my_writev(VALUE io, VALUE ary, int io_wait)
|
|
224
240
|
if (a.iov_cnt == 0)
|
225
241
|
n = 0;
|
226
242
|
else if (a.iov_cnt == 1)
|
227
|
-
n =
|
228
|
-
a.vec[0].iov_len);
|
243
|
+
n = write(a.fd, a.vec[0].iov_base, a.vec[0].iov_len);
|
229
244
|
/* for big strings use library function */
|
230
245
|
else if (USE_WRITEV &&
|
231
|
-
((a.batch_len
|
232
|
-
n =
|
246
|
+
((long)(a.batch_len/WRITEV_IMPL_THRESHOLD) > a.iov_cnt))
|
247
|
+
n = writev(a.fd, a.vec, a.iov_cnt);
|
233
248
|
else
|
234
|
-
n =
|
235
|
-
a.batch_len);
|
249
|
+
n = custom_writev(a.fd, a.vec, a.iov_cnt, a.batch_len);
|
236
250
|
} while (writev_check(&a, n, "writev", io_wait) != 0);
|
237
251
|
rb_str_resize(a.vec_buf, 0);
|
238
252
|
|
@@ -303,9 +317,9 @@ static VALUE s_trywritev(VALUE mod, VALUE io, VALUE ary)
|
|
303
317
|
void init_kgio_writev(void)
|
304
318
|
{
|
305
319
|
#ifdef IOV_MAX
|
306
|
-
|
320
|
+
int sys_iov_max = IOV_MAX;
|
307
321
|
#else
|
308
|
-
|
322
|
+
int sys_iov_max = (int)sysconf(_SC_IOV_MAX);
|
309
323
|
#endif
|
310
324
|
|
311
325
|
VALUE mPipeMethods, mSocketMethods;
|
data/kgio.gemspec
CHANGED
@@ -1,29 +1,25 @@
|
|
1
1
|
ENV["VERSION"] or abort "VERSION= must be specified"
|
2
2
|
manifest = File.readlines('.manifest').map! { |x| x.chomp! }
|
3
|
-
require '
|
4
|
-
extend
|
3
|
+
require 'olddoc'
|
4
|
+
extend Olddoc::Gemspec
|
5
5
|
name, summary, title = readme_metadata
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = %q{kgio}
|
9
9
|
s.version = ENV["VERSION"].dup
|
10
|
-
s.homepage =
|
10
|
+
s.homepage = Olddoc.config['rdoc_url']
|
11
11
|
s.authors = ["#{name} hackers"]
|
12
|
-
s.date = Time.now.utc.strftime('%Y-%m-%d')
|
13
12
|
s.description = readme_description
|
14
|
-
s.email = %q{kgio@
|
13
|
+
s.email = %q{kgio-public@bogomips.org}
|
15
14
|
s.extra_rdoc_files = extra_rdoc_files(manifest)
|
16
15
|
s.files = manifest
|
17
|
-
s.rdoc_options = rdoc_options
|
18
|
-
s.rubyforge_project = %q{rainbows}
|
19
16
|
s.summary = summary
|
20
17
|
s.test_files = Dir['test/test_*.rb']
|
21
18
|
s.extensions = %w(ext/kgio/extconf.rb)
|
22
19
|
|
23
|
-
|
24
|
-
|
25
|
-
# s.add_development_dependency('wrongdoc', '~> 1.5')
|
20
|
+
s.add_development_dependency('olddoc', '~> 1.0')
|
21
|
+
s.add_development_dependency('test-unit', '~> 3.0')
|
26
22
|
# s.add_development_dependency('strace_me', '~> 1.0') # Linux only
|
27
23
|
|
28
|
-
|
24
|
+
s.licenses = %w(LGPL-2.1+)
|
29
25
|
end
|
data/pkg.mk
CHANGED
@@ -1,7 +1,8 @@
|
|
1
1
|
RUBY = ruby
|
2
2
|
RAKE = rake
|
3
3
|
RSYNC = rsync
|
4
|
-
|
4
|
+
OLDDOC = olddoc
|
5
|
+
RDOC = rdoc
|
5
6
|
|
6
7
|
GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE
|
7
8
|
@./GIT-VERSION-GEN
|
@@ -12,14 +13,6 @@ RUBY_VERSION := $(shell $(RUBY) -e 'puts RUBY_VERSION')
|
|
12
13
|
RUBY_ENGINE := $(shell $(RUBY) -e 'puts((RUBY_ENGINE rescue "ruby"))')
|
13
14
|
lib := lib
|
14
15
|
|
15
|
-
ifeq ($(shell test -f script/isolate_for_tests && echo t),t)
|
16
|
-
isolate_libs := tmp/isolate/$(RUBY_ENGINE)-$(RUBY_VERSION)/isolate.mk
|
17
|
-
$(isolate_libs): script/isolate_for_tests
|
18
|
-
@$(RUBY) script/isolate_for_tests
|
19
|
-
-include $(isolate_libs)
|
20
|
-
lib := $(lib):$(ISOLATE_LIBS)
|
21
|
-
endif
|
22
|
-
|
23
16
|
ext := $(firstword $(wildcard ext/*))
|
24
17
|
ifneq ($(ext),)
|
25
18
|
ext_pfx := tmp/ext/$(RUBY_ENGINE)-$(RUBY_VERSION)
|
@@ -36,7 +29,7 @@ $(ext_pfx)/$(ext)/%: $(ext)/% $(ext_d)
|
|
36
29
|
install -m 644 $< $@
|
37
30
|
$(ext_pfx)/$(ext)/Makefile: $(ext)/extconf.rb $(ext_d) $(ext_h)
|
38
31
|
$(RM) -f $(@D)/*.o
|
39
|
-
cd $(@D) && $(RUBY) $(CURDIR)/$(ext)/extconf.rb
|
32
|
+
cd $(@D) && $(RUBY) $(CURDIR)/$(ext)/extconf.rb $(EXTCONF_ARGS)
|
40
33
|
ext_sfx := _ext.$(DLEXT)
|
41
34
|
ext_dl := $(ext_pfx)/$(ext)/$(notdir $(ext)_ext.$(DLEXT))
|
42
35
|
$(ext_dl): $(ext_src) $(ext_pfx_src) $(ext_pfx)/$(ext)/Makefile
|
@@ -48,10 +41,10 @@ else
|
|
48
41
|
build:
|
49
42
|
endif
|
50
43
|
|
51
|
-
pkg_extra += GIT-VERSION-FILE NEWS
|
52
|
-
|
53
|
-
$(
|
54
|
-
|
44
|
+
pkg_extra += GIT-VERSION-FILE NEWS LATEST
|
45
|
+
NEWS: GIT-VERSION-FILE .olddoc.yml
|
46
|
+
$(OLDDOC) prepare
|
47
|
+
LATEST: NEWS
|
55
48
|
|
56
49
|
manifest:
|
57
50
|
$(RM) .manifest
|
@@ -63,28 +56,20 @@ manifest:
|
|
63
56
|
cmp $@+ $@ || mv $@+ $@
|
64
57
|
$(RM) $@+
|
65
58
|
|
66
|
-
doc:: .document .
|
59
|
+
doc:: .document .olddoc.yml $(pkg_extra) $(PLACEHOLDERS)
|
67
60
|
-find lib -type f -name '*.rbc' -exec rm -f '{}' ';'
|
68
61
|
-find ext -type f -name '*.rbc' -exec rm -f '{}' ';'
|
69
62
|
$(RM) -r doc
|
70
|
-
$(
|
63
|
+
$(RDOC) -f oldweb
|
64
|
+
$(OLDDOC) merge
|
71
65
|
install -m644 COPYING doc/COPYING
|
66
|
+
install -m644 NEWS doc/NEWS
|
67
|
+
install -m644 NEWS.atom.xml doc/NEWS.atom.xml
|
72
68
|
install -m644 $(shell LC_ALL=C grep '^[A-Z]' .document) doc/
|
73
69
|
|
74
70
|
ifneq ($(VERSION),)
|
75
71
|
pkggem := pkg/$(rfpackage)-$(VERSION).gem
|
76
72
|
pkgtgz := pkg/$(rfpackage)-$(VERSION).tgz
|
77
|
-
release_notes := release_notes-$(VERSION)
|
78
|
-
release_changes := release_changes-$(VERSION)
|
79
|
-
|
80
|
-
release-notes: $(release_notes)
|
81
|
-
release-changes: $(release_changes)
|
82
|
-
$(release_changes):
|
83
|
-
$(WRONGDOC) release_changes > $@+
|
84
|
-
$(VISUAL) $@+ && test -s $@+ && mv $@+ $@
|
85
|
-
$(release_notes):
|
86
|
-
$(WRONGDOC) release_notes > $@+
|
87
|
-
$(VISUAL) $@+ && test -s $@+ && mv $@+ $@
|
88
73
|
|
89
74
|
# ensures we're actually on the tagged $(VERSION), only used for release
|
90
75
|
verify:
|
@@ -120,31 +105,18 @@ $(pkgtgz): manifest fix-perms
|
|
120
105
|
|
121
106
|
package: $(pkgtgz) $(pkggem)
|
122
107
|
|
123
|
-
|
124
|
-
# make tgz release on RubyForge
|
125
|
-
@echo rubyforge add_release -f \
|
126
|
-
-n $(release_notes) -a $(release_changes) \
|
127
|
-
$(rfproject) $(rfpackage) $(VERSION) $(pkgtgz)
|
128
|
-
@echo gem push $(pkggem)
|
129
|
-
@echo rubyforge add_file \
|
130
|
-
$(rfproject) $(rfpackage) $(VERSION) $(pkggem)
|
131
|
-
release:: verify package $(release_notes) $(release_changes)
|
132
|
-
# make tgz release on RubyForge
|
133
|
-
rubyforge add_release -f -n $(release_notes) -a $(release_changes) \
|
134
|
-
$(rfproject) $(rfpackage) $(VERSION) $(pkgtgz)
|
108
|
+
release:: verify package
|
135
109
|
# push gem to RubyGems.org
|
136
110
|
gem push $(pkggem)
|
137
|
-
# in case of gem downloads from RubyForge releases page
|
138
|
-
rubyforge add_file \
|
139
|
-
$(rfproject) $(rfpackage) $(VERSION) $(pkggem)
|
140
111
|
else
|
141
112
|
gem install-gem: GIT-VERSION-FILE
|
142
113
|
$(MAKE) $@ VERSION=$(GIT_VERSION)
|
143
114
|
endif
|
144
115
|
|
145
|
-
all::
|
116
|
+
all:: check
|
146
117
|
test_units := $(wildcard test/test_*.rb)
|
147
|
-
test:
|
118
|
+
test: check
|
119
|
+
check: test-unit
|
148
120
|
test-unit: $(test_units)
|
149
121
|
$(test_units): build
|
150
122
|
$(RUBY) -I $(lib) $@ $(RUBY_TEST_OPTS)
|
@@ -154,8 +126,6 @@ ifneq ($(RSYNC_DEST),)
|
|
154
126
|
publish_doc:
|
155
127
|
-git set-file-times
|
156
128
|
$(MAKE) doc
|
157
|
-
find doc/images -type f | \
|
158
|
-
TZ=UTC xargs touch -d '1970-01-01 00:00:06' doc/rdoc.css
|
159
129
|
$(MAKE) doc_gz
|
160
130
|
$(RSYNC) -av doc/ $(RSYNC_DEST)/
|
161
131
|
git ls-files | xargs touch
|
@@ -163,7 +133,7 @@ endif
|
|
163
133
|
|
164
134
|
# Create gzip variants of the same timestamp as the original so nginx
|
165
135
|
# "gzip_static on" can serve the gzipped versions directly.
|
166
|
-
doc_gz: docs = $(shell find doc -type f ! -regex '
|
136
|
+
doc_gz: docs = $(shell find doc -type f ! -regex '^.*\.gz$$')
|
167
137
|
doc_gz:
|
168
138
|
for i in $(docs); do \
|
169
139
|
gzip --rsyncable -9 < $$i > $$i.gz; touch -r $$i $$i.gz; done
|
@@ -171,5 +141,10 @@ check-warnings:
|
|
171
141
|
@(for i in $$(git ls-files '*.rb'| grep -v '^setup\.rb$$'); \
|
172
142
|
do $(RUBY) -d -W2 -c $$i; done) | grep -v '^Syntax OK$$' || :
|
173
143
|
|
174
|
-
|
144
|
+
ifneq ($(PLACEHOLDERS),)
|
145
|
+
$(PLACEHOLDERS):
|
146
|
+
echo olddoc_placeholder > $@
|
147
|
+
endif
|
148
|
+
|
149
|
+
.PHONY: all .FORCE-GIT-VERSION-FILE doc check test $(test_units) manifest
|
175
150
|
.PHONY: check-warnings
|
data/test/lib_read_write.rb
CHANGED
@@ -292,7 +292,8 @@ module LibReadWriteTest
|
|
292
292
|
assert_equal :wait_writable, tmp.pop
|
293
293
|
assert tmp.size > 0
|
294
294
|
penultimate = tmp.pop
|
295
|
-
assert(penultimate == "I" || penultimate == nil
|
295
|
+
assert(penultimate == ["I"] || penultimate == nil,
|
296
|
+
"penultimate is #{penultimate.inspect}")
|
296
297
|
assert tmp.size > 0
|
297
298
|
tmp.each { |count| assert_equal nil, count }
|
298
299
|
end
|
metadata
CHANGED
@@ -1,24 +1,49 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kgio
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.9.
|
5
|
-
prerelease:
|
4
|
+
version: 2.9.3
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- kgio hackers
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
13
|
-
dependencies:
|
14
|
-
|
15
|
-
|
11
|
+
date: 2015-01-12 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: olddoc
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.0'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: test-unit
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '3.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '3.0'
|
41
|
+
description: |-
|
42
|
+
kgio provides non-blocking I/O methods for Ruby without raising
|
16
43
|
exceptions on EAGAIN and EINPROGRESS. It is intended for use with the
|
17
|
-
|
18
44
|
Unicorn and Rainbows! Rack servers, but may be used by other
|
19
|
-
|
20
|
-
|
21
|
-
email: kgio@librelist.org
|
45
|
+
applications (that run on Unix-like platforms).
|
46
|
+
email: kgio-public@bogomips.org
|
22
47
|
executables: []
|
23
48
|
extensions:
|
24
49
|
- ext/kgio/extconf.rb
|
@@ -28,7 +53,6 @@ extra_rdoc_files:
|
|
28
53
|
- TODO
|
29
54
|
- NEWS
|
30
55
|
- LATEST
|
31
|
-
- ChangeLog
|
32
56
|
- ISSUES
|
33
57
|
- HACKING
|
34
58
|
- lib/kgio.rb
|
@@ -40,12 +64,11 @@ extra_rdoc_files:
|
|
40
64
|
- ext/kgio/wait.c
|
41
65
|
- ext/kgio/tryopen.c
|
42
66
|
files:
|
43
|
-
- .document
|
44
|
-
- .gitignore
|
45
|
-
- .manifest
|
46
|
-
- .
|
67
|
+
- ".document"
|
68
|
+
- ".gitignore"
|
69
|
+
- ".manifest"
|
70
|
+
- ".olddoc.yml"
|
47
71
|
- COPYING
|
48
|
-
- ChangeLog
|
49
72
|
- GIT-VERSION-FILE
|
50
73
|
- GIT-VERSION-GEN
|
51
74
|
- GNUmakefile
|
@@ -55,8 +78,9 @@ files:
|
|
55
78
|
- LICENSE
|
56
79
|
- NEWS
|
57
80
|
- README
|
58
|
-
- Rakefile
|
59
81
|
- TODO
|
82
|
+
- archive/.gitignore
|
83
|
+
- archive/slrnpull.conf
|
60
84
|
- ext/kgio/accept.c
|
61
85
|
- ext/kgio/ancient_ruby.h
|
62
86
|
- ext/kgio/autopush.c
|
@@ -111,32 +135,28 @@ files:
|
|
111
135
|
- test/test_unix_server.rb
|
112
136
|
- test/test_unix_server_read_client_write.rb
|
113
137
|
homepage: http://bogomips.org/kgio/
|
114
|
-
licenses:
|
138
|
+
licenses:
|
139
|
+
- LGPL-2.1+
|
140
|
+
metadata: {}
|
115
141
|
post_install_message:
|
116
|
-
rdoc_options:
|
117
|
-
- -t
|
118
|
-
- kgio - kinder, gentler I/O for Ruby
|
119
|
-
- -W
|
120
|
-
- http://bogomips.org/kgio.git/tree/%s
|
142
|
+
rdoc_options: []
|
121
143
|
require_paths:
|
122
144
|
- lib
|
123
145
|
required_ruby_version: !ruby/object:Gem::Requirement
|
124
|
-
none: false
|
125
146
|
requirements:
|
126
|
-
- -
|
147
|
+
- - ">="
|
127
148
|
- !ruby/object:Gem::Version
|
128
149
|
version: '0'
|
129
150
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
130
|
-
none: false
|
131
151
|
requirements:
|
132
|
-
- -
|
152
|
+
- - ">="
|
133
153
|
- !ruby/object:Gem::Version
|
134
154
|
version: '0'
|
135
155
|
requirements: []
|
136
|
-
rubyforge_project:
|
137
|
-
rubygems_version:
|
156
|
+
rubyforge_project:
|
157
|
+
rubygems_version: 2.4.5
|
138
158
|
signing_key:
|
139
|
-
specification_version:
|
159
|
+
specification_version: 4
|
140
160
|
summary: kinder, gentler I/O for Ruby
|
141
161
|
test_files:
|
142
162
|
- test/test_poll.rb
|
data/Rakefile
DELETED
@@ -1,32 +0,0 @@
|
|
1
|
-
# -*- encoding: binary -*-
|
2
|
-
cgit_url = "http://bogomips.org/kgio.git"
|
3
|
-
git_url = 'git://bogomips.org/kgio.git'
|
4
|
-
|
5
|
-
desc "post news article to rubyforge"
|
6
|
-
task :publish_news do
|
7
|
-
require 'rubyforge'
|
8
|
-
spec = Gem::Specification.load('kgio.gemspec')
|
9
|
-
tmp = Tempfile.new('rf-news')
|
10
|
-
_, subject, body = `git cat-file tag v#{spec.version}`.split(/\n\n/, 3)
|
11
|
-
tmp.puts subject
|
12
|
-
tmp.puts
|
13
|
-
tmp.puts spec.description.strip
|
14
|
-
tmp.puts ""
|
15
|
-
tmp.puts "* #{spec.homepage}"
|
16
|
-
tmp.puts "* #{spec.email}"
|
17
|
-
tmp.puts "* #{git_url}"
|
18
|
-
tmp.print "\nChanges:\n\n"
|
19
|
-
tmp.puts body
|
20
|
-
tmp.flush
|
21
|
-
system(ENV["VISUAL"], tmp.path) or abort "#{ENV["VISUAL"]} failed: #$?"
|
22
|
-
msg = File.readlines(tmp.path)
|
23
|
-
subject = msg.shift
|
24
|
-
blank = msg.shift
|
25
|
-
blank == "\n" or abort "no newline after subject!"
|
26
|
-
subject.strip!
|
27
|
-
body = msg.join("").strip!
|
28
|
-
|
29
|
-
rf = RubyForge.new.configure
|
30
|
-
rf.login
|
31
|
-
rf.post_news('rainbows', subject, body)
|
32
|
-
end
|