nio4r 2.7.1 → 2.7.2

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: 54febf2b0d954eb8270ca97cd81e552f3c8ef975b4abb2d8265dcc6151df725f
4
- data.tar.gz: 655358505bcbde6a568e585b3f166160d10d97ffd04d8b47ae983e3e6fd3119b
3
+ metadata.gz: 17e7d077e15e3ca96c3e772784058ede1cf0d52bb9b050b6b6f4400c03958715
4
+ data.tar.gz: 4d895fe21986853037611776b137f07c81f0fc760bb6650d00afbb99209ee458
5
5
  SHA512:
6
- metadata.gz: 32cbd3ff499173cd7adb3797fadfda14aea5e74638632609dd4d2bda625f274acd0941a1a6f5790bf080d041c7ecb1d2eb17379e13688500ecf904458e5f6070
7
- data.tar.gz: b904ecc64938f5206ad046202bdd48d700457967aa49365ab78916584b035ce1b72c6eb77f56ecb9926e1b6aeb7df54960f0380142cba1300bb3edc59e2cb313
6
+ metadata.gz: 123a356663624013bd7b7796d389cf9aca0f0cf28e9ed7d74f8a5a05eda53798160e22c3c305b4e52cd58c78cb584212bdca2f4ae8825a1b056c6a15ddbbaf85
7
+ data.tar.gz: 33811fbde9cd7a54dbfb486451317b7e0cf5ecd74b3b55675f90db54a898b92a96a4627823daa44b6cf81f3f2f4651b8175f4424697229f6cb37ebc33ab87203
checksums.yaml.gz.sig ADDED
Binary file
data/changes.md CHANGED
@@ -1,3 +1,14 @@
1
+ ## 2.7.2
2
+
3
+ * Modernize gem (list all authors, etc).
4
+ * Drop official support for Ruby 2.4.
5
+ * Fix JRuby release version.
6
+
7
+ ## 2.7.1
8
+
9
+ * Fix license specification.
10
+ * Fix JRuby build warnings.
11
+
1
12
  ## 2.7.0
2
13
 
