Class: Seeker::SSH

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

Defined Under Namespace

Classes: NoSshShell

Constant Summary collapse

TIMEOUT =
5
PROMPT =
/^[^\s>#]+[>#] /
SLEEP =
0.001

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#prompt_seenObject (readonly)

Returns the value of attribute prompt_seen.



9
10
11
# File 'lib/seeker/ssh.rb', line 9

def prompt_seen
  @prompt_seen
end

Instance Method Details

#close(command = 'exit') ⇒ Object



21
22
23
# File 'lib/seeker/ssh.rb', line 21

def close command='exit'
  @session.send_data command +"\n"
end

#cmd(command) ⇒ Object



12
13
14
15
16
17
18
19
# File 'lib/seeker/ssh.rb', line 12

def cmd command
  Log.debug "SSH: #{command}"
  @output = ''
  @session.send_data command + "\n"
  @session.process
  expect @prompt
  @output
end