Method: SshHelper::TmcSsh#send_raw

Defined in:
lib/helpers/tmc_helpers/ssh_helper/ssh_helper.rb

#send_raw(data, expect: nil, timeout: 10.sec) ⇒ Object

Public: Sends some data to the active PTY.

data - String data to send. expect - String or Regexp output to expect (default: nil). timeout - Integer timeout in milliseconds (default: 10.sec).

Returns nothing, or a String data buffered before the expected output.



110
111
112
113
114
115
116
117
118
119
120
# File 'lib/helpers/tmc_helpers/ssh_helper/ssh_helper.rb', line 110

def send_raw(data, expect: nil, timeout: 10.sec)
  raise 'No active pty.' if @pty.nil?
  loginfo("Sending: #{data}".strip)
  @last_sent_data = data
  @pty.send_data(data)
  if expect.nil?
    nil
  else
    expect(expect, timeout: timeout)
  end
end