File: io.rb

package info (click to toggle)
ruby-childprocess 4.1.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 376 kB
  • sloc: ruby: 2,541; makefile: 4
file content (21 lines) | stat: -rw-r--r-- 450 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
module ChildProcess
  module Unix
    class IO < AbstractIO
      private

      def check_type(io)
        unless io.respond_to? :to_io
          raise ArgumentError, "expected #{io.inspect} to respond to :to_io"
        end

        result = io.to_io
        unless result && result.kind_of?(::IO)
          raise TypeError, "expected IO, got #{result.inspect}:#{result.class}"
        end
      end

    end # IO
  end # Unix
end # ChildProcess