Remove require 'io/wait'
where it's no longer necessary. (#6932)
* Remove `require 'io/wait'` as it's part of core now. * Update ruby specs using version gates. * Add note about why it's conditional.
This commit is contained in:
parent
55f56eb66e
commit
d20bd06a97
Notes:
git
2022-12-14 22:37:22 +00:00
Merged-By: ioquatix <samuel@codeotaku.com>
@ -1,7 +1,11 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'socket.so'
|
||||
require 'io/wait' unless ::IO.method_defined?(:wait_readable, false)
|
||||
|
||||
unless IO.method_defined?(:wait_writable, false)
|
||||
# It's only required on older Rubies < v3.2:
|
||||
require 'io/wait'
|
||||
end
|
||||
|
||||
class Addrinfo
|
||||
# creates an Addrinfo object from the arguments.
|
||||
|
@ -1,6 +1,8 @@
|
||||
require_relative '../../spec_helper'
|
||||
|
||||
require 'io/wait'
|
||||
ruby_version_is ''...'3.2' do
|
||||
require 'io/wait'
|
||||
end
|
||||
|
||||
describe "IO#wait_readable" do
|
||||
before :each do
|
||||
|
@ -1,6 +1,8 @@
|
||||
require_relative '../../spec_helper'
|
||||
|
||||
require 'io/wait'
|
||||
ruby_version_is ''...'3.2' do
|
||||
require 'io/wait'
|
||||
end
|
||||
|
||||
describe "IO#wait_writable" do
|
||||
it "waits for the IO to become writable with no timeout" do
|
||||
|
@ -1,7 +1,6 @@
|
||||
# frozen_string_literal: true
|
||||
require 'test/unit'
|
||||
require '-test-/thread_fd'
|
||||
require 'io/wait'
|
||||
|
||||
class TestThreadFdClose < Test::Unit::TestCase
|
||||
|
||||
|
@ -3,10 +3,9 @@
|
||||
require 'test/unit'
|
||||
require 'timeout'
|
||||
require 'socket'
|
||||
begin
|
||||
require 'io/wait'
|
||||
rescue LoadError
|
||||
end
|
||||
|
||||
# For `IO#ready?` and `IO#nread`:
|
||||
require 'io/wait'
|
||||
|
||||
class TestIOWait < Test::Unit::TestCase
|
||||
|
||||
|
@ -1,6 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
require 'test/unit'
|
||||
require 'io/wait'
|
||||
|
||||
# test uncommon device types to check portability problems
|
||||
# We may optimize IO#wait_*able for non-Linux kernels in the future
|
||||
|
@ -1,7 +1,6 @@
|
||||
# frozen_string_literal: true
|
||||
require 'test/unit'
|
||||
require 'rbconfig'
|
||||
require 'io/wait'
|
||||
|
||||
class TestIOWaitInRactor < Test::Unit::TestCase
|
||||
def test_ractor
|
||||
|
@ -3,7 +3,6 @@
|
||||
require 'test/unit'
|
||||
require 'tempfile'
|
||||
require 'timeout'
|
||||
require 'io/wait'
|
||||
require 'rbconfig'
|
||||
|
||||
class TestProcess < Test::Unit::TestCase
|
||||
|
@ -9,7 +9,6 @@
|
||||
#
|
||||
# $IPR: httpserver.rb,v 1.63 2002/10/01 17:16:32 gotoyuzo Exp $
|
||||
|
||||
require 'io/wait'
|
||||
require_relative 'server'
|
||||
require_relative 'httputils'
|
||||
require_relative 'httpstatus'
|
||||
|
Loading…
x
Reference in New Issue
Block a user