module POSIX::Spawn
def fd?(object)
Returns true if object is an instance of IO, Integer >= 0, or one of the
Determine whether object is fd-like.
def fd?(object) case object when Integer object >= 0 when :in, :out, :err, STDIN, STDOUT, STDERR, $stdin, $stdout, $stderr, IO true else object.respond_to?(:to_io) && !object.to_io.nil? end end