Module: RightScale::InputHandler

Defined in:
lib/right_popen/linux/right_popen.rb

Instance Method Summary collapse

Instance Method Details

#drain_and_closeObject



121
122
123
# File 'lib/right_popen/linux/right_popen.rb', line 121

def drain_and_close
  close_connection
end

#initialize(file_handle, string) ⇒ Object



107
108
109
110
111
112
113
114
# File 'lib/right_popen/linux/right_popen.rb', line 107

def initialize(file_handle, string)
  # Voodoo to make sure that Ruby doesn't gc the file handle
  # (closing the stream) before we're done with it.  No, oddly
  # enough EventMachine is not good about holding on to this
  # itself.
  @handle = file_handle
  @string = string
end

#post_initObject



116
117
118
119
# File 'lib/right_popen/linux/right_popen.rb', line 116

def post_init
  send_data(@string) if @string
  close_connection_after_writing
end