Class: Mattock::Rake::RemoteCommandTask
- Inherits:
-
CommandTask
- Object
- Rake::Task
- Task
- CommandTask
- Mattock::Rake::RemoteCommandTask
- Defined in:
- lib/mattock/remote-command-task.rb
Instance Attribute Summary
Attributes included from ConfigurableTask
Instance Method Summary collapse
Methods included from CommandTaskMixin
#action, #check_verification_command, included, #needed?, #resolve_runtime_configuration, shell, #shell, #verify_command
Methods included from ConfigurableTask
#action, included, #inspect, #resolve_configuration
Methods included from DeferredDefinition
add_settings, #finalize_configuration, #resolve_runtime_configuration, #runtime?, #runtime_definition, #setup_deferred
Methods included from CascadingDefinition
#confirm_configuration, #confirm_step, #confirm_steps, #default_configuration, #define, #resolve_configuration, #setup_cascade
Instance Method Details
#decorated(command_on_remote) ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/mattock/remote-command-task.rb', line 19 def decorated(command_on_remote) fail "Need remote server for #{self.class.name}" unless remote_server.address raise "Empty remote command" if command_on_remote.nil? cmd("ssh") do |cmd| cmd. << "-i #{id_file}" if id_file cmd. << "-l #{remote_server.user}" unless remote_server.user.nil? cmd. << remote_server.address cmd. << "-p #{remote_server.port}" #ok cmd. << "-n" cmd. << "-#{'v'*verbose}" if verbose > 0 unless .empty? .each do |opt| cmd. << "-o #{opt}" end end cmd - escaped_command(command_on_remote) end end |
#ssh_option(name, value) ⇒ Object
15 16 17 |
# File 'lib/mattock/remote-command-task.rb', line 15 def ssh_option(name, value) << "\"#{name}=#{value}\"" end |