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 |
# File 'lib/command.rb', line 2 def ssh_action(&block) action do |args, | if $ssh_remote say "Connecting to remote host #{$hostname}... " if .verbose else say 'Running commands locally... ' if .verbose end Net::SSH.with_session() { |ssh| block.call(args, , ssh) } end end |