nio4r 2.5.2 → 2.5.9

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.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/workflow.yml +61 -0
  3. data/.rubocop.yml +30 -11
  4. data/CHANGES.md +60 -1
  5. data/Gemfile +2 -4
  6. data/README.md +7 -58
  7. data/examples/echo_server.rb +2 -2
  8. data/ext/libev/Changes +71 -2
  9. data/ext/libev/ev.c +611 -198
  10. data/ext/libev/ev.h +25 -22
  11. data/ext/libev/ev_epoll.c +16 -14
  12. data/ext/libev/ev_iouring.c +694 -0
  13. data/ext/libev/ev_kqueue.c +4 -4
  14. data/ext/libev/ev_linuxaio.c +78 -100
  15. data/ext/libev/ev_poll.c +6 -6
  16. data/ext/libev/ev_port.c +3 -3
  17. data/ext/libev/ev_select.c +6 -6
  18. data/ext/libev/ev_vars.h +34 -0
  19. data/ext/libev/ev_win32.c +2 -2
  20. data/ext/libev/ev_wrap.h +56 -0
  21. data/ext/nio4r/.clang-format +16 -0
  22. data/ext/nio4r/bytebuffer.c +27 -28
  23. data/ext/nio4r/extconf.rb +11 -0
  24. data/ext/nio4r/libev.h +1 -3
  25. data/ext/nio4r/monitor.c +34 -31
  26. data/ext/nio4r/nio4r.h +7 -12
  27. data/ext/nio4r/nio4r_ext.c +1 -1
  28. data/ext/nio4r/org/nio4r/ByteBuffer.java +2 -0
  29. data/ext/nio4r/org/nio4r/Monitor.java +1 -0
  30. data/ext/nio4r/org/nio4r/Selector.java +8 -10
  31. data/ext/nio4r/selector.c +89 -75
  32. data/lib/nio/bytebuffer.rb +4 -0
  33. data/lib/nio/monitor.rb +1 -1
  34. data/lib/nio/selector.rb +12 -10
  35. data/lib/nio/version.rb +1 -1
  36. data/lib/nio.rb +20 -1
  37. data/license.md +66 -0
  38. data/nio4r.gemspec +2 -2
  39. data/rakelib/extension.rake +1 -2
  40. data/spec/nio/bytebuffer_spec.rb +0 -1
  41. data/spec/nio/selectables/udp_socket_spec.rb +2 -2
  42. data/spec/nio/selector_spec.rb +4 -1
  43. data/spec/spec_helper.rb +2 -3
  44. metadata +13 -12
  45. data/.travis.yml +0 -44
  46. data/Guardfile +0 -10
  47. data/appveyor.yml +0 -40
@@ -33,8 +33,8 @@ RSpec.describe UDPSocket, if: !defined?(JRUBY_VERSION) do
33
33
  peer.send("X" * 1024, 0)
34
34
  cntr += 1
35
35
  t = select [], [peer], [], 0
36
- rescue Errno::ECONNREFUSED => ex
37
- skip "Couldn't make writable UDPSocket subject: #{ex.class}: #{ex}"
36
+ rescue Errno::ECONNREFUSED => e
37
+ skip "Couldn't make writable UDPSocket subject: #{e.class}: #{e}"
38
38
  end while t && t[1].include?(peer) && cntr < 5
39
39
 
40
40
  peer
@@ -24,6 +24,10 @@ RSpec.describe NIO::Selector do
24
24
  example.reporter.message "Supported backends: #{described_class.backends}"
25
25
  end
26
26
 
27
+ it "automatically selects a backend if none or nil is specified" do
28
+ expect(described_class.new.backend).to eq described_class.new(nil).backend
29
+ end
30
+
27
31
  it "raises ArgumentError if given an invalid backend" do
28
32
  expect { described_class.new(:derp) }.to raise_error ArgumentError
29
33
  end
@@ -234,4 +238,3 @@ RSpec.describe NIO::Selector do
234
238
  expect(subject).to be_closed
