Module: CapistranoExtensions::Files::Local
- Includes:
- FileUtils::Verbose
- Defined in:
- lib/capistrano_extensions/files/local.rb
Instance Method Summary collapse
- #cd(dir, options = {}) ⇒ Object
- #download(from, to) ⇒ Object
- #tail_f(file, n = 10) ⇒ Object
- #upload(from, to) ⇒ Object
Instance Method Details
#cd(dir, options = {}) ⇒ Object
36 37 38 39 40 41 42 43 |
# File 'lib/capistrano_extensions/files/local.rb', line 36 def cd(dir, ={}) if block_given? dir, dir2 = pwd, dir cd dir2 yield end cd dir end |
#download(from, to) ⇒ Object
32 33 34 |
# File 'lib/capistrano_extensions/files/local.rb', line 32 def download(from, to) cp from, to end |
#tail_f(file, n = 10) ⇒ Object
21 22 23 24 25 26 |
# File 'lib/capistrano_extensions/files/local.rb', line 21 def tail_f(file, n=10) unless defined? File::Tail::Logfile then gem 'file-tail'; require 'file/tail' end File::Tail::Logfile.tail(file, :backward=>n) do |line| puts line end rescue Interrupt logger.trace "interrupted (Ctrl-C)" if logger end |
#upload(from, to) ⇒ Object
28 29 30 |
# File 'lib/capistrano_extensions/files/local.rb', line 28 def upload(from, to) cp from, to end |