Class: Bow::Ssh::Rsync

Inherits:
Object
  • Object
show all
Defined in:
lib/bow/ssh/rsync.rb

Instance Method Summary collapse

Constructor Details

#initialize(ssh_helper) ⇒ Rsync

Returns a new instance of Rsync.



6
7
8
# File 'lib/bow/ssh/rsync.rb', line 6

def initialize(ssh_helper)
  @ssh_helper = ssh_helper
end

Instance Method Details

#call(source, target) ⇒ Object



10
11
12
# File 'lib/bow/ssh/rsync.rb', line 10

def call(source, target)
  @ssh_helper.run(cmd_rsync(source, target))
end

#cmd_rsync(source, target) ⇒ Object



14
15
16
17
18
19
20
21
# File 'lib/bow/ssh/rsync.rb', line 14

def cmd_rsync(source, target)
  format(
    'rsync --timeout=10 --force -r %s %s:%s',
    source,
    @ssh_helper.conn,
    target
  )
end