Class: SSHKit::Interact::Command
- Inherits:
-
Object
- Object
- SSHKit::Interact::Command
- Defined in:
- lib/sshkit/interact/command.rb
Overview
Command wrapper
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(host, command) ⇒ Command
constructor
A new instance of Command.
- #to_cmd ⇒ Object
Constructor Details
#initialize(host, command) ⇒ Command
Returns a new instance of Command.
5 6 7 8 |
# File 'lib/sshkit/interact/command.rb', line 5 def initialize(host, command) @host = host @command = command end |
Instance Method Details
#execute ⇒ Object
19 20 21 |
# File 'lib/sshkit/interact/command.rb', line 19 def execute exec(to_cmd) end |
#to_cmd ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'lib/sshkit/interact/command.rb', line 10 def to_cmd [ :ssh, *ssh_cmd_args, @host.hostname, %Q{'$SHELL -l -c "#{@command.to_command}"'} ].join(' ') end |