Class: SSHKit::Interactive::Backend

Inherits:
Backend::Printer
  • Object
show all
Defined in:
lib/sshkit/interactive/backend.rb

Instance Method Summary collapse

Instance Method Details

#execute(*args, &block) ⇒ Object



16
17
18
19
20
# File 'lib/sshkit/interactive/backend.rb', line 16

def execute(*args, &block)
  remote_command = command(*args)
  output << remote_command
  Command.new(host, remote_command).execute
end

#runObject



5
6
7
# File 'lib/sshkit/interactive/backend.rb', line 5

def run
  instance_exec(host, &@block)
end

#within(directory, &block) ⇒ Object



9
10
11
12
13
14
# File 'lib/sshkit/interactive/backend.rb', line 9

def within(directory, &block)
  (@pwd ||= []).push directory.to_s
  yield
ensure
  @pwd.pop
end