nio4r 2.7.0 → 2.7.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ae8b5e59a799c0161b454b1e4dcd97becc5bdb0b835ec6becf2a3a4488b648b5
4
- data.tar.gz: e5b186044e74c4ad7c3b9846d6244dd21938b831eb415eccb63a781a4ee5dc9e
3
+ metadata.gz: 481f500a205c325391e9cac79cfb45092270fb6fe9efbf7cf871561650bb9264
4
+ data.tar.gz: 82dc2eb7b7248ae04137d1ec6716749e88426120c605e7d0092483dd82c32b8d
5
5
  SHA512:
6
- metadata.gz: c22f5d7466ede134956ab01ea87c4554ce38a950019519f0a7c4a9f16cbe81c5a338de488d885761bd49393cfd72bf20a857204db13b051d6f59f8e5bc52bc1d
7
- data.tar.gz: 27152f810d81a2f94b7428a3662e991441adb4756e24cb09753addd8d00b1a3a6ea80a2e89580eac76ab5d3328fa368cb43147ccaa9432d70e74a771ce22c863
6
+ metadata.gz: 6712ed07f626db5b0b593526a8405feab66ed93ee89086eb1079073dba1be9ad3a5bba5d67fdc7c1c99f1f000f943fd003eb4babfe856aadd5029af4cc397a90
7
+ data.tar.gz: 0432cb88797094f376d1937ce4136316c66b952b8d6abca62ea44d29656718c225644e83c6f15539d5ec6a15eee87cb6315ca14707c80c2ffed51a3d866a908e
checksums.yaml.gz.sig ADDED
Binary file
@@ -12,6 +12,10 @@ void Init_NIO_ByteBuffer();
12
12
 
13
13
  void Init_nio4r_ext()
