cool.io 1.4.1-x64-mingw32 → 1.4.4-x64-mingw32

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a3c3fb24366477f5c9b84e6d2382c1130fb63ada
4
- data.tar.gz: 11fc33983352f1d82da7d12106c39703747ea6c0
3
+ metadata.gz: e33ad83bc54289e4b29089b212e73437f2e31ba0
4
+ data.tar.gz: 7f9ef964c93d9165f5171cf92d08b1089a648f7c
5
5
  SHA512:
6
- metadata.gz: 3a75a1e77f44ff93546039f1d5995b9379a8c6979acc93529568f864798a3586ce60821133c2dc0dd0d98041e676ad00040b9e3d0752d60b2e0724cd22dfde45
7
- data.tar.gz: a0a5440b6d2ff3523aadc46e7277ec7bcd9225c0375e77ea3832f24e25b617a1d9f8aa56a407fd0612d99b2e8399f4b0b01ec1e36d7d902df6a765e825c30d1b
6
+ metadata.gz: 8ac62573ffe734dcc6b07938c29b0ff38bf4fb3736d6efa09116794d6e8335f9715460fc03e90253b85b708acd3284733f43b2db90d5bc72a5457fbd4d76cb84
7
+ data.tar.gz: 6f16178e9329af04f3499c4d93d9105347fba3b67c0ee3ef80ee50c49a1b65af81d96d0ada535b5ead0189c0cc04443153bcca99bdb1744b221564c3cb8b8e3d
@@ -1,13 +1,17 @@
1
1
  language: ruby
2
2
 
3
+ sudo: false
4
+
3
5
  rvm:
4
6
  - 1.9.3
5
7
  - 2.0
6
8
  - 2.1
7
9
  - 2.2
10
+ - 2.3.0
8
11
  - ruby-head
9
12
  - rbx
10
13
 
11
14
  matrix:
12
15
  allow_failures:
16
+ - rvm: ruby-head
13
17
  - rvm: rbx
data/CHANGES.md CHANGED
@@ -1,3 +1,19 @@
1
+ 1.4.4
2
+ -----
3
+
4
+ * Suppress lots of warnings
5
+
6
+ 1.4.3
7
+ -----
8
+
9
+ * Use accept instead of accept_nonblock on Windows to avoid thundering held problem
10
+ * Fix compilation error on Solaris and Ruby 2.3.0
11
+
12
+ 1.4.2
13
+ -----
14
+
15
+ * Add unexpected object info to attach exception message
16
+
1
17
  1.4.1
2
18
  -----
3
19
 
data/Rakefile CHANGED
@@ -49,7 +49,7 @@ namespace :build do
49
49
  require 'rake_compiler_dock'
50
50
  RakeCompilerDock.sh <<-CROSS
51
51
  bundle
52
- rake cross native gem RUBY_CC_VERSION='2.0.0:2.1.6:2.2.2'
52
+ rake cross native gem RUBY_CC_VERSION='2.0.0:2.1.6:2.2.2:2.3.0'
53
53
  CROSS
54
54
  end
55
55
  end
@@ -0,0 +1,18 @@
1
+ ---
2
+ install:
3
+ - SET PATH=C:\Ruby%ruby_version%\bin;%PATH%
4
+ - ruby --version
5
+ - gem --version
6
+ - bundle install
7
+ build: off
8
+ test_script:
9
+ - bundle exec rake -rdevkit
10
+
11
+ environment:
12
+ matrix:
13
+ - ruby_version: "200"
14
+ - ruby_version: "200-x64"
15
+ - ruby_version: "21"
16
+ - ruby_version: "21-x64"
17
+ - ruby_version: "22"
18
+ - ruby_version: "22-x64"
@@ -2,11 +2,6 @@
2
2
  $:.push File.expand_path("../lib", __FILE__)
3
3
  require "cool.io/version"
4
4
 
5
- module Cool
6
- # Allow Coolio module to be referenced as Cool.io
7
- def self.io; Coolio; end
8
- end
9
-
10
5
  Gem::Specification.new do |s|
11
6
  s.name = "cool.io"
12
7
  s.version = Coolio::VERSION
