cool.io 1.6.0-x64-mingw32 → 1.7.1-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
  SHA256:
3
- metadata.gz: 4c1b9012c47c37d53a30abd51c998b27040412940e4fa0ecdc74c947abcb6939
4
- data.tar.gz: 83a069e4957a3d23b2fdad165c37462cb9d6f7364bc96e62c3e0426810aaf373
3
+ metadata.gz: b5e1a160cb7e3699f7f8b1ce5500b82d36eb4669d5706ce9796b247a580bc416
4
+ data.tar.gz: e27152d9bab4b2de877bffba60c334cc4bfe9e495ddd8ac128e2b8236dfde78a
5
5
  SHA512:
6
- metadata.gz: d2bfb75eddbeac6ea9ccc6a8ed1edb8704af3b21ac8b488e23a1d4993a1d8d47c08a1c2d54162a183e9427ad70bebb3e9dace2b778a678f8a441a959e877890f
7
- data.tar.gz: 24758ff818c65972919f52bd7e1ae91c038a6c57106f66a24bb950508073ea0bc17eb5383ed7686d2241dade675bad2fd53240079ebd33d8709712f4ad0d36ce
6
+ metadata.gz: 6fa1b5794b29a7fa1a1ffa503376b15ec24be3369a3101685fd48de6d514a29dbc687e67235d45a25ec1a7a71f8efe4a99a0d14503af39d7c5aceb941b2f2cda
7
+ data.tar.gz: 3fc94a1d9e9b222340b0ba8ea53fa9cd36467737a8d7c0c1945ff2eb97061462d79522198b0295024f2d5836d9f1168b98782f339c5ee419511349443ee4727b
data/.travis.yml CHANGED
@@ -3,12 +3,10 @@ language: ruby
3
3
  sudo: false
4
4
 
5
5
  rvm:
6
- - 1.9.3
7
- - 2.0
8
- - 2.1
9
- - 2.2
10
- - 2.3.0
11
- - 2.4.1
6
+ - 2.4.10
7
+ - 2.5
8
+ - 2.6
9
+ - 2.7
12
10
  - ruby-head
13
11
  - rbx
14
12
 
data/CHANGES.md CHANGED
@@ -1,3 +1,18 @@
1
+ 1.7.1
2
+ -----
3
+
4
+ * Set fallback local loopback address by default for Windows environment
5
+
6
+ 1.7.0
7
+ -----
8
+
9
+ * Fix extension build failure for ruby3
10
+
11
+ 1.6.1
12
+ -----
13
+
14
+ * Fix warning for recent compilers
15
+
1
16
  1.6.0
2
17
  -----
3
18
 
data/cool.io.gemspec CHANGED
@@ -11,6 +11,7 @@ Gem::Specification.new do |s|
11
11
  s.summary = "A cool framework for doing high performance I/O in Ruby"
12
12
  s.description = "Cool.io provides a high performance event framework for Ruby which uses the libev C library"
13
13
  s.extensions = ["ext/cool.io/extconf.rb", "ext/iobuffer/extconf.rb"]
14
+ s.licenses = ["MIT"]
14
15
 
15
16
  s.files = `git ls-files`.split("\n")
16
17
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
@@ -8,7 +8,11 @@
8
8
  #define COOLIO_H
9
9
 
10
10
  #include "ruby.h"
11
+ #if defined(HAVE_RUBY_IO_H)
12
+ #include "ruby/io.h"
13
+ #else
11
14
  #include "rubyio.h"
15
+ #endif
12
16
 
13
17
  #ifdef GetReadFile
14
18
  #define FPTR_TO_FD(fptr) (fileno(GetReadFile(fptr)))
@@ -56,4 +60,11 @@ struct Coolio_Watcher
56
60
 
57
61
  void Coolio_Loop_process_event(VALUE watcher, int revents);
58
62
 
63
+ void Init_coolio_loop();
64
+ void Init_coolio_watcher();
65
+ void Init_coolio_iowatcher();
66
+ void Init_coolio_timer_watcher();
67
+ void Init_coolio_stat_watcher();
68
+ void Init_coolio_utils();
69
+
59
70
  #endif
@@ -10,6 +10,14 @@ have_func('rb_thread_alone')
10
10
  have_func('rb_str_set_len')
11
11
  have_library('rt', 'clock_gettime')
12
12
 
13
+ if have_header('ruby/io.h')
14
+ $defs << '-DHAVE_RUBY_IO_H'
15
+ end
16
+
17
+ if have_header('ruby/thread.h')
18
+ $defs << '-DHAVE_RUBY_THREAD_H'
19
+ end
20
+
13
21
  if have_header('sys/select.h')
