kgio RubyGem user+dev discussion/patches/pulls/bugs/help
 help / color / mirror / code / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download mbox.gz: |
* [ANN] kgio 2.11.3 - deprecated project moves off deprecated TLD
@ 2020-01-08  9:29  6% Eric Wong
  0 siblings, 0 replies; 3+ results
From: Eric Wong @ 2020-01-08  9:29 UTC (permalink / raw)
  To: kgio-public

This is a legacy project, do not use it for new projects.  Ruby
2.3 and later should make this obsolete.  kgio provides
non-blocking I/O methods for Ruby without raising exceptions on
EAGAIN and EINPROGRESS.

Note: I do not recommend using kgio for future applications, Ruby 2.x
has a lot of the functionality of kgio and Ruby 2.3+ has even more.

* homepage: https://yhbt.net/kgio/
* public mailing list: kgio-public@yhbt.net
* git clone https://yhbt.net/kgio.git
* Atom feed https://yhbt.net/kgio/NEWS.atom.xml
* mail archives: https://yhbt.net/kgio-public/

Changes:

    Some doc and warning fixes for newer Rubies.

    We're no longer on bogomips.org since it's due
    for expiry and I can't pay extortionists for a .org, so
    s/bogomips.org/yhbt.net/ for now, and be prepared to move again
    when extortionists move onto the .net TLD.

          pkg.mk: use --local to "gem install"
          pkg.mk: use dark216 theme for Earth Day 2019
          test: fix warnings with RUBYOPT=-w
          tests: fix unused variable warnings from newer Rubies
          test_connect_fd_leak: do not close socket if non-existent
          test_syssend: avoid warning on cleanup
          build: remove olddoc from the gemspec
          doc: remove private email and outdated gmane archives
          doc: move from bogomips.org/kgio to yhbt.net/kgio

Again, using kgio for new projects is strongly discouraged.
Use Ruby 2.3+ instead.

^ permalink raw reply	[relevance 6%]

* [PATCH 2/2] tests: fix unused variable warnings from newer Rubies
  2019-10-30  9:26  7% [PATCH 0/2] Ruby warning fixes Eric Wong
