Module: Capistrano::DSL

Defined in:
lib/capistrano/rsync/dsl/dsl.rb

Instance Method Summary collapse

Instance Method Details

#rsync(src, host, dst) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/capistrano/rsync/dsl/dsl.rb', line 3

def rsync(src, host, dst)
  sync_opts  = fetch(:sync_opts)
  ssh_opts   = fetch(:ssh_opts)
  other_opts = fetch(:other_opts)
  user = fetch(:username)

  rsync = %w[rsync]
  rsync << sync_opts
  rsync << ssh_opts
  rsync << other_opts
  rsync << src
  rsync << "#{user}@#{host.hostname}:#{dst}"

  Kernel.system *rsync.flatten
end

#rsync_remote(src, host, dst) ⇒ Object



19
20
21
22
23
24
25
# File 'lib/capistrano/rsync/dsl/dsl.rb', line 19

def rsync_remote(src, host, dst)
  sync_opts  = fetch(:sync_opts)
  ssh_opts   = fetch(:ssh_opts)
  other_opts = fetch(:other_opts)
  user = fetch(:username)
  execute :rsync, sync_opts, ssh_opts, other_opts, src, "#{user}@#{host}:#{dst}"
end