kgio 2.8.0.2.g30c1 → 2.8.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,7 +1,7 @@
1
1
  #!/bin/sh
2
2
 
3
3
  GVF=GIT-VERSION-FILE
4
- DEF_VER=v2.8.0
4
+ DEF_VER=v2.8.1
5
5
 
6
6
  LF='
7
7
  '
@@ -2,6 +2,7 @@
2
2
  require 'test/unit'
3
3
  require 'io/nonblock'
4
4
  require 'digest/sha1'
5
+ require 'fileutils'
5
6
  $-w = true
6
7
  require 'kgio'
7
8
 
@@ -11,6 +12,7 @@ module LibReadWriteTest
11
12
  def teardown
12
13
  @rd.close if defined?(@rd) && ! @rd.closed?
13
14
  @wr.close if defined?(@wr) && ! @wr.closed?
15
+ FileUtils.remove_entry_secure(@tmpdir) if defined?(@tmpdir)
14
16
  end
15
17
 
16
18
  def test_write_empty
@@ -356,7 +358,8 @@ module LibReadWriteTest
356
358
  readed = @rd.read(RANDOM_BLOB.size)
357
359
  thr.join
358
360
  assert_nil thr.value
359
- assert_equal RANDOM_BLOB, readed
361
+ e = (RANDOM_BLOB == readed)
362
+ assert e
360
363
  end
361
364
 
362
365
  def test_monster_write_wait_writable
@@ -388,7 +391,8 @@ module LibReadWriteTest
388
391
  readed = @rd.read(buf_size)
389
392
  thr.join
390
393
  assert_nil thr.value
391
- assert_equal buf.join, readed
394
+ e = (buf.join == readed)
395
+ assert e
392
396
  assert @wr.instance_variable_get(:@nr) > 0
393
397
  end
394
398
 
@@ -454,10 +458,12 @@ module LibReadWriteTest
454
458
  def @wr.kgio_wait_writable
455
459
  raise "Hello"
456
460
  end
457
- tmp = []
458
- buf = "." * 1024
459
- 10000.times { tmp << @wr.kgio_trywrite(buf) }
460
- assert_equal :wait_writable, tmp.pop
461
+ buf = "." * 4096
462
+ rv = nil
463
+ until rv == :wait_writable
464
+ rv = @wr.kgio_trywrite(buf)
465
+ end
466
+ assert_equal :wait_writable, rv
461
467
  end
462
468
 
463
469
  def test_wait_writable_method
@@ -1,6 +1,7 @@
1
1
  require 'test/unit'
2
2
  require 'fcntl'
3
3
  require 'io/nonblock'
4
+ require 'fileutils'
4
5
  $-w = true
5
6
  require 'kgio'
6
7
 
@@ -8,6 +9,7 @@ module LibServerAccept
8
9
 
9
10
  def teardown
10
11
  @srv.close unless @srv.closed?
12
+ FileUtils.remove_entry_secure(@tmpdir) if defined?(@tmpdir)
11
13
  Kgio.accept_cloexec = true
12
14
  Kgio.accept_nonblock = false
13
15
  end
@@ -44,8 +44,7 @@ class TestAutopush < Test::Unit::TestCase
44
44
  Kgio.autopush = true
45
45
  tmp = Tempfile.new('kgio_unix')
46
46
  @path = tmp.path
47
- File.unlink(@path)
48
- tmp.close rescue nil
47
+ tmp.close!
49
48
  @srv = Kgio::UNIXServer.new(@path)
50
49
  @rd = Kgio::UNIXSocket.new(@path)
51
50
  t0 = nil
@@ -89,12 +89,17 @@ class TestPoll < Test::Unit::TestCase
89
89
 
90
90
  def test_poll_EINTR_changed
91
91
  ok = false
92
- orig = trap(:USR1) { ok = true }
93
92
  pollset = { @rd => Kgio::POLLIN }
93
+ orig = trap(:USR1) do
94
+ pollset[@wr] = Kgio::POLLOUT
95
+ ok = true
96
+ end
94
97
  thr = Thread.new do