14
14
  {
15
+ #ifdef HAVE_RB_EXT_RACTOR_SAFE
16
+ rb_ext_ractor_safe(true);
17
+ #endif
18
+
15
19
  ev_set_allocator(xrealloc);
16
20
 
17
21
  Init_NIO_Selector();
@@ -27,7 +27,7 @@ created by Upekshej
27
27
  */
28
28
  public class ByteBuffer extends RubyObject {
29
29
  private static final long serialVersionUID = -6903439483039149324L;
30
- private java.nio.ByteBuffer byteBuffer;
30
+ private transient java.nio.ByteBuffer byteBuffer;
31
31
 
32
32
  public static RaiseException newOverflowError(ThreadContext context, String message) {
33
33
  RubyClass klass = context.runtime.getModule("NIO").getClass("ByteBuffer").getClass("OverflowError");
@@ -14,9 +14,9 @@ import org.jruby.runtime.builtin.IRubyObject;
14
14
 
15
15
  public class Monitor extends RubyObject {
16
16
  private static final long serialVersionUID = -3733782997115074794L;
17
- private SelectionKey key;
17
+ private transient SelectionKey key;
18
18
  private RubyIO io;
19
- private IRubyObject interests, selector, value, closed;
19
+ private transient IRubyObject interests, selector, value, closed;
20
20
 
21
21
  public Monitor(final Ruby ruby, RubyClass rubyClass) {
22
22
  super(ruby, rubyClass);
@@ -22,7 +22,7 @@ import org.jruby.util.io.OpenFile;
22
22
 
23
23
  public class Selector extends RubyObject {
24
24
  private static final long serialVersionUID = -14562818539414873L;
25
- private java.nio.channels.Selector selector;
25
+ private transient java.nio.channels.Selector selector;
26
26
  private HashMap<SelectableChannel,SelectionKey> cancelledKeys;
27
27
  private volatile boolean wakeupFired;
28
28
 
@@ -234,7 +234,7 @@ public class Selector extends RubyObject {
234
234
 
235
235
  cancelKeys();
236
236
  try {
237
- context.getThread().beforeBlockingCall();
237
+ context.getThread().beforeBlockingCall(context);
238
238
  if(timeout.isNil()) {
239
239
  result = this.selector.select();
240
240
  } else {
data/lib/nio/version.rb CHANGED
@@ -2,9 +2,9 @@
2
2
 
3
3
  # Released under the MIT License.
4
4
  # Copyright, 2011-2018, by Tony Arcieri.
5
- # Copyright, 2018-2023, by Samuel Williams.
5
+ # Copyright, 2018-2024, by Samuel Williams.
6
6
  # Copyright, 2023, by Tsimnuj Hawj.
7
7
 
8
8
  module NIO
9
- VERSION = "2.7.0"
9
+ VERSION = "2.7.5"
10
10
  end
data/lib/nio4r.rb CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # Released under the MIT License.
2
4
  # Copyright, 2023, by Phillip Aldridge.
3
5
  # Copyright, 2023, by Samuel Williams.
data/license.md CHANGED
@@ -29,7 +29,7 @@ Copyright, 2017, by Usaku Nakamura.
29
29
  Copyright, 2017-2022, by Gregory Longtin.
30
30
  Copyright, 2017, by Lars Kanis.
31
31
  Copyright, 2017, by Tomoya Ishida.
32
- Copyright, 2018-2023, by Samuel Williams.
32
+ Copyright, 2018-2024, by Samuel Williams.
33
33
  Copyright, 2019, by Cédric Boutillier.
34
34
  Copyright, 2019-2020, by Benoit Daloze.
35
35
  Copyright, 2019, by Jesús Burgos Maciá.
@@ -45,9 +45,12 @@ Copyright, 2020-2021, by Joao Fernandes.
45
45
  Copyright, 2021, by Jun Jiang.
46
46
  Copyright, 2021, by Pavel Lobashov.
47
47
  Copyright, 2021, by Jeffrey Martin.
48
- Copyright, 2023, by Pavel Rosický.
48
+ Copyright, 2023-2024, by Pavel Rosický.
49
49
  Copyright, 2023, by Tsimnuj Hawj.
50
50
  Copyright, 2023, by Phillip Aldridge.
51
+ Copyright, 2023, by Maxime Demolin.
52
+ Copyright, 2023-2024, by Vít Ondruch.
53
+ Copyright, 2023, by Jean Boussier.
51
54
 
52
55
  Permission is hereby granted, free of charge, to any person obtaining a copy
53
56
  of this software and associated documentation files (the "Software"), to deal
data/readme.md CHANGED
@@ -1,9 +1,6 @@
1
1
  # ![nio4r](https://raw.github.com/socketry/nio4r/master/logo.png)
2
2
 
3
- [![Gem Version](https://badge.fury.io/rb/nio4r.svg)](http://rubygems.org/gems/nio4r)
4
- [![Build Status](https://github.com/socketry/nio4r/workflows/nio4r/badge.svg?branch=master&event=push)](https://github.com/socketry/nio4r/actions?query=workflow:nio4r)
5
- [![Code Climate](https://codeclimate.com/github/socketry/nio4r.svg)](https://codeclimate.com/github/socketry/nio4r)
6
- [![Yard Docs](https://img.shields.io/badge/yard-docs-blue.svg)](http://www.rubydoc.info/gems/nio4r/2.2.0)
3
+ [![Development Status](https://github.com/socketry/nio4r/workflows/Test/badge.svg)](https://github.com/socketry/nio4r/actions?workflow=Test)
7
4
 
8
5
  **New I/O for Ruby (nio4r)**: cross-platform asynchronous I/O primitives for
9
6
  scalable network clients and servers. Modeled after the Java NIO API, but
@@ -30,7 +27,6 @@ writing.
30
27
 
31
28
  ## Supported platforms
32
29
 
33
- - Ruby 2.4
34
30
  - Ruby 2.5
35
31
  - Ruby 2.6
36
32
  - Ruby 2.7
@@ -68,6 +64,10 @@ to maintain a large codebase.
68
64
 
69
65
  ## Releases
70
66
 
67
+ Bump the version first:
68
+
69
+ bundle exec bake gem:release:version:patch
70
+
71
71
  ### CRuby
72
72
 
73
73
  rake clean
@@ -1,4 +1,26 @@
1
- ## 2.6.2
1
+ # Releases
2
+
3
+ ## 2.7.4
4
+
5
+ * Fix JRuby release.
6
+ * Mark as ractor safe.
7
+
8
+ ## 2.7.3
9
+
10
+ * Improve release handling.
11
+
12
+ ## 2.7.2
13
+
14
+ * Modernize gem (list all authors, etc).
15
+ * Drop official support for Ruby 2.4.
16
+ * Fix JRuby release version.
17
+
18
+ ## 2.7.1
19
+
20
+ * Fix license specification.
21
+ * Fix JRuby build warnings.
22
+
23
+ ## 2.7.0
2
24
 
3
25
  * Convert NIO objects to TypedData API.
4
26
 
data.tar.gz.sig ADDED
@@ -0,0 +1,2 @@
1
+ �*ִ�&�w���x-���x_����3u��)
2
+ �4�~�E)24��'���Fݐ����87�����Т�G'xt5���VC[�
metadata CHANGED
@@ -1,61 +1,98 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nio4r
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.7.0
4
+ version: 2.7.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tony Arcieri
8
- autorequire:
8
+ - Samuel Williams
9
+ - Olle Jonsson
10
+ - Gregory Longtin
11
+ - Tiago Cardoso
12
+ - Joao Fernandes
13
+ - Thomas Dziedzic
14
+ - Boaz Segev
15
+ - Logan Bowers
16
+ - Pedro Paiva
17
+ - Jun Aruga
18
+ - Omer Katz
19
+ - Upekshe Jayasekera
20
+ - Tim Carey-Smith
21
+ - Benoit Daloze
22
+ - Sergey Avseyev
23
+ - Tomoya Ishida
24
+ - Usaku Nakamura
25
+ - Cédric Boutillier
26
+ - Daniel Berger
27
+ - Dirkjan Bussink
28
+ - Hiroshi Shibata
29
+ - Jesús Burgos Maciá
30
+ - Luis Lavena
31
+ - Pavel Rosický
32
+ - Sadayuki Furuhashi
33
+ - Stephen von Takach
34
+ - Vladimir Kochnev
35
+ - Vít Ondruch
36
+ - Anatol Pomozov
37
+ - Bernd Ahlers
38
+ - Charles Oliver Nutter
39
+ - Denis Washington
40
+ - Elad Eyal
41
+ - Jean byroot Boussier
42
+ - Jeffrey Martin
43
+ - John Thornton
44
+ - Jun Jiang
45
+ - Lars Kanis
46
+ - Marek Kowalcze
47
+ - Maxime Demolin
48
+ - Orien Madgwick
49
+ - Pavel Lobashov
50
+ - Per Lundberg
51
+ - Phillip Aldridge
52
+ - Ravil Bayramgalin
53
+ - Shannon Skipper
54
+ - Tao Luo
55
+ - Thomas Kuntz
56
+ - Tsimnuj Hawj
57
+ - Zhang Kang
9
58
  bindir: bin
10
- cert_chain: []
11
- date: 2023-12-01 00:00:00.000000000 Z
12
- dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: bundler
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ">="
18
- - !ruby/object:Gem::Version
19
- version: '0'
20
- type: :development
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - ">="
25
- - !ruby/object:Gem::Version
26
- version: '0'
27
- - !ruby/object:Gem::Dependency
28
- name: rake
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: '0'
34
- type: :development
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - ">="
39
- - !ruby/object:Gem::Version
40
- version: '0'
41
- description: Cross-platform asynchronous I/O primitives for scalable network clients
42
- and servers. Inspired by the Java NIO API, but simplified for ease-of-use.
43
- email:
44
- - bascule@gmail.com
59
+ cert_chain:
60
+ - |
61
+ -----BEGIN CERTIFICATE-----
62
+ MIIE2DCCA0CgAwIBAgIBATANBgkqhkiG9w0BAQsFADBhMRgwFgYDVQQDDA9zYW11
63
+ ZWwud2lsbGlhbXMxHTAbBgoJkiaJk/IsZAEZFg1vcmlvbnRyYW5zZmVyMRIwEAYK
64
+ CZImiZPyLGQBGRYCY28xEjAQBgoJkiaJk/IsZAEZFgJuejAeFw0yMjA4MDYwNDUz
65
+ MjRaFw0zMjA4MDMwNDUzMjRaMGExGDAWBgNVBAMMD3NhbXVlbC53aWxsaWFtczEd
66
+ MBsGCgmSJomT8ixkARkWDW9yaW9udHJhbnNmZXIxEjAQBgoJkiaJk/IsZAEZFgJj
67
+ bzESMBAGCgmSJomT8ixkARkWAm56MIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIB
68
+ igKCAYEAomvSopQXQ24+9DBB6I6jxRI2auu3VVb4nOjmmHq7XWM4u3HL+pni63X2
69
+ 9qZdoq9xt7H+RPbwL28LDpDNflYQXoOhoVhQ37Pjn9YDjl8/4/9xa9+NUpl9XDIW
70
+ sGkaOY0eqsQm1pEWkHJr3zn/fxoKPZPfaJOglovdxf7dgsHz67Xgd/ka+Wo1YqoE
71
+ e5AUKRwUuvaUaumAKgPH+4E4oiLXI4T1Ff5Q7xxv6yXvHuYtlMHhYfgNn8iiW8WN
72
+ XibYXPNP7NtieSQqwR/xM6IRSoyXKuS+ZNGDPUUGk8RoiV/xvVN4LrVm9upSc0ss
73
+ RZ6qwOQmXCo/lLcDUxJAgG95cPw//sI00tZan75VgsGzSWAOdjQpFM0l4dxvKwHn
74
+ tUeT3ZsAgt0JnGqNm2Bkz81kG4A2hSyFZTFA8vZGhp+hz+8Q573tAR89y9YJBdYM
75
+ zp0FM4zwMNEUwgfRzv1tEVVUEXmoFCyhzonUUw4nE4CFu/sE3ffhjKcXcY//qiSW
76
+ xm4erY3XAgMBAAGjgZowgZcwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAwHQYDVR0O
77
+ BBYEFO9t7XWuFf2SKLmuijgqR4sGDlRsMC4GA1UdEQQnMCWBI3NhbXVlbC53aWxs
78
+ aWFtc0BvcmlvbnRyYW5zZmVyLmNvLm56MC4GA1UdEgQnMCWBI3NhbXVlbC53aWxs
79
+ aWFtc0BvcmlvbnRyYW5zZmVyLmNvLm56MA0GCSqGSIb3DQEBCwUAA4IBgQB5sxkE
80
+ cBsSYwK6fYpM+hA5B5yZY2+L0Z+27jF1pWGgbhPH8/FjjBLVn+VFok3CDpRqwXCl
81
+ xCO40JEkKdznNy2avOMra6PFiQyOE74kCtv7P+Fdc+FhgqI5lMon6tt9rNeXmnW/
82
+ c1NaMRdxy999hmRGzUSFjozcCwxpy/LwabxtdXwXgSay4mQ32EDjqR1TixS1+smp
83
+ 8C/NCWgpIfzpHGJsjvmH2wAfKtTTqB9CVKLCWEnCHyCaRVuKkrKjqhYCdmMBqCws
84
+ JkxfQWC+jBVeG9ZtPhQgZpfhvh+6hMhraUYRQ6XGyvBqEUe+yo6DKIT3MtGE2+CP
85
+ eX9i9ZWBydWb8/rvmwmX2kkcBbX0hZS1rcR593hGc61JR6lvkGYQ2MYskBveyaxt
86
+ Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
87
+ voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
88
+ -----END CERTIFICATE-----
89
+ date: 1980-01-02 00:00:00.000000000 Z
90
+ dependencies: []
45
91
  executables: []
46
92
  extensions:
47
93
  - ext/nio4r/extconf.rb
48
94
  extra_rdoc_files: []
49
95
  files:
50
- - ".github/workflows/workflow.yml"
51
- - ".gitignore"
52
- - ".mailmap"
53
- - ".rspec"
54
- - ".rubocop.yml"
55
- - Gemfile
56
- - Rakefile
57
- - changes.md
58
- - examples/echo_server.rb
59
96
  - ext/libev/Changes
60
97
  - ext/libev/LICENSE
61
98
  - ext/libev/README
@@ -90,33 +127,19 @@ files:
90
127
  - lib/nio/version.rb
91
128
  - lib/nio4r.rb
92
129
  - license.md
93
- - logo.png
94
- - nio4r.gemspec
95
- - rakelib/extension.rake
96
- - rakelib/rspec.rake
97
- - rakelib/rubocop.rake
98
130
  - readme.md
99
- - spec/nio/acceptables_spec.rb
100
- - spec/nio/bytebuffer_spec.rb
101
- - spec/nio/monitor_spec.rb
102
- - spec/nio/selectables/pipe_spec.rb
103
- - spec/nio/selectables/ssl_socket_spec.rb
104
- - spec/nio/selectables/tcp_socket_spec.rb
105
- - spec/nio/selectables/udp_socket_spec.rb
106
- - spec/nio/selector_spec.rb
107
- - spec/spec_helper.rb
108
- - spec/support/selectable_examples.rb
131
+ - releases.md
109
132
  homepage: https://github.com/socketry/nio4r
110
133
  licenses:
111
- - MIT AND (BSD-2-Clause OR GPL-2.0-or-later)
134
+ - MIT
135
+ - BSD-2-Clause
112
136
  metadata:
113
137
  bug_tracker_uri: https://github.com/socketry/nio4r/issues
114
- changelog_uri: https://github.com/socketry/nio4r/blob/main/changes.md
115
- documentation_uri: https://www.rubydoc.info/gems/nio4r/2.6.1
116
- source_code_uri: https://github.com/socketry/nio4r/tree/v2.6.1
117
- wiki_uri: https://github.com/socketry/nio4r/wiki
138
+ changelog_uri: https://github.com/socketry/nio4r/blob/main/releases.md
139
+ documentation_uri: https://www.rubydoc.info/gems/nio4r
118
140
  funding_uri: https://github.com/sponsors/ioquatix/
119
- post_install_message:
141
+ source_code_uri: https://github.com/socketry/nio4r.git
142
+ wiki_uri: https://github.com/socketry/nio4r/wiki
120
143
  rdoc_options: []
121
144
  require_paths:
122
145
  - lib
@@ -124,25 +147,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
124
147
  requirements:
125
148
  - - ">="
126
149
  - !ruby/object:Gem::Version
127
- version: '2.4'
150
+ version: '2.6'
128
151
  required_rubygems_version: !ruby/object:Gem::Requirement
129
152
  requirements:
130
153
  - - ">="
131
154
  - !ruby/object:Gem::Version
132
155
  version: '0'
133
156
  requirements: []
134
- rubygems_version: 3.4.22
135
- signing_key:
157
+ rubygems_version: 3.7.2
136
158
  specification_version: 4
137
159
  summary: New IO for Ruby
138
- test_files:
139
- - spec/nio/acceptables_spec.rb
140
- - spec/nio/bytebuffer_spec.rb
141
- - spec/nio/monitor_spec.rb
142
- - spec/nio/selectables/pipe_spec.rb
143
- - spec/nio/selectables/ssl_socket_spec.rb
144
- - spec/nio/selectables/tcp_socket_spec.rb
145
- - spec/nio/selectables/udp_socket_spec.rb
146
- - spec/nio/selector_spec.rb
147
- - spec/spec_helper.rb
148
- - spec/support/selectable_examples.rb
160
+ test_files: []
metadata.gz.sig ADDED
Binary file
@@ -1,61 +0,0 @@
1
- name: nio4r
2
-
3
- on: [push, pull_request]
4
-
5
- jobs:
6
- build:
7
- name: >-
8
- ${{matrix.os}}, ${{matrix.ruby}}
9
- env:
10
- CI: true
11
- TESTOPTS: -v
12
-
13
- runs-on: ${{matrix.os}}
14
- strategy:
15
- fail-fast: false
16
- matrix:
17
- os:
18
- - ubuntu-22.04
19
- - macos-11
20
- - windows-2022
21
- ruby:
22
- - "2.4"
23
- - "2.5"
24
- - "2.6"
25
- - "2.7"
26
- - "3.0"
27
- - "3.1"
28
- - "3.2"
29
- - "head"
30
- - "jruby"
31
- - "truffleruby"
32
- include:
33
- - {os: ubuntu-20.04, ruby: "3.2"}
34
- - {os: windows-2019, ruby: "3.2"}
35
- - {os: windows-2022, ruby: ucrt}
36
- exclude:
37
- - {os: windows-2022, ruby: head}
38
- - {os: windows-2022, ruby: jruby}
39
- - {os: windows-2022, ruby: truffleruby}
40
-
41
- steps:
42
- - uses: actions/checkout@v3
43
-
44
- - name: set JAVA_HOME
45
- if: |
46
- startsWith(matrix.ruby, 'jruby')
47
- shell: bash
48
- run: |
49
- echo JAVA_HOME=$JAVA_HOME_11_X64 >> $GITHUB_ENV
50
-
51
- - uses: ruby/setup-ruby@v1
52
- with:
53
- ruby-version: ${{matrix.ruby}}
54
- bundler-cache: true
55
-
56
- - name: Compile
57
- run: bundle exec rake compile
58
-
59
- - name: Test
60
- run: bundle exec rake spec
61
- timeout-minutes: 10
data/.gitignore DELETED
@@ -1,21 +0,0 @@
1
- *.gem
2
- *.rbc
3
- .bundle
4
- .config
5
- .yardoc
6
- Gemfile.lock
7
- InstalledFiles
8
- _yardoc
9
- coverage
10
- doc/
11
- lib/bundler/man
12
- pkg
13
- rdoc
14
- spec/reports
15
- test/tmp
16
- test/version_tmp
17
- tmp
18
- lib/nio4r_ext.*
19
- ext/**/*.o
20
- ext/**/nio4r_ext.*
21
- .rspec_status
data/.mailmap DELETED
@@ -1,16 +0,0 @@
1
- Sadayuki Furuhashi <frsyuki@users.sourceforge.jp>
2
- Shannon Skipper <shannonskipper@gmail.com>
3
- Anatol Pomozov <anatol.pomozov@gmail.com>
4
- Hiroshi Shibata <shibata.hiroshi@gmail.com>
5
- John Thornton <ubergeek3141@gmail.com>
6
- Upekshe Jayasekera <usmj000@gmail.com>
7
- Upekshe Jayasekera <upekshej.11@cse.mrt.ac.lk>
8
- Usaku Nakamura <usa@garbagecollect.jp>
9
- Tomoya Ishida <tomoyapenguin@gmail.com>
10
- Tiago Cardoso <cardoso_tiago@hotmail.com>
11
- Ravil Bayramgalin <brainopia@evilmartians.com>
12
- Gregory Longtin <Greg.mpls@gmail.com>
13
- Gregory Longtin <Greg.mpls@gmail.com> <MSP-Greg@users.noreply.github.com>
14
- Elad Eyal <elad.eyal@intel.com>
15
- Boaz Segev <bo@bowild.com>
16
- Tao Luo <luotao.ruby@gmail.com>
data/.rspec DELETED
@@ -1,4 +0,0 @@
1
- --color
2
- --format documentation
3
- --order random
4
- --warnings
data/.rubocop.yml DELETED
@@ -1,100 +0,0 @@
1
- AllCops:
2
- TargetRubyVersion: 2.4
3
- DisplayCopNames: true
4
-
5
- Layout/HashAlignment:
6
- Enabled: false
7
-
8
- Layout/LineLength:
9
- Max: 128
10
-
11
- Layout/SpaceAroundMethodCallOperator:
12
- Enabled: false
13
-
14
- Layout/SpaceInsideBlockBraces:
15
- Enabled: false
16
-
17
- Style/IfUnlessModifier:
18
- Enabled: false
19
-
20
- Style/UnpackFirst:
21
- Enabled: false
22
-
23
- #
24
- # Lint
25
- #
26
-
27
- Lint/SuppressedException:
28
- Enabled: false
29
-
30
- Lint/Loop:
31
- Enabled: false
32
-
33
- Lint/RaiseException:
34
- Enabled: false
35
-
36
- Lint/StructNewOverride:
37
- Enabled: false
38
- #
39
- # Metrics
40
- #
41
-
42
- Metrics/AbcSize:
43
- Max: 35
44
-
45
- Metrics/BlockLength:
46
- Max: 128
47
- Enabled: false
48
-
49
- Metrics/ClassLength:
50
- Max: 128
51
-
52
- Metrics/MethodLength:
53
- CountComments: false
54
- Max: 50
55
-
56
- Metrics/CyclomaticComplexity:
57
- Max: 15
58
-
59
- Metrics/PerceivedComplexity:
60
- Max: 15
61
-
62
- #
63
- # Style
64
- #
65
-
66
- Style/ExponentialNotation:
67
- Enabled: false
68
-
69
- Style/FormatStringToken:
70
- Enabled: false
71
-
72
- Style/FrozenStringLiteralComment:
73
- Enabled: true
74
-
75
- Style/GlobalVars:
76
- Enabled: false
77
-
78
- Style/HashEachMethods:
79
- Enabled: false
80
-
81
- Style/HashTransformKeys:
82
- Enabled: false
83
-
84
- Style/HashTransformValues:
85
- Enabled: false
86
-
87
- Style/NumericPredicate:
88
- Enabled: false
89
-
90
- Style/RescueModifier:
91
- Enabled: false
92
-
93
- Style/SafeNavigation:
94
- Enabled: false
95
-
96
- Style/StringLiterals:
97
- EnforcedStyle: double_quotes
98
-
99
- Style/TrivialAccessors:
100
- Enabled: false
data/Gemfile DELETED
@@ -1,19 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source "https://rubygems.org"
4
-
5
- gemspec
6
-
7
- gem "jruby-openssl" if defined? JRUBY_VERSION
8
-
9
- group :maintenance, optional: true do
10
- gem "bake"
11
- gem "bake-gem"
12
- # gem "bake-modernize"
13
- end
14
-
15
- group :development, :test do
16
- gem "rake-compiler", "~> 1.1.9", require: false
17
- gem "rspec", "~> 3.7", require: false
18
- gem "rubocop", "0.82.0", require: false
19
- end
data/Rakefile DELETED
@@ -1,8 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "bundler/gem_tasks"
4
- require "rake/clean"
5
-
6
- task default: %w[compile spec rubocop]
7
-
8
- CLEAN.include "**/*.o", "**/*.so", "**/*.bundle", "**/*.jar", "pkg", "tmp"
@@ -1,54 +0,0 @@
1
- #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
-
4
- # Released under the MIT License.
5
- # Copyright, 2012-2016, by Tony Arcieri.
6
- # Copyright, 2016, by Jun Aruga.
7
- # Copyright, 2019, by Zhang Kang.
8
- # Copyright, 2020, by Thomas Dziedzic.
9
- # Copyright, 2023, by Samuel Williams.
10
-
11
- $LOAD_PATH.push File.expand_path("../lib", __dir__)
12
- require "nio"
13
- require "socket"
14
-
15
- # Echo server example written with nio4r
16
- class EchoServer
17
- def initialize(host, port)
18
- @selector = NIO::Selector.new
19
-
20
- puts "Listening on #{host}:#{port}"
21
- @server = TCPServer.new(host, port)
22
-
23
- monitor = @selector.register(@server, :r)
24
- monitor.value = proc { accept }
25
- end
26
-
27
- def run
28
- loop do
29
- @selector.select { |monitor| monitor.value.call }
30
- end
31
- end
32
-
33
- def accept
34
- socket = @server.accept
35
- _, port, host = socket.peeraddr
36
- puts "*** #{host}:#{port} connected"
37
-
38
- monitor = @selector.register(socket, :r)
39
- monitor.value = proc { read(socket) }
40
- end
41
-
42
- def read(socket)
43
- data = socket.read_nonblock(4096)
44
- socket.write_nonblock(data)
45
- rescue EOFError
46
- _, port, host = socket.peeraddr
47
- puts "*** #{host}:#{port} disconnected"
48
-
49
- @selector.deregister(socket)
50
- socket.close
51
- end
52
- end
53
-
54
- EchoServer.new("localhost", 1234).run if $PROGRAM_NAME == __FILE__
data/logo.png DELETED
Binary file