cool.io 1.6.0-x64-mingw32 → 1.7.1-x64-mingw32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +4 -6
- data/CHANGES.md +15 -0
- data/cool.io.gemspec +1 -0
- data/ext/cool.io/cool.io.h +11 -0
- data/ext/cool.io/extconf.rb +8 -0
- data/ext/cool.io/iowatcher.c +4 -0
- data/ext/cool.io/loop.c +0 -1
- data/ext/cool.io/utils.c +5 -0
- data/ext/iobuffer/extconf.rb +2 -2
- data/ext/libev/ev.c +3 -0
- data/lib/cool.io/dns_resolver.rb +9 -0
- data/lib/cool.io/version.rb +1 -1
- data/spec/dns_spec.rb +7 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b5e1a160cb7e3699f7f8b1ce5500b82d36eb4669d5706ce9796b247a580bc416
|
4
|
+
data.tar.gz: e27152d9bab4b2de877bffba60c334cc4bfe9e495ddd8ac128e2b8236dfde78a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6fa1b5794b29a7fa1a1ffa503376b15ec24be3369a3101685fd48de6d514a29dbc687e67235d45a25ec1a7a71f8efe4a99a0d14503af39d7c5aceb941b2f2cda
|
7
|
+
data.tar.gz: 3fc94a1d9e9b222340b0ba8ea53fa9cd36467737a8d7c0c1945ff2eb97061462d79522198b0295024f2d5836d9f1168b98782f339c5ee419511349443ee4727b
|
data/.travis.yml
CHANGED
data/CHANGES.md
CHANGED
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")
|
data/ext/cool.io/cool.io.h
CHANGED
@@ -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
|
data/ext/cool.io/extconf.rb
CHANGED
@@ -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
|
data/ext/cool.io/iowatcher.c
CHANGED
data/ext/cool.io/loop.c
CHANGED
data/ext/cool.io/utils.c
CHANGED
data/ext/iobuffer/extconf.rb
CHANGED
@@ -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", "
|
6
|
-
have_struct_member("rb_io_t", "fd", "
|
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 */
|
data/lib/cool.io/dns_resolver.rb
CHANGED
@@ -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
|
data/lib/cool.io/version.rb
CHANGED
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.
|
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:
|
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: []
|