95
98
  sleep 0.100
96
- pollset[@wr] = Kgio::POLLOUT
97
- Process.kill(:USR1, $$)
99
+ 100.times do
100
+ Process.kill(:USR1, $$)
101
+ Thread.pass
102
+ end
98
103
  end
99
104
  t0 = Time.now
100
105
  res = Kgio.poll(pollset, 1000)
@@ -112,7 +117,7 @@ class TestPoll < Test::Unit::TestCase
112
117
  empty = 0
113
118
  nr = 100
114
119
  set = { @rd => Kgio::POLLIN }
115
- trap(:USR1) { usr1 += 1 }
120
+ orig = trap(:USR1) { usr1 += 1 }
116
121
  pid = fork do
117
122
  trap(:USR1, "DEFAULT")
118
123
  sleep 0.1
@@ -127,6 +132,6 @@ class TestPoll < Test::Unit::TestCase
127
132
  assert status.success?, status.inspect
128
133
  assert usr1 > 0, "usr1: #{usr1}"
129
134
  ensure
130
- trap(:USR1, "DEFAULT")
135
+ trap(:USR1, orig)
131
136
  end unless RUBY_PLATFORM =~ /kfreebsd-gnu/
132
137
  end if Kgio.respond_to?(:poll)
@@ -30,7 +30,12 @@ class TestTryopen < Test::Unit::TestCase
30
30
  tmp = Tempfile.new "tryopen"
31
31
  File.chmod 0000, tmp.path
32
32
  tmp = Kgio::File.tryopen(tmp.path)
33
- assert_equal(:EACCES, tmp)
33
+ if Process.euid == 0
34
+ assert_kind_of Kgio::File, tmp
35
+ warn "cannot test EACCES when euid == 0"
36
+ else
37
+ assert_equal(:EACCES, tmp)
38
+ end
34
39
  end
35
40
 
36
41
  def test_tryopen_readwrite
@@ -1,12 +1,13 @@
1
1
  require './test/lib_read_write'
2
2
  require 'tempfile'
3
+ require 'tmpdir'
3
4
 
4
5
  class TestUnixClientReadServerWrite < Test::Unit::TestCase
5
6
  def setup
6
- tmp = Tempfile.new('kgio_unix')
7
+ @tmpdir = Dir.mktmpdir('kgio_unix_0')
8
+ tmp = Tempfile.new('kgio_unix_0', @tmpdir)
7
9
  @path = tmp.path
8
- File.unlink(@path)
9
- tmp.close rescue nil
10
+ tmp.close!
10
11
  @srv = Kgio::UNIXServer.new(@path)
11
12
  @rd = Kgio::UNIXSocket.new(@path)
12
13
  @wr = @srv.kgio_tryaccept
@@ -3,6 +3,7 @@ require 'io/nonblock'
3
3
  $-w = true
4
4
  require 'kgio'
5
5
  require 'tempfile'
6
+ require 'tmpdir'
6
7
 
7
8
  class SubSocket < Kgio::Socket
8
9
  attr_accessor :foo
@@ -14,10 +15,10 @@ end
14
15
  class TestKgioUnixConnect < Test::Unit::TestCase
15
16
 
16
17
  def setup
17
- tmp = Tempfile.new('kgio_unix')
18
+ @tmpdir = Dir.mktmpdir('kgio_unix_1')
19
+ tmp = Tempfile.new('kgio_unix_1', @tmpdir)
18
20
  @path = tmp.path
19
- File.unlink(@path)
20
- tmp.close rescue nil
21
+ tmp.close!
21
22
  @srv = Kgio::UNIXServer.new(@path)
22
23
  @addr = Socket.pack_sockaddr_un(@path)
23
24
  end
@@ -25,6 +26,7 @@ class TestKgioUnixConnect < Test::Unit::TestCase
25
26
  def teardown
26
27
  @srv.close unless @srv.closed?
27
28
  File.unlink(@path)
29
+ FileUtils.remove_entry_secure(@tmpdir)
28
30
  Kgio.accept_cloexec = true
29
31
  end
30
32
 
