nio4r 0.4.6 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +7 -2
- data/CHANGES.md +6 -0
- data/Gemfile +1 -0
- data/ext/libev/Changes +57 -0
- data/ext/libev/LICENSE +2 -1
- data/ext/libev/README +8 -8
- data/ext/libev/ev.c +541 -214
- data/ext/libev/ev.h +106 -100
- data/ext/libev/ev_epoll.c +1 -1
- data/ext/libev/ev_kqueue.c +20 -4
- data/ext/libev/ev_vars.h +15 -16
- data/ext/libev/ev_win32.c +12 -2
- data/ext/libev/ev_wrap.h +162 -160
- data/ext/nio4r/libev.h +2 -1
- data/ext/nio4r/org/nio4r/Nio4r.java +5 -1
- data/ext/nio4r/selector.c +6 -0
- data/lib/nio/selector.rb +8 -4
- data/lib/nio/version.rb +1 -1
- data/nio4r.gemspec +1 -1
- data/spec/nio/selectables/tcp_socket_spec.rb +3 -3
- data/spec/nio/selector_spec.rb +8 -3
- data/spec/spec_helper.rb +4 -1
- data/spec/support/selectable_examples.rb +0 -1
- metadata +3 -3
data/lib/nio/version.rb
CHANGED
data/nio4r.gemspec
CHANGED
@@ -6,7 +6,7 @@ Gem::Specification.new do |gem|
|
|
6
6
|
gem.email = ["tony.arcieri@gmail.com"]
|
7
7
|
gem.description = "New IO for Ruby"
|
8
8
|
gem.summary = "NIO provides a high performance selector API for monitoring IO objects"
|
9
|
-
gem.homepage = "https://github.com/
|
9
|
+
gem.homepage = "https://github.com/celluloid/nio4r"
|
10
10
|
|
11
11
|
gem.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
12
12
|
gem.files = `git ls-files`.split("\n")
|
@@ -3,7 +3,7 @@ require 'spec_helper'
|
|
3
3
|
describe TCPSocket do
|
4
4
|
port_offset = 0
|
5
5
|
let(:tcp_port) { 12345 + (port_offset += 1) }
|
6
|
-
|
6
|
+
|
7
7
|
let :readable_subject do
|
8
8
|
server = TCPServer.new("localhost", tcp_port)
|
9
9
|
sock = TCPSocket.open("localhost", tcp_port)
|
@@ -67,7 +67,7 @@ describe TCPSocket do
|
|
67
67
|
it_behaves_like "an NIO selectable"
|
68
68
|
it_behaves_like "an NIO selectable stream"
|
69
69
|
it_behaves_like "an NIO bidirectional stream"
|
70
|
-
|
70
|
+
|
71
71
|
context :connect do
|
72
72
|
it "selects writable when connected" do
|
73
73
|
selector = NIO::Selector.new
|
@@ -85,4 +85,4 @@ describe TCPSocket do
|
|
85
85
|
result.unpack('i').first.should be_zero
|
86
86
|
end
|
87
87
|
end
|
88
|
-
end
|
88
|
+
end
|
data/spec/nio/selector_spec.rb
CHANGED
@@ -19,6 +19,11 @@ describe NIO::Selector do
|
|
19
19
|
it "raises TypeError if asked to register non-IO objects" do
|
20
20
|
expect { subject.register(42, :r) }.to raise_exception TypeError
|
21
21
|
end
|
22
|
+
|
23
|
+
it "raises when asked to register after closing" do
|
24
|
+
subject.close
|
25
|
+
expect { subject.register(reader, :r) }.to raise_exception IOError
|
26
|
+
end
|
22
27
|
end
|
23
28
|
|
24
29
|
it "knows which IO objects are registered" do
|
@@ -34,12 +39,12 @@ describe NIO::Selector do
|
|
34
39
|
subject.should_not be_registered(reader)
|
35
40
|
monitor.should be_closed
|
36
41
|
end
|
37
|
-
|
42
|
+
|
38
43
|
it "reports if it is empty" do
|
39
44
|
subject.should be_empty
|
40
|
-
|
45
|
+
|
41
46
|
monitor = subject.register(reader, :r)
|
42
|
-
|
47
|
+
|
43
48
|
subject.should_not be_empty
|
44
49
|
end
|
45
50
|
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nio4r
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tony Arcieri
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-08-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake-compiler
|
@@ -107,7 +107,7 @@ files:
|
|
107
107
|
- spec/support/selectable_examples.rb
|
108
108
|
- tasks/extension.rake
|
109
109
|
- tasks/rspec.rake
|
110
|
-
homepage: https://github.com/
|
110
|
+
homepage: https://github.com/celluloid/nio4r
|
111
111
|
licenses: []
|
112
112
|
metadata: {}
|
113
113
|
post_install_message:
|