14
22
  $defs << '-DEV_USE_SELECT'
15
23
  end
@@ -5,7 +5,11 @@
5
5
  */
6
6
 
7
7
  #include "ruby.h"
8
+ #if defined(HAVE_RUBY_IO_H)
9
+ #include "ruby/io.h"
10
+ #else
8
11
  #include "rubyio.h"
12
+ #endif
9
13
 
10
14
  #include "ev_wrap.h"
11
15
 
data/ext/cool.io/loop.c CHANGED
@@ -6,7 +6,6 @@
6
6
 
7
7
  #include <assert.h>
8
8
  #include "ruby.h"
9
- #include "rubysig.h"
10
9
  #include "ev_wrap.h"
11
10
 
12
11
  #include "cool.io.h"
data/ext/cool.io/utils.c CHANGED
@@ -15,6 +15,11 @@
15
15
  #include <sys/sysctl.h>
16
16
  #endif
17
17
 
18
+ #ifdef HAVE_SYSCTLBYNAME
19
+ #include <sys/sysctl.h>
20
+ #include <sys/types.h>
21
+ #endif
22
+
18
23
  static VALUE mCoolio = Qnil;
19
24
  static VALUE cCoolio_Utils = Qnil;
20
25
 
@@ -2,8 +2,8 @@ require 'mkmf'
2
2
 
3
3
  dir_config("iobuffer")
4
4
  have_library("c", "main")
5
- if have_macro("HAVE_RB_IO_T", "rubyio.h")
6
- have_struct_member("rb_io_t", "fd", "rubyio.h")
5
+ if have_macro("HAVE_RB_IO_T", "ruby/io.h")
6
+ have_struct_member("rb_io_t", "fd", "ruby/io.h")
7
7
  end
8
8
 
9
9
  create_makefile("iobuffer_ext")
data/ext/libev/ev.c CHANGED
@@ -39,6 +39,9 @@
39
39
 
40
40
  /* ########## COOLIO PATCHERY HO! ########## */
41
41
  #include "ruby.h"
42
+ #if defined(HAVE_RUBY_THREAD_H)
43
+ #include "ruby/thread.h"
44
+ #endif
42
45
  /* ######################################## */
43
46
 
44
47
  /* this big block deduces configuration from config.h */
@@ -49,6 +49,15 @@ module Coolio
49
49
  entries.each { |e| hosts[e] ||= addr }
50
50
  end
51
51
  end
52
+ if hosts.empty?
53
+ # On Windows, there is a case that hosts file doesn't have entry by default
54
+ # and preferred IPv4/IPv6 behavior may be changed by registry key [1], so
55
+ # "localhost" should be resolved by getaddrinfo.
56
+ # (first[3] means preferred resolved IP address ::1 or 127.0.0.1)
57
+ # [1] https://docs.microsoft.com/en-us/troubleshoot/windows-server/networking/configure-ipv6-in-windows
58
+ require "socket"
59
+ hosts["localhost"] = ::Socket.getaddrinfo("localhost", nil).first[3]
60
+ end
52
61
 
53
62
  hosts[host]
54
63
  end
@@ -1,5 +1,5 @@
1
1
  module Coolio
2
- VERSION = "1.6.0"
2
+ VERSION = "1.7.1"
3
3
 
4
4
  def self.version
5
5
  VERSION
data/spec/dns_spec.rb CHANGED
@@ -19,6 +19,7 @@ end
19
19
  describe "DNS" do
20
20
  before :each do
21
21
  @loop = Cool.io::Loop.new
22
+ @preferred_localhost_address = ::Socket.getaddrinfo("localhost", nil).first[3]
22
23
  end
23
24
 
24
25
  it "connects to valid domains" do
@@ -40,4 +41,10 @@ describe "DNS" do
40
41
  @loop.run
41
42
  end.to raise_error(WontResolve)
42
43
  end
44
+
45
+ it "resolve localhost even though hosts is empty" do
46
+ Tempfile.open("empty") do |file|
47
+ expect( Coolio::DNSResolver.hosts("localhost", file.path)).to eq @preferred_localhost_address
48
+ end
49
+ end
43
50
  end
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.6.0
4
+ version: 1.7.1
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: 2020-01-24 00:00:00.000000000 Z
12
+ date: 2021-02-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake-compiler
@@ -160,7 +160,8 @@ files:
160
160
  - spec/unix_listener_spec.rb
161
161
  - spec/unix_server_spec.rb
162
162
  homepage: http://coolio.github.com
163
- licenses: []
163
+ licenses:
164
+ - MIT
164
165
  metadata: {}
165
166
  post_install_message:
166
167
  rdoc_options: []