Sha256: 798368d9e3b12fbffa55ff76da6d71d446d63f536ac2141e3c791eb4ba9fbd92

Contents?: true

Size: 489 Bytes

Versions: 2

Compression:

Stored size: 489 Bytes

Contents

module ChildProcess
  module Windows
    class IO < AbstractIO
      private

      def check_type(io)
        return if has_fileno?(io)
        return if has_to_io?(io)

        raise ArgumentError, "#{io.inspect}:#{io.class} must have :fileno or :to_io"
      end

      def has_fileno?(io)
        io.respond_to?(:fileno) && io.fileno
      end

      def has_to_io?
        io.respond_to?(:to_io) && io.to_io.kind_of?(::IO)
      end

    end # IO
  end # Windows
end # ChildProcess


Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
childprocess-0.1.2 lib/childprocess/windows/io.rb
childprocess-0.1.1 lib/childprocess/windows/io.rb