Class: Commander::Command
- Inherits:
-
Object
- Object
- Commander::Command
- Defined in:
- lib/command.rb
Instance Method Summary collapse
Instance Method Details
#ssh_action(&block) ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 13 |
# File 'lib/command.rb', line 2 def ssh_action(&block) action do |args, | if $ssh_remote say "Connecting to remote host #{$hostname}... " if .verbose Net::SSH.start($hostname, $username, $ssh_options.compact) do |ssh| block.call(args, , ssh) end else block.call(args, , Net::SSH::Connection::LocalSession.new) end end end |