lib/ztk/pty.rb
# Execute a process via a ruby-based PTY.
#
# @param [Array] args An argument splat to be passed to PTY::spawn
#
# @return [Object] Returns the $? object.
Execute a process via a ruby-based PTY.
Execute a process via a ruby - based PTY .
def spawn(*args, &block)
        begin
          ::PTY.spawn(*args) do |reader, writer, pid|
            begin
              block_given? and yield(reader, writer, pid)
            rescue Errno::EIO
            ensure
              ::Process.wait(pid)
            end
          end
        rescue ::PTY::ChildExited
        end
        true
      end
def spawn ( * args , & block ) begin :: PTY . spawn ( * args ) do | reader , writer , pid | begin block_given? and yield ( reader , writer , pid ) rescue Errno :: EIO ensure :: Process . wait ( pid ) end end rescue :: PTY :: ChildExited end true end
Execute a process via a ruby-based PTY.
Execute a process via a ruby - based PTY .
Returns the $. object.
Returns the $ . object .
Object
args
<not_specific>
block
<not_specific>
<not_specific>
args An argument splat to be passed to PTY::spawn
args An argument splat to be passed to PTY :: spawn