@@ -21,9 +16,9 @@ Gem::Specification.new do |s|
21
16
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
22
17
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
23
18
  s.require_paths = ["lib"]
24
-
19
+
25
20
  s.add_development_dependency "rake-compiler", "~> 0.9.5"
26
- s.add_development_dependency "rake-compiler-dock", "~> 0.4.3"
21
+ s.add_development_dependency "rake-compiler-dock", "~> 0.5.1"
27
22
  s.add_development_dependency "rspec", ">= 2.13.0"
28
23
  s.add_development_dependency "rdoc", ">= 3.6.0"
29
24
  end
@@ -42,6 +42,11 @@ else
42
42
  end
43
43
  end
44
44
 
45
+ if RUBY_PLATFORM =~ /solaris/
46
+ # libev/ev.c requires NSIG which is undefined if _XOPEN_SOURCE is defined
47
+ $defs << '-D__EXTENSIONS__'
48
+ end
49
+
45
50
  $LIBS << ' ' << libs.join(' ')
46
51
 
47
52
  dir_config('cool.io_ext')
@@ -18,7 +18,6 @@ static VALUE Coolio_Loop_allocate(VALUE klass);
18
18
  static void Coolio_Loop_mark(struct Coolio_Loop *loop);
19
19
  static void Coolio_Loop_free(struct Coolio_Loop *loop);
20
20
 
21
- static VALUE Coolio_Loop_initialize(VALUE self);
22
21
  static VALUE Coolio_Loop_ev_loop_new(VALUE self, VALUE flags);
23
22
  static VALUE Coolio_Loop_run_once(int argc, VALUE *argv, VALUE self);
24
23
  static VALUE Coolio_Loop_run_nonblock(VALUE self);
@@ -43,8 +42,7 @@ void Init_coolio_loop()
43
42
  mCoolio = rb_define_module("Coolio");
44
43
  cCoolio_Loop = rb_define_class_under(mCoolio, "Loop", rb_cObject);
45
44
  rb_define_alloc_func(cCoolio_Loop, Coolio_Loop_allocate);
46
-
47
- rb_define_method(cCoolio_Loop, "initialize", Coolio_Loop_initialize, 0);
45
+
48
46
  rb_define_private_method(cCoolio_Loop, "ev_loop_new", Coolio_Loop_ev_loop_new, 1);
49
47
  rb_define_method(cCoolio_Loop, "run_once", Coolio_Loop_run_once, -1);
50
48
  rb_define_method(cCoolio_Loop, "run_nonblock", Coolio_Loop_run_nonblock, 0);
@@ -79,11 +77,6 @@ static void Coolio_Loop_free(struct Coolio_Loop *loop)
79
77
  xfree(loop);
80
78
  }
81
79
 
82
- static VALUE Coolio_Loop_initialize(VALUE self)
83
- {
84
- return Coolio_Loop_ev_loop_new(self, INT2NUM(0));
85
- }
86
-
87
80
  /* Wrapper for populating a Coolio_Loop struct with a new event loop */
88
81
  static VALUE Coolio_Loop_ev_loop_new(VALUE self, VALUE flags)
