lib/capistrano_extensions/files/remote.rb in joekhoobyar-capistrano-extensions-0.0.5 vs lib/capistrano_extensions/files/remote.rb in joekhoobyar-capistrano-extensions-0.0.7
- old
+ new
@@ -2,14 +2,10 @@
module CapistranoExtensions
module Files
module Remote
- COMMANDS = [ %w(mkdir mkdir_p rmdir cp cp_r rm rm_r rm_rf
- chmod chmod_R chown chown_R touch),
- %w(ln ln_s ln_sf mv install) ]
-
COMMANDS.each_with_index do |l,n|
l.each do |m|
k, f = m.split('_')
f = ' -' + f if f
class_eval <<-EODEF, __FILE__, __LINE__
@@ -19,10 +15,18 @@
end
EODEF
end
end
+ FILE_TESTS.each do |m,t|
+ class_eval <<-EODEF
+ def #{m}(a, options={})
+ _t "test #{t}", a
+ end
+ EODEF
+ end
+
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
@@ -45,17 +49,9 @@
_r 'cd', dir
end
def pwd
capture('pwd', :via => _via)
- end
-
- FILE_TESTS.each do |m,t|
- class_eval <<-EODEF
- def #{m}(a, options={})
- _t "test #{t}", a
- end
- EODEF
end
private
def _t(cmd, args=nil, min=nil)