Class: D2::FileDescriptor

Inherits:
Object
  • Object
show all
Defined in:
lib/d2.rb

Instance Method Summary collapse

Instance Method Details

#write(cmd) ⇒ Object

Write out to the file descriptor to interact with the parent process (shell)

Parameters:

  • cmd (String)

    to execute in the parent environment



47
48
49
50
51
52
# File 'lib/d2.rb', line 47

def write(cmd)
  fd = IO.sysopen(@path, 'w')
  io = IO.new(fd)
  io.write("#{cmd}\n")
  io.close
end