kernel/common/process_mirror.rb
# Convert variations of redirecting to a file to a standard tuple.
#
# :in   => '/some/file'   => ['/some/file', 'r', 0644]
# :out  => '/some/file'   => ['/some/file', 'w', 0644]
# :err  => '/some/file'   => ['/some/file', 'w', 0644]
# STDIN => '/some/file'   => ['/some/file', 'r', 0644]
#
# Returns the modified value.
Convert variations of redirecting to a file to a standard tuple.

Returns the modified value.
Convert variations of redirecting to a file to a standard tuple . Returns the modified value .
def adjust_redirect_value(key, value)
          case value
            when :in, :out, :err, :close, ::IO, ::Fixnum
              value
            when ::Array
              if value.size < 3
                defaults = default_file_reopen_info(key, value[0])
                value += defaults[value.size..-1]
              end
              if value[1].respond_to?(:to_str)
                value = value.dup
                value[1] = OFLAGS[value[1]]
              end
              value
            when ::String
              default_file_reopen_info(key, value)
            when ::Symbol
              raise ArgumentError, "wrong exec redirect symbol : #{value.inspect}"
            else
              raise ArgumentError, "wrong exec redirect action"
          end
        end
def adjust_redirect_value ( key , value ) case value when :in , :out , :err , :close , :: IO , :: Fixnum value when :: Array if value . size < 3 defaults = default_file_reopen_info ( key , value [ 0 ] ) value += defaults [ value . size .. - 1 ] end if value [ 1 ] . respond_to? ( :to_str ) value = value . dup value [ 1 ] = OFLAGS [ value [ 1 ] ] end value when :: String default_file_reopen_info ( key , value ) when :: Symbol raise ArgumentError , "wrong exec redirect symbol : #{value.inspect}" else raise ArgumentError , "wrong exec redirect action" end end
Convert variations of redirecting to a file to a standard tuple.
Convert variations of redirecting to a file to a standard tuple .
key
value