kgio 1.1.0 → 1.2.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,21 @@
1
+ # -*- encoding: binary -*-
2
+ require 'socket'
3
+ module Kgio
4
+
5
+ # The IPv4 address of UNIX domain sockets, useful for creating
6
+ # Rack (and CGI) servers that also serve HTTP traffic over
7
+ # UNIX domain sockets.
8
+ LOCALHOST = '127.0.0.1'
9
+ end
10
+
11
+ # Kgio::PipeMethods#kgio_tryread and Kgio::SocketMethods#kgio_tryread will
12
+ # return this constant when waiting for a read is required.
13
+ module Kgio::WaitReadable; end
14
+
15
+ # PipeMethods#kgio_trywrite and SocketMethods#kgio_trywrite will
16
+ # return this constant when waiting for a read is required.
17
+ module Kgio::WaitWritable; end
18
+
1
19
  require 'kgio_ext'
2
20
 
3
21
  # use Kgio::Pipe.popen and Kgio::Pipe.new instead of IO.popen
@@ -21,6 +21,16 @@ module LibReadWriteTest
21
21
  assert_nil @rd.kgio_read(5)
22
22
  end
23
23
 
24
+ def test_read_bang_eof
25
+ @wr.close
26
+ begin
27
+ @rd.kgio_read!(5)
28
+ assert false, "should never get here (line:#{__LINE__})"
29
+ rescue EOFError => e
30
+ assert_equal [], e.backtrace
31
+ end
32
+ end
33
+
24
34
  def test_tryread_eof
25
35
  @wr.close
26
36
  assert_nil @rd.kgio_tryread(5)
@@ -28,16 +38,24 @@ module LibReadWriteTest
28
38
 
29
39
  def test_write_closed
30
40
  @rd.close
31
- assert_raises(Errno::EPIPE, Errno::ECONNRESET) {
41
+ begin
32
42
  loop { @wr.kgio_write "HI" }
33
- }
43
+ rescue Errno::EPIPE, Errno::ECONNRESET => e
44
+ assert_equal [], e.backtrace
45
+ return
46
+ end
47
+ assert false, "should never get here (line:#{__LINE__})"
34
48
  end
35
49
 
36
50
  def test_trywrite_closed
37
51
  @rd.close
38
- assert_raises(Errno::EPIPE, Errno::ECONNRESET) {
52
+ begin
39
53
  loop { @wr.kgio_trywrite "HI" }
40
- }
54
+ rescue Errno::EPIPE, Errno::ECONNRESET => e
55
+ assert_equal [], e.backtrace
56
+ return
57
+ end
58
+ assert false, "should never get here (line:#{__LINE__})"
41
59
  end
42
60
 
43
61
  def test_write_conv
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kgio
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 31
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
- - 1
8
+ - 2
9
9
  - 0
10
- version: 1.1.0
10
+ version: 1.2.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - kgio hackers
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-09-29 00:00:00 +00:00
18
+ date: 2010-10-05 00:00:00 +00:00
19
19
  default_executable:
20
20
  dependencies: []
21
21
 
@@ -55,13 +55,18 @@ files:
55
55
  - README
56
56
  - Rakefile
57
57
  - TODO
58
+ - ext/kgio/accept.c
59
+ - ext/kgio/connect.c
58
60
  - ext/kgio/extconf.rb
61
+ - ext/kgio/kgio.h
59
62
  - ext/kgio/kgio_ext.c
60
63
  - ext/kgio/missing/accept4.h
61
64
  - ext/kgio/missing/ancient_ruby.h
62
65
  - ext/kgio/my_fileno.h
63
66
  - ext/kgio/nonblock.h
67
+ - ext/kgio/read_write.c
64
68
  - ext/kgio/sock_for_fd.h
69
+ - ext/kgio/wait.c
65
70
  - kgio.gemspec
66
71
  - lib/kgio.rb
67
72
  - setup.rb