@ 2019-10-30  9:26  5% ` Eric Wong
  0 siblings, 0 replies; 3+ results
From: Eric Wong @ 2019-10-30  9:26 UTC (permalink / raw)
  To: kgio-public

Newer Rubies warn about more things...
---
 test/test_accept_class.rb                  | 18 ++++++++++--------
 test/test_connect_fd_leak.rb               |  1 +
 test/test_kgio_addr.rb                     |  1 +
 test/test_poll.rb                          | 10 ++++------
 test/test_tcp6_client_read_server_write.rb |  1 +
 5 files changed, 17 insertions(+), 14 deletions(-)

diff --git a/test/test_accept_class.rb b/test/test_accept_class.rb
index 0e1d172..01dc263 100644
--- a/test/test_accept_class.rb
+++ b/test/test_accept_class.rb
@@ -30,33 +30,35 @@ class TestAcceptClass < Test::Unit::TestCase
     @host = ENV["TEST_HOST"] || '127.0.0.1'
     @srv = Kgio::TCPServer.new(@host, 0)
     @port = @srv.addr[1]
+    socks = []
 
     Kgio.accept_class = Kgio::TCPSocket
-    client = TCPSocket.new(@host, @port)
+    socks << TCPSocket.new(@host, @port)
     assert_instance_of Kgio::TCPSocket, @srv.kgio_accept
-    client = TCPSocket.new(@host, @port)
+    socks << TCPSocket.new(@host, @port)
     IO.select([@srv])
     assert_instance_of Kgio::TCPSocket, @srv.kgio_tryaccept
 
     Kgio.accept_class = nil
-    client = TCPSocket.new(@host, @port)
+    socks << TCPSocket.new(@host, @port)
     assert_instance_of Kgio::Socket, @srv.kgio_accept
-    client = TCPSocket.new(@host, @port)
+    socks << TCPSocket.new(@host, @port)
     IO.select([@srv])
     assert_instance_of Kgio::Socket, @srv.kgio_tryaccept
 
     Kgio.accept_class = Kgio::UNIXSocket
-    client = TCPSocket.new(@host, @port)
+    socks << TCPSocket.new(@host, @port)
     assert_instance_of Kgio::UNIXSocket, @srv.kgio_accept
-    client = TCPSocket.new(@host, @port)
+    socks << TCPSocket.new(@host, @port)
     IO.select([@srv])
     assert_instance_of Kgio::UNIXSocket, @srv.kgio_tryaccept
 
-    client = TCPSocket.new(@host, @port)
+    socks << TCPSocket.new(@host, @port)
     assert_instance_of FooSocket, @srv.kgio_accept(FooSocket)
 
-    client = TCPSocket.new(@host, @port)
+    socks << TCPSocket.new(@host, @port)
     IO.select([@srv])
     assert_instance_of FooSocket, @srv.kgio_tryaccept(FooSocket)
+    socks.each(&:close)
   end
 end
diff --git a/test/test_connect_fd_leak.rb b/test/test_connect_fd_leak.rb
index 1dfc4cd..034fe5b 100644
--- a/test/test_connect_fd_leak.rb
+++ b/test/test_connect_fd_leak.rb
@@ -13,5 +13,6 @@ class TestConnectFDLeak < Test::Unit::TestCase
       sock = Kgio::UNIXSocket.new(path)
     rescue Errno::ENOENT
     end while (nr += 1) < 10000
+    sock.close
   end
 end
diff --git a/test/test_kgio_addr.rb b/test/test_kgio_addr.rb
index 8650f5e..fc1dec7 100644
--- a/test/test_kgio_addr.rb
+++ b/test/test_kgio_addr.rb
@@ -15,5 +15,6 @@ class TestKgioAddr < Test::Unit::TestCase
     s = accepted.kgio_addr!
     assert_equal addr, s
     assert_equal addr, accepted.instance_variable_get(:@kgio_addr)
+    client.close
   end
 end
diff --git a/test/test_poll.rb b/test/test_poll.rb
index 6463ef9..ab77bc9 100644
--- a/test/test_poll.rb
+++ b/test/test_poll.rb
@@ -43,7 +43,6 @@ class TestPoll < Test::Unit::TestCase
   end
 
   def test_poll_close
-    foo = nil
     thr = Thread.new { sleep 0.100; @wr.close }
     t0 = Time.now
     res = Kgio.poll({@rd => Kgio::POLLIN})
@@ -55,7 +54,6 @@ class TestPoll < Test::Unit::TestCase
 
   def test_signal_close
     orig = trap(:USR1) { @rd.close }
-    res = nil
     thr = Thread.new { sleep 0.100; Process.kill(:USR1, $$) }
     t0 = Time.now
     assert_raises(IOError) do
@@ -65,8 +63,8 @@ class TestPoll < Test::Unit::TestCase
     diff = Time.now - t0
     thr.join
     assert diff >= 0.010, "diff=#{diff}"
-    ensure
-      trap(:USR1, orig)
+  ensure
+    trap(:USR1, orig)
   end
 
   def test_poll_EINTR
@@ -83,8 +81,8 @@ class TestPoll < Test::Unit::TestCase
     assert_nil res
     assert diff >= 1.0, "diff=#{diff}"
     assert ok
-    ensure
-      trap(:USR1, orig)
+  ensure
+    trap(:USR1, orig)
   end
 
   def test_poll_signal_torture
diff --git a/test/test_tcp6_client_read_server_write.rb b/test/test_tcp6_client_read_server_write.rb
index 4ad330f..35c6463 100644
--- a/test/test_tcp6_client_read_server_write.rb
+++ b/test/test_tcp6_client_read_server_write.rb
@@ -3,6 +3,7 @@ require './test/lib_read_write'
 begin
   tmp = TCPServer.new(ENV["TEST_HOST6"] || '::1', 0)
   ipv6_enabled = true
+  tmp.close
 rescue => e
   warn "skipping IPv6 tests, host does not seem to be IPv6 enabled:"
   warn "  #{e.class}: #{e}"

^ permalink raw reply related	[relevance 5%]

* [PATCH 0/2] Ruby warning fixes
@ 2019-10-30  9:26  7% Eric Wong
  2019-10-30  9:26  5% ` [PATCH 2/2] tests: fix unused variable warnings from newer Rubies Eric Wong
  0 siblings, 1 reply; 3+ results
From: Eric Wong @ 2019-10-30  9:26 UTC (permalink / raw)
  To: kgio-public

Newer Rubies warn about more things

Eric Wong (2):
  test: fix warnings with RUBYOPT=-w
  tests: fix unused variable warnings from newer Rubies

 test/lib_read_write.rb                     |  2 ++
 test/lib_server_accept.rb                  | 11 +++++++----
 test/test_accept_class.rb                  | 18 ++++++++++--------
 test/test_connect_fd_leak.rb               |  1 +
 test/test_kgio_addr.rb                     |  1 +
 test/test_poll.rb                          | 10 ++++------
 test/test_tcp6_client_read_server_write.rb |  1 +
 test/test_tryopen.rb                       |  5 +++--
 8 files changed, 29 insertions(+), 20 deletions(-)


^ permalink raw reply	[relevance 7%]

Results 1-3 of 3 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2019-10-30  9:26  7% [PATCH 0/2] Ruby warning fixes Eric Wong
2019-10-30  9:26  5% ` [PATCH 2/2] tests: fix unused variable warnings from newer Rubies Eric Wong
2020-01-08  9:29  6% [ANN] kgio 2.11.3 - deprecated project moves off deprecated TLD Eric Wong

Code repositories for project(s) associated with this public inbox

	https://yhbt.net/kgio.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).