module SSHKit::Interactive::DSL

Public Instance Methods

on(*args) click to toggle source
Calls superclass method
# File lib/sshkit/interactive/dsl.rb, line 16
def on(*args)
  raise SSHKit::Interactive::Unsupported, 'Switching host in interactive mode is not possible' if Thread.current[:run_interactively]

  super
end
run_interactively(host, options = {}, &block) click to toggle source

run commands interactively

# File lib/sshkit/interactive/dsl.rb, line 5
def run_interactively(host, options = {}, &block)
  # Force setting global netssh_options on host if using capistrano
  SSHKit.config.backend.new(host) { test(:true) }.run

  Thread.current[:run_interactively] = true

  SSHKit::Interactive::Backend.new(host, options, &block).run
ensure
  Thread.current[:run_interactively] = false
end