89
82
  {
@@ -116,8 +116,8 @@ static VALUE Coolio_StatWatcher_attach(VALUE self, VALUE loop)
116
116
  struct Coolio_Loop *loop_data;
117
117
  struct Coolio_Watcher *watcher_data;
118
118
 
119
- if(!rb_obj_is_kind_of(loop, cCoolio_Loop))
120
- rb_raise(rb_eArgError, "expected loop to be an instance of Coolio::Loop");
119
+ if(!rb_obj_is_kind_of(loop, cCoolio_Loop))
120
+ rb_raise(rb_eArgError, "expected loop to be an instance of Coolio::Loop, not %s", RSTRING_PTR(rb_inspect(loop)));
121
121
 
122
122
  Data_Get_Struct(loop, struct Coolio_Loop, loop_data);
123
123
  Data_Get_Struct(self, struct Coolio_Watcher, watcher_data);
@@ -95,8 +95,8 @@ static VALUE Coolio_TimerWatcher_attach(VALUE self, VALUE loop)
95
95
  struct Coolio_Loop *loop_data;
96
96
  struct Coolio_Watcher *watcher_data;
97
97
 
98
- if(!rb_obj_is_kind_of(loop, cCoolio_Loop))
99
- rb_raise(rb_eArgError, "expected loop to be an instance of Coolio::Loop");
98
+ if(!rb_obj_is_kind_of(loop, cCoolio_Loop))
99
+ rb_raise(rb_eArgError, "expected loop to be an instance of Coolio::Loop, not %s", RSTRING_PTR(rb_inspect(loop)));
100
100
 
101
101
  Data_Get_Struct(loop, struct Coolio_Loop, loop_data);
102
102
  Data_Get_Struct(self, struct Coolio_Watcher, watcher_data);
@@ -12,7 +12,7 @@
12
12
  struct Coolio_Loop *loop_data; \
13
13
  \
14
14
  if(!rb_obj_is_kind_of(loop, cCoolio_Loop)) \
15
- rb_raise(rb_eArgError, "expected loop to be an instance of Coolio::Loop"); \
15
+ rb_raise(rb_eArgError, "expected loop to be an instance of Coolio::Loop, not %s", RSTRING_PTR(rb_inspect(loop))); \
16
16
  \
17
17
  Data_Get_Struct(watcher, struct Coolio_Watcher, watcher_data); \
18
18
  Data_Get_Struct(loop, struct Coolio_Loop, loop_data); \
@@ -168,7 +168,7 @@ module Coolio
168
168
  return unless rcode == 0
169
169
 
170
170
  # Extract the question and answer counts
171
- qdcount, ancount = message[4..7].unpack('nn').map { |n| n.to_i }
171
+ qdcount, _ancount = message[4..7].unpack('nn').map { |n| n.to_i }
172
172
 
173
173
  # We only asked one question
174
174
  return unless qdcount == 1
@@ -40,19 +40,31 @@ module Coolio
40
40
  #########
41
41
 
42
42
  # Coolio callback for handling new connections
43
- def on_readable
44
- begin
45
- on_connection @listen_socket.accept_nonblock
46
- rescue Errno::EAGAIN, Errno::ECONNABORTED
47
- # EAGAIN can be triggered here if the socket is shared between
48
- # multiple processes and a thundering herd is woken up to accept
49
- # one connection, only one process will get the connection and
50
- # the others will be awoken.
51
- # ECONNABORTED is documented in accept() manpages but modern TCP
52
- # stacks with syncookies and/or accept()-filtering for DoS
53
- # protection do not see it. In any case this error is harmless
54
- # and we should instead spend our time with clients that follow
55
- # through on connection attempts.
43
+ unless RUBY_PLATFORM =~ /mingw|mswin/
44
+ def on_readable
45
+ begin
46
+ on_connection @listen_socket.accept_nonblock
47
+ rescue Errno::EAGAIN, Errno::ECONNABORTED
48
+ # EAGAIN can be triggered here if the socket is shared between
49
+ # multiple processes and a thundering herd is woken up to accept
50
+ # one connection, only one process will get the connection and
51
+ # the others will be awoken.
52
+ # ECONNABORTED is documented in accept() manpages but modern TCP
53
+ # stacks with syncookies and/or accept()-filtering for DoS
54
+ # protection do not see it. In any case this error is harmless
55
+ # and we should instead spend our time with clients that follow
56
+ # through on connection attempts.
57
+ end
58
+ end
59
+ else
60
+ def on_readable
61
+ begin
62
+ # In Windows, accept_nonblock() with multiple processes
63
+ # causes thundering herd problem.
64
+ # To avoid this, we need to use accept().
65
+ on_connection @listen_socket.accept
66
+ rescue Errno::EAGAIN, Errno::ECONNABORTED
67
+ end
56
68
  end
57
69
  end
58
70
  end
@@ -32,6 +32,7 @@ module Coolio
32
32
  def event_callback(*methods)
33
33
  methods.each do |method|
34
34
  module_eval <<-EOD
35
+ remove_method "#{method}"
35
36
  def #{method}(*args, &block)
36
37
  if block
37
38
  @#{method}_callback = block
@@ -27,6 +27,7 @@ module Coolio
27
27
 
28
28
  watcher_delegate :@_connector
29
29
 
30
+ remove_method :attach
30
31
  def attach(evloop)
31
32
  raise RuntimeError, "connection failed" if @_failed
32
33
 
@@ -1,5 +1,5 @@
1
1
  module Coolio
2
- VERSION = "1.4.1"
2
+ VERSION = "1.4.4"
3
3
 
4
4
  def self.version
5
5
  VERSION
@@ -70,7 +70,11 @@ describe Cool.io::StatWatcher do
70
70
  end
71
71
 
72
72
  it "should raise when the handler does not take 2 parameters" do
73
- class MyStatWatcher < Cool.io::StatWatcher; def on_change; end; end
73
+ class MyStatWatcher < Cool.io::StatWatcher
74
+ remove_method :on_change
75
+ def on_change
76
+ end
77
+ end
74
78
  expect { watcher.accessed }.to raise_error(ArgumentError)
75
79
  end
76
80
 
@@ -72,10 +72,10 @@ ensure
72
72
  end
73
73
 
74
74
  def test_run_once_timeout(timeout = TIMEOUT)
75
+ @data = ""
75
76
  reactor = Coolio::Loop.new
76
77
  server = Cool.io::TCPServer.new(HOST, PORT, MyConnection, method(:on_message))
77
78
  reactor.attach(server)
78
- running = true
79
79
  thread = Thread.new { reactor.run_once(timeout) }
80
80
  sleep timeout
81
81
  server.detach
@@ -198,7 +198,7 @@ describe Coolio::TCPServer do
198
198
  end
199
199
  def on_read(data)
200
200
  @cb.call data
201
- size = write(data + "fff")
201
+ _size = write(data + "fff")
202
202
  end
203
203
  end
204
204
 
@@ -10,7 +10,7 @@ describe Cool.io::UNIXListener, :env => :exclude_win do
10
10
  end
11
11
 
12
12
  it "creates a new UNIXListener" do
13
- listener = Cool.io::UNIXListener.new(@tmp.path)
13
+ _listener = Cool.io::UNIXListener.new(@tmp.path)
14
14
  expect(File.socket?(@tmp.path)).to eq(true)
15
15
  end
16
16
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cool.io
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.1
4
+ version: 1.4.4
5
5
  platform: x64-mingw32
6
6
  authors:
7
7
  - Tony Arcieri
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-10-02 00:00:00.000000000 Z
12
+ date: 2016-06-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake-compiler
@@ -31,14 +31,14 @@ dependencies:
31
31
  requirements:
32
32
  - - "~>"
33
33
  - !ruby/object:Gem::Version
34
- version: 0.4.3
34
+ version: 0.5.1
35
35
  type: :development
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
39
  - - "~>"
40
40
  - !ruby/object:Gem::Version
41
- version: 0.4.3
41
+ version: 0.5.1
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: rspec
44
44
  requirement: !ruby/object:Gem::Requirement
@@ -84,6 +84,7 @@ files:
84
84
  - LICENSE
85
85
  - README.md
86
86
  - Rakefile
87
+ - appveyor.yml
87
88
  - cool.io.gemspec
88
89
  - examples/callbacked_echo_server.rb
89
90
  - examples/dslified_echo_client.rb
@@ -130,6 +131,8 @@ files:
130
131
  - lib/2.1/iobuffer_ext.so
131
132
  - lib/2.2/cool.io_ext.so
132
133
  - lib/2.2/iobuffer_ext.so
134
+ - lib/2.3/cool.io_ext.so
135
+ - lib/2.3/iobuffer_ext.so
133
136
  - lib/cool.io.rb
134
137
  - lib/cool.io/async_watcher.rb
135
138
  - lib/cool.io/custom_require.rb
@@ -175,7 +178,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
175
178
  version: '0'
176
179
  requirements: []
177
180
  rubyforge_project:
178
- rubygems_version: 2.4.8
181
+ rubygems_version: 2.5.1
179
182
  signing_key:
180
183
  specification_version: 4
181
184
  summary: A cool framework for doing high performance I/O in Ruby