@@ -1,13 +1,14 @@
1
1
  require 'tempfile'
2
+ require 'tmpdir'
2
3
  require './test/lib_server_accept'
3
4
 
4
5
  class TestKgioUNIXServer < Test::Unit::TestCase
5
6
 
6
7
  def setup
7
- tmp = Tempfile.new('kgio_unix')
8
+ @tmpdir = Dir.mktmpdir('kgio_unix_2')
9
+ tmp = Tempfile.new('kgio_unix_2', @tmpdir)
8
10
  @path = tmp.path
9
- File.unlink(@path)
10
- tmp.close rescue nil
11
+ tmp.close!
11
12
  @srv = Kgio::UNIXServer.new(@path)
12
13
  @host = '127.0.0.1'
13
14
  end
@@ -1,12 +1,13 @@
1
1
  require './test/lib_read_write'
2
2
  require 'tempfile'
3
+ require 'tmpdir'
3
4
 
4
5
  class TestUnixServerReadClientWrite < Test::Unit::TestCase
5
6
  def setup
6
- tmp = Tempfile.new('kgio_unix')
7
+ @tmpdir = Dir.mktmpdir('kgio_unix_3')
8
+ tmp = Tempfile.new('kgio_unix_3', @tmpdir)
7
9
  @path = tmp.path
8
- File.unlink(@path)
9
- tmp.close rescue nil
10
+ tmp.close!
10
11
  @srv = Kgio::UNIXServer.new(@path)
11
12
  @wr = Kgio::UNIXSocket.new(@path)
12
13
  @rd = @srv.kgio_tryaccept
metadata CHANGED
@@ -1,15 +1,23 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: kgio
3
- version: !ruby/object:Gem::Version
4
- version: 2.8.0.2.g30c1
3
+ version: !ruby/object:Gem::Version
4
+ hash: 45
5
+ prerelease:
6
+ segments:
7
+ - 2
8
+ - 8
9
+ - 1
10
+ version: 2.8.1
5
11
  platform: ruby
6
- authors:
12
+ authors:
7
13
  - kgio hackers
8
14
  autorequire:
9
15
  bindir: bin
10
16
  cert_chain: []
11
- date: 2013-08-16 00:00:00.000000000 Z
17
+
18
+ date: 2013-09-11 00:00:00 Z
12
19
  dependencies: []
20
+
13
21
  description: |-
14
22
  kgio provides non-blocking I/O methods for Ruby without raising
15
23
  exceptions on EAGAIN and EINPROGRESS. It is intended for use with the
@@ -17,9 +25,10 @@ description: |-
17
25
  applications (that run on Unix-like platforms).
18
26
  email: kgio@librelist.org
19
27
  executables: []
20
- extensions:
28
+
29
+ extensions:
21
30
  - ext/kgio/extconf.rb
22
- extra_rdoc_files:
31
+ extra_rdoc_files:
23
32
  - LICENSE
24
33
  - README
25
34
  - TODO
@@ -37,7 +46,7 @@ extra_rdoc_files:
37
46
  - ext/kgio/read_write.c
38
47
  - ext/kgio/wait.c
39
48
  - ext/kgio/tryopen.c
40
- files:
49
+ files:
41
50
  - .document
42
51
  - .gitignore
43
52
  - .manifest
@@ -107,55 +116,64 @@ files:
107
116
  - test/test_unix_server_read_client_write.rb
108
117
  homepage: http://bogomips.org/kgio/
109
118
  licenses: []
110
- metadata: {}
119
+
111
120
  post_install_message:
112
- rdoc_options:
121
+ rdoc_options:
113
122
  - -t
114
123
  - kgio - kinder, gentler I/O for Ruby
115
124
  - -W
116
125
  - http://bogomips.org/kgio.git/tree/%s
117
- require_paths:
126
+ require_paths:
118
127
  - lib
