Class: DeepTest::Distributed::RSync::Args
- Inherits:
-
Object
- Object
- DeepTest::Distributed::RSync::Args
- Defined in:
- lib/deep_test/distributed/rsync.rb
Instance Method Summary collapse
- #command(destination) ⇒ Object
-
#initialize(connection_info, options) ⇒ Args
constructor
A new instance of Args.
- #source_location ⇒ Object
Constructor Details
#initialize(connection_info, options) ⇒ Args
Returns a new instance of Args.
12 13 14 15 16 |
# File 'lib/deep_test/distributed/rsync.rb', line 12 def initialize(connection_info, ) @connection_info = connection_info @options = @sync_options = . end |
Instance Method Details
#command(destination) ⇒ Object
18 19 20 21 22 23 |
# File 'lib/deep_test/distributed/rsync.rb', line 18 def command(destination) # The '/' after source tells rsync to copy the contents # of source to destination, rather than the source directory # itself "rsync -az --delete #{@sync_options[:rsync_options]} #{source_location}/ #{destination}".strip.squeeze(" ") end |
#source_location ⇒ Object
25 26 27 28 29 30 31 32 33 |
# File 'lib/deep_test/distributed/rsync.rb', line 25 def source_location source = "" unless @sync_options[:local] source << @sync_options[:username] << '@' if @sync_options[:username] source << @connection_info.address source << (@sync_options[:daemon] ? '::' : ':') end source << @sync_options[:source] end |