3
14
  * Convert NIO objects to TypedData API.
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.1"
9
+ VERSION = "2.7.2"
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
data.tar.gz.sig ADDED
@@ -0,0 +1 @@
1
+ JI/����b�l���ۉ�/��Կ��{W�D.��W���.i�Y�H/=�c��QDO�:Ir��4�U�����@�7vE�R��2Nf5�!�fB
metadata CHANGED
@@ -1,61 +1,102 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nio4r
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.7.1
4
+ version: 2.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tony Arcieri
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
8
58
  autorequire:
9
59
  bindir: bin
10
- cert_chain: []
11
- date: 2024-03-20 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.
60
+ cert_chain:
61
+ - |
62
+ -----BEGIN CERTIFICATE-----
63
+ MIIE2DCCA0CgAwIBAgIBATANBgkqhkiG9w0BAQsFADBhMRgwFgYDVQQDDA9zYW11
64
+ ZWwud2lsbGlhbXMxHTAbBgoJkiaJk/IsZAEZFg1vcmlvbnRyYW5zZmVyMRIwEAYK
65
+ CZImiZPyLGQBGRYCY28xEjAQBgoJkiaJk/IsZAEZFgJuejAeFw0yMjA4MDYwNDUz
66
+ MjRaFw0zMjA4MDMwNDUzMjRaMGExGDAWBgNVBAMMD3NhbXVlbC53aWxsaWFtczEd
67
+ MBsGCgmSJomT8ixkARkWDW9yaW9udHJhbnNmZXIxEjAQBgoJkiaJk/IsZAEZFgJj
68
+ bzESMBAGCgmSJomT8ixkARkWAm56MIIBojANBgkqhkiG9w0BAQEFAAOCAY8AMIIB
69
+ igKCAYEAomvSopQXQ24+9DBB6I6jxRI2auu3VVb4nOjmmHq7XWM4u3HL+pni63X2
70
+ 9qZdoq9xt7H+RPbwL28LDpDNflYQXoOhoVhQ37Pjn9YDjl8/4/9xa9+NUpl9XDIW
71
+ sGkaOY0eqsQm1pEWkHJr3zn/fxoKPZPfaJOglovdxf7dgsHz67Xgd/ka+Wo1YqoE
72
+ e5AUKRwUuvaUaumAKgPH+4E4oiLXI4T1Ff5Q7xxv6yXvHuYtlMHhYfgNn8iiW8WN
73
+ XibYXPNP7NtieSQqwR/xM6IRSoyXKuS+ZNGDPUUGk8RoiV/xvVN4LrVm9upSc0ss
74
+ RZ6qwOQmXCo/lLcDUxJAgG95cPw//sI00tZan75VgsGzSWAOdjQpFM0l4dxvKwHn
75
+ tUeT3ZsAgt0JnGqNm2Bkz81kG4A2hSyFZTFA8vZGhp+hz+8Q573tAR89y9YJBdYM
76
+ zp0FM4zwMNEUwgfRzv1tEVVUEXmoFCyhzonUUw4nE4CFu/sE3ffhjKcXcY//qiSW
77
+ xm4erY3XAgMBAAGjgZowgZcwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAwHQYDVR0O
78
+ BBYEFO9t7XWuFf2SKLmuijgqR4sGDlRsMC4GA1UdEQQnMCWBI3NhbXVlbC53aWxs
79
+ aWFtc0BvcmlvbnRyYW5zZmVyLmNvLm56MC4GA1UdEgQnMCWBI3NhbXVlbC53aWxs
80
+ aWFtc0BvcmlvbnRyYW5zZmVyLmNvLm56MA0GCSqGSIb3DQEBCwUAA4IBgQB5sxkE
81
+ cBsSYwK6fYpM+hA5B5yZY2+L0Z+27jF1pWGgbhPH8/FjjBLVn+VFok3CDpRqwXCl
82
+ xCO40JEkKdznNy2avOMra6PFiQyOE74kCtv7P+Fdc+FhgqI5lMon6tt9rNeXmnW/
83
+ c1NaMRdxy999hmRGzUSFjozcCwxpy/LwabxtdXwXgSay4mQ32EDjqR1TixS1+smp
84
+ 8C/NCWgpIfzpHGJsjvmH2wAfKtTTqB9CVKLCWEnCHyCaRVuKkrKjqhYCdmMBqCws
85
+ JkxfQWC+jBVeG9ZtPhQgZpfhvh+6hMhraUYRQ6XGyvBqEUe+yo6DKIT3MtGE2+CP
86
+ eX9i9ZWBydWb8/rvmwmX2kkcBbX0hZS1rcR593hGc61JR6lvkGYQ2MYskBveyaxt
87
+ Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
88
+ voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
89
+ -----END CERTIFICATE-----
90
+ date: 2024-05-07 00:00:00.000000000 Z
91
+ dependencies: []
92
+ description:
43
93
  email:
44
- - bascule@gmail.com
45
94
  executables: []
46
95
  extensions:
47
96
  - ext/nio4r/extconf.rb
48
97
  extra_rdoc_files: []
49
98
  files:
50
- - ".github/workflows/workflow.yml"
51
- - ".gitignore"
52
- - ".mailmap"
53
- - ".rspec"
54
- - ".rubocop.yml"
55
- - Gemfile
56
- - Rakefile
57
99
  - changes.md
58
- - examples/echo_server.rb
59
100
  - ext/libev/Changes
60
101
  - ext/libev/LICENSE
61
102
  - ext/libev/README
@@ -90,22 +131,7 @@ files:
90
131
  - lib/nio/version.rb
91
132
  - lib/nio4r.rb
92
133
  - license.md
93
- - logo.png
94
- - nio4r.gemspec
95
- - rakelib/extension.rake
96
- - rakelib/rspec.rake
97
- - rakelib/rubocop.rake
98
134
  - 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
109
135
  homepage: https://github.com/socketry/nio4r
110
136
  licenses:
111
137
  - MIT
@@ -113,10 +139,10 @@ licenses:
113
139
  metadata:
114
140
  bug_tracker_uri: https://github.com/socketry/nio4r/issues
115
141
  changelog_uri: https://github.com/socketry/nio4r/blob/main/changes.md
116
- documentation_uri: https://www.rubydoc.info/gems/nio4r/2.7.1
117
- source_code_uri: https://github.com/socketry/nio4r/tree/v2.7.1
118
- wiki_uri: https://github.com/socketry/nio4r/wiki
142
+ documentation_uri: https://www.rubydoc.info/gems/nio4r
119
143
  funding_uri: https://github.com/sponsors/ioquatix/
144
+ source_code_uri: https://github.com/socketry/nio4r.git
145
+ wiki_uri: https://github.com/socketry/nio4r/wiki
120
146
  post_install_message:
121
147
  rdoc_options: []
122
148
  require_paths:
@@ -132,18 +158,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
132
158
  - !ruby/object:Gem::Version
133
159
  version: '0'
134
160
  requirements: []
135
- rubygems_version: 3.2.22
161
+ rubygems_version: 3.5.3
136
162
  signing_key:
137
163
  specification_version: 4
138
164
  summary: New IO for Ruby
139
- test_files:
140
- - spec/nio/acceptables_spec.rb
141
- - spec/nio/bytebuffer_spec.rb
142
- - spec/nio/monitor_spec.rb
143
- - spec/nio/selectables/pipe_spec.rb
144
- - spec/nio/selectables/ssl_socket_spec.rb
145
- - spec/nio/selectables/tcp_socket_spec.rb
146
- - spec/nio/selectables/udp_socket_spec.rb
147
- - spec/nio/selector_spec.rb
148
- - spec/spec_helper.rb
149
- - spec/support/selectable_examples.rb
165
+ 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
data/nio4r.gemspec DELETED
@@ -1,43 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require File.expand_path("lib/nio/version", __dir__)
4
-
5
- Gem::Specification.new do |spec|
6
- spec.authors = ["Tony Arcieri"]
7
- spec.email = ["bascule@gmail.com"]
8
- spec.homepage = "https://github.com/socketry/nio4r"
9
- spec.licenses = ["MIT", "BSD-2-Clause"]
10
- spec.summary = "New IO for Ruby"
11
- spec.description = <<-DESCRIPTION.strip.gsub(/\s+/, " ")
12
- Cross-platform asynchronous I/O primitives for scalable network clients
13
- and servers. Inspired by the Java NIO API, but simplified for ease-of-use.
14
- DESCRIPTION
15
-
16
- spec.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
17
- spec.files = `git ls-files`.split("\n")
18
- spec.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
19
- spec.name = "nio4r"
20
- spec.require_paths = ["lib"]
21
- spec.version = NIO::VERSION
22
-
23
- spec.metadata = {
24
- "bug_tracker_uri" => "https://github.com/socketry/nio4r/issues",
25
- "changelog_uri" => "https://github.com/socketry/nio4r/blob/main/changes.md",
26
- "documentation_uri" => "https://www.rubydoc.info/gems/nio4r/#{spec.version}",
27
- "source_code_uri" => "https://github.com/socketry/nio4r/tree/v#{spec.version}",
28
- "wiki_uri" => "https://github.com/socketry/nio4r/wiki",
29
- "funding_uri" => "https://github.com/sponsors/ioquatix/",
30
- }
31
-
32
- spec.required_ruby_version = ">= 2.4"
33
-
34
- if defined? JRUBY_VERSION
35
- spec.files << "lib/nio4r_ext.jar"
36
- spec.platform = "java"
37
- else
38
- spec.extensions = ["ext/nio4r/extconf.rb"]
39
- end
40
-
41
- spec.add_development_dependency "bundler"
42
- spec.add_development_dependency "rake"
43
- end
@@ -1,14 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- if defined? JRUBY_VERSION
4
- require "rake/javaextensiontask"
5
- Rake::JavaExtensionTask.new("nio4r_ext") do |ext|
6
- ext.ext_dir = "ext/nio4r"
7
- ext.release = '8'
8
- end
9
- else
10
- require "rake/extensiontask"
11
- Rake::ExtensionTask.new("nio4r_ext") do |ext|
12
- ext.ext_dir = "ext/nio4r"
13
- end
14
- end
data/rakelib/rspec.rake DELETED
@@ -1,9 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "rspec/core/rake_task"
4
-
5
- RSpec::Core::RakeTask.new
6
-
7
- RSpec::Core::RakeTask.new(:rcov) do |task|
8
- task.rcov = true
9
- end
data/rakelib/rubocop.rake DELETED
@@ -1,5 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "rubocop/rake_task"
4
-
5
- RuboCop::RakeTask.new