119
- required_ruby_version: !ruby/object:Gem::Requirement
120
- requirements:
121
- - - '>='
122
- - !ruby/object:Gem::Version
123
- version: '0'
124
- required_rubygems_version: !ruby/object:Gem::Requirement
125
- requirements:
126
- - - '>'
127
- - !ruby/object:Gem::Version
128
- version: 1.3.1
128
+ required_ruby_version: !ruby/object:Gem::Requirement
129
+ none: false
130
+ requirements:
131
+ - - ">="
132
+ - !ruby/object:Gem::Version
133
+ hash: 3
134
+ segments:
135
+ - 0
136
+ version: "0"
137
+ required_rubygems_version: !ruby/object:Gem::Requirement
138
+ none: false
139
+ requirements:
140
+ - - ">="
141
+ - !ruby/object:Gem::Version
142
+ hash: 3
143
+ segments:
144
+ - 0
145
+ version: "0"
129
146
  requirements: []
147
+
130
148
  rubyforge_project: rainbows
131
- rubygems_version: 2.0.3
149
+ rubygems_version: 1.8.24
132
150
  signing_key:
133
- specification_version: 4
151
+ specification_version: 3
134
152
  summary: kinder, gentler I/O for Ruby
135
- test_files:
136
- - test/test_tryopen.rb
137
- - test/test_tfo.rb
138
- - test/test_tcp_server_read_client_write.rb
153
+ test_files:
139
154
  - test/test_poll.rb
140
- - test/test_tcp_server.rb
141
- - test/test_pipe_popen.rb
142
- - test/test_unix_server.rb
143
- - test/test_tcp6_client_read_server_write.rb
144
- - test/test_kgio_addr.rb
145
- - test/test_no_dns_on_tcp_connect.rb
146
155
  - test/test_peek.rb
147
- - test/test_autopush.rb
148
- - test/test_unix_server_read_client_write.rb
149
- - test/test_singleton_read_write.rb
150
- - test/test_tcp_connect.rb
151
- - test/test_socketpair_read_write.rb
152
- - test/test_unix_client_read_server_write.rb
156
+ - test/test_socket.rb
153
157
  - test/test_default_wait.rb
154
- - test/test_tcp_client_read_server_write.rb
155
- - test/test_connect_fd_leak.rb
158
+ - test/test_no_dns_on_tcp_connect.rb
156
159
  - test/test_unix_connect.rb
157
160
  - test/test_pipe_read_write.rb
161
+ - test/test_unix_server.rb
158
162
  - test/test_accept_flags.rb
159
- - test/test_socket.rb
160
- - test/test_accept_class.rb
163
+ - test/test_socketpair_read_write.rb
164
+ - test/test_tfo.rb
165
+ - test/test_tcp_server.rb
166
+ - test/test_unix_server_read_client_write.rb
161
167
  - test/test_cross_thread_close.rb
168
+ - test/test_tcp_connect.rb
169
+ - test/test_autopush.rb
170
+ - test/test_connect_fd_leak.rb
171
+ - test/test_singleton_read_write.rb
172
+ - test/test_kgio_addr.rb
173
+ - test/test_tryopen.rb
174
+ - test/test_tcp6_client_read_server_write.rb
175
+ - test/test_tcp_server_read_client_write.rb
176
+ - test/test_unix_client_read_server_write.rb
177
+ - test/test_tcp_client_read_server_write.rb
178
+ - test/test_pipe_popen.rb
179
+ - test/test_accept_class.rb
checksums.yaml DELETED
@@ -1,7 +0,0 @@
1
- ---
2
- SHA1:
3
- metadata.gz: 13916552988d1efd1b83ba8b1aaf40d0e46cd89b
4
- data.tar.gz: ed70530a925493064d87fb2cee504940376f77f3
5
- SHA512:
6
- metadata.gz: dc7ba745a857a967c5f51ae3d2bacab9d2e44597e4ac14c54d0f857a94b364b2fd70274921698d71657d9e5fcc5fa664a6b06cc67e1399423201ae6f979436ed
7
- data.tar.gz: fab25c9e18f2f5eb9716acc8167f81df9e0ce990727b097e0e8cd3d74bc16a704131d20a390dcb6f3710ec16459f7605d31346cb7ac72e8a6116f5d44e1421e9