summaryrefslogtreecommitdiff
path: root/ext/socket/lib/socket.rb
diff options
context:
space:
mode:
authorSamuel Williams <[email protected]>2022-12-15 11:37:01 +1300
committerGitHub <[email protected]>2022-12-15 11:37:01 +1300
commitd20bd06a97555a4493458d866590107da6cb21f4 (patch)
treed3978c04ad009762a548c412b44ba4c12bec17e9 /ext/socket/lib/socket.rb
parent55f56eb66e9045943c4b61876b67bcd971666788 (diff)
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.
Notes
Notes: Merged-By: ioquatix <[email protected]>
Diffstat (limited to 'ext/socket/lib/socket.rb')
-rw-r--r--ext/socket/lib/socket.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/ext/socket/lib/socket.rb b/ext/socket/lib/socket.rb
index 1c091650ff..eecdc7d4b8 100644
--- a/ext/socket/lib/socket.rb
+++ b/ext/socket/lib/socket.rb
@@ -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.