235
239
  end
236
240
  end
237
- # rubocop:enable Metrics/BlockLength
data/spec/spec_helper.rb CHANGED
@@ -1,8 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "coveralls"
4
- Coveralls.wear!
5
-
6
3
  require "nio"
7
4
  require "support/selectable_examples"
8
5
 
@@ -12,6 +9,8 @@ RSpec.configure do |config|
12
9
  # Enable flags like --only-failures and --next-failure
13
10
  config.example_status_persistence_file_path = ".rspec_status"
14
11
 
12
+ config.filter_run_when_matching :focus
13
+
15
14
  config.expect_with :rspec do |c|
16
15
  c.syntax = :expect
17
16
  end
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: 2.5.2
4
+ version: 2.5.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tony Arcieri
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-09-24 00:00:00.000000000 Z
11
+ date: 2023-04-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -47,16 +47,14 @@ extensions:
47
47
  - ext/nio4r/extconf.rb
48
48
  extra_rdoc_files: []
49
49
  files:
50
+ - ".github/workflows/workflow.yml"
50
51
  - ".gitignore"
51
52
  - ".rspec"
52
53
  - ".rubocop.yml"
53
- - ".travis.yml"
54
54
  - CHANGES.md
55
55
  - Gemfile
56
- - Guardfile
57
56
  - README.md
58
57
  - Rakefile
59
- - appveyor.yml
60
58
  - examples/echo_server.rb
61
59
  - ext/libev/Changes
62
60
  - ext/libev/LICENSE
@@ -64,6 +62,7 @@ files:
64
62
  - ext/libev/ev.c
65
63
  - ext/libev/ev.h
66
64
  - ext/libev/ev_epoll.c
65
+ - ext/libev/ev_iouring.c
67
66
  - ext/libev/ev_kqueue.c
68
67
  - ext/libev/ev_linuxaio.c
69
68
  - ext/libev/ev_poll.c
@@ -72,6 +71,7 @@ files:
72
71
  - ext/libev/ev_vars.h
73
72
  - ext/libev/ev_win32.c
74
73
  - ext/libev/ev_wrap.h
74
+ - ext/nio4r/.clang-format
75
75
  - ext/nio4r/bytebuffer.c
76
76
  - ext/nio4r/extconf.rb
77
77
  - ext/nio4r/libev.h
@@ -88,6 +88,7 @@ files:
88
88
  - lib/nio/monitor.rb
89
89
  - lib/nio/selector.rb
90
90
  - lib/nio/version.rb
91
+ - license.md
91
92
  - logo.png
92
93
  - nio4r.gemspec
93
94
  - rakelib/extension.rake
@@ -109,10 +110,10 @@ licenses:
109
110
  metadata:
110
111
  bug_tracker_uri: https://github.com/socketry/nio4r/issues
111
112
  changelog_uri: https://github.com/socketry/nio4r/blob/master/CHANGES.md
112
- documentation_uri: https://www.rubydoc.info/gems/nio4r/2.5.2
113
- source_code_uri: https://github.com/socketry/nio4r/tree/v2.5.2
113
+ documentation_uri: https://www.rubydoc.info/gems/nio4r/2.5.9
114
+ source_code_uri: https://github.com/socketry/nio4r/tree/v2.5.9
114
115
  wiki_uri: https://github.com/socketry/nio4r/wiki
115
- post_install_message:
116
+ post_install_message:
116
117
  rdoc_options: []
117
118
  require_paths:
118
119
  - lib
@@ -120,15 +121,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
120
121
  requirements:
121
122
  - - ">="
122
123
  - !ruby/object:Gem::Version
123
- version: '2.3'
124
+ version: '2.4'
124
125
  required_rubygems_version: !ruby/object:Gem::Requirement
125
126
  requirements:
126
127
  - - ">="
127
128
  - !ruby/object:Gem::Version
128
129
  version: '0'
129
130
  requirements: []
130
- rubygems_version: 3.0.4
131
- signing_key:
131
+ rubygems_version: 3.4.6
132
+ signing_key:
132
133
  specification_version: 4
133
134
  summary: New IO for Ruby
134
135
  test_files:
data/.travis.yml DELETED
@@ -1,44 +0,0 @@
1
- language: ruby
2
- cache: bundler
3
- dist: xenial
4
- env: OS="xenial 16.04"
5
- bundler_args: --without development
6
-
7
- after_script:
8
- - ruby -ropenssl -e "puts ENV['OS'], RUBY_DESCRIPTION, OpenSSL::OPENSSL_LIBRARY_VERSION"
9
-
10
- matrix:
11
- fast_finish: true
12
- include:
13
- - rvm: 2.3
14
- - rvm: 2.4
15
- - rvm: 2.5
16
- - rvm: 2.6
17
- env: NIO4R_PURE=true
18
- - rvm: 2.6
19
- - rvm: 2.3
20
- dist: trusty
21
- env: OS="trusty 14.04"
22
- - rvm: 2.6.3
23
- dist: bionic
24
- env: OS="bionic 18.04"
25
- - rvm: 2.6
26
- os: osx
27
- env: OS="osx"
28
- - rvm: 2.4.6
29
- os: osx
30
- osx_image: xcode10.2
31
- env: OS="osx xcode 10.2"
32
- - rvm: truffleruby
33
- - rvm: truffleruby
34
- env: NIO4R_PURE=true
35
- - rvm: jruby
36
- env: JRUBY_OPTS="--debug -X+O --dev -J-Djruby.launch.inproc=true -J-Xmx1024M"
37
- - rvm: jruby-head
38
- env: JRUBY_OPTS="--debug -X+O --dev -J-Djruby.launch.inproc=true -J-Xmx1024M"
39
- - rvm: ruby-head
40
- allow_failures:
41
- - rvm: ruby-head
42
- - rvm: truffleruby
43
- - rvm: jruby-head
44
- - rvm: jruby
data/Guardfile DELETED
@@ -1,10 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- directories %w[lib spec]
4
- clearing :on
5
-
6
- guard :rspec, cmd: "bundle exec rspec" do
7
- watch(%r{^spec/.+_spec\.rb$})
8
- watch(%r{^lib/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
9
- watch("spec/spec_helper.rb") { "spec" }
10
- end
data/appveyor.yml DELETED
@@ -1,40 +0,0 @@
1
- build: off
2
- deploy: off
3
-
4
- environment:
5
- PATH: C:\Ruby%RUBY_VERSION%\bin;%PATH%
6
- APPVEYOR_SAVE_CACHE_ON_ERROR: True
7
- matrix:
8
- - RUBY_VERSION: _trunk
9
- - RUBY_VERSION: 26-x64
10
- - RUBY_VERSION: 25-x64
11
- - RUBY_VERSION: 24-x64
12
- - RUBY_VERSION: 23-x64
13
- - RUBY_VERSION: 23
14
-
15
- init:
16
- - ps: |
17
- if ($env:RUBY_VERSION -eq '_trunk') {
18
- $trunk_uri = 'https://ci.appveyor.com/api/projects/MSP-Greg/ruby-loco/artifacts/ruby_trunk.7z'
19
- (New-Object Net.WebClient).DownloadFile($trunk_uri, 'C:\ruby_trunk.7z')
20
- 7z.exe x C:\ruby_trunk.7z -oC:\Ruby_trunk
21
- }
22
-
23
- install:
24
- - SET RAKEOPT=-rdevkit
25
- - gem update --system --conservative --no-document
26
- - ruby -v
27
- - gem -v
28
- - bundle -v
29
- - bundle install --path vendor\bundle --without development
30
-
31
- test_script:
32
- - bundle exec rake spec
33
-
34
- matrix:
35
- allow_failures:
36
- - RUBY_VERSION: _trunk
37
-
38
- cache:
39
- # If one of the files after the right arrow changes, cache will be invalidated
40
- - vendor\bundle -> appveyor.yml, Gemfile, nio4r.gemspec