Class: Kdeploy::DownloadCommand
Overview
Command class for file download operations
Instance Attribute Summary
Attributes inherited from Command
#command, #name, #options, #result
Instance Method Summary collapse
- #execute(host, connection) ⇒ Object
-
#initialize(remote_path, local_path, global_variables = {}) ⇒ DownloadCommand
constructor
A new instance of DownloadCommand.
Methods inherited from Command
Constructor Details
#initialize(remote_path, local_path, global_variables = {}) ⇒ DownloadCommand
Returns a new instance of DownloadCommand.
446 447 448 449 450 451 |
# File 'lib/kdeploy/dsl.rb', line 446 def initialize(remote_path, local_path, global_variables = {}) @remote_path = remote_path @local_path = local_path @global_variables = global_variables super() end |
Instance Method Details
#execute(host, connection) ⇒ Object
453 454 455 456 457 458 459 460 461 462 463 464 |
# File 'lib/kdeploy/dsl.rb', line 453 def execute(host, connection) start_time = Time.now processed_path = process_remote_path(host) begin connection.download(processed_path, @local_path) record_success(start_time, host) rescue StandardError => e record_failure(e, start_time, host) raise end end |