Module: CapistranoExtensions::Files::Remote

Defined in:
lib/capistrano_extensions/files/remote.rb

Instance Method Summary collapse

Instance Method Details

#cd(dir, options = {}) ⇒ Object



43
44
45
46
47
48
49
50
# File 'lib/capistrano_extensions/files/remote.rb', line 43

def cd(dir, options={})
  if block_given?
    dir, dir2 = pwd, dir
    _r 'cd', dir2
    yield
  end  
  _r 'cd', dir
end

#download(*args) ⇒ Object



39
40
41
# File 'lib/capistrano_extensions/files/remote.rb', line 39

def download(*args)
  _via == :system ? cp(*args) : @config.download(*args)
end

#pwdObject



52
53
54
# File 'lib/capistrano_extensions/files/remote.rb', line 52

def pwd
  capture('pwd', :via => _via)
end

#tail_f(file, n = 10) ⇒ Object



28
29
30
31
32
33
# File 'lib/capistrano_extensions/files/remote.rb', line 28

def tail_f(file, n=10)
  cmd = "tail -n #{n} -f #{_q file}"
  _via == :system ? local_run(cmd) : stream(cmd, :via => _via)
rescue Interrupt
  logger.trace "interrupted (Ctrl-C)" if logger
end

#upload(*args) ⇒ Object



35
36
37
# File 'lib/capistrano_extensions/files/remote.rb', line 35

def upload(*args)
  _via == :system ? cp(*args) : @config.upload(*args)
end