lib/capistrano_extensions/files/local.rb in joekhoobyar-capistrano-extensions-0.0.1 vs lib/capistrano_extensions/files/local.rb in joekhoobyar-capistrano-extensions-0.0.2
- old
+ new
@@ -26,12 +26,23 @@
private *%w(copy_entry copy_file copy_stream
remove_entry remove_entry_secure remove_file
compare_file compare_stream
uptodate?)
- class_eval(%w(exists? directory? executable?).map do |m|
- "def #{m}(f) File.#{m}(f) end"
- end.join("\n"))
+ def exists?(a, options={})
+ $stdout.puts "[ -f #{_q a} ] ]"
+ File.exists? a
+ end
+
+ def directory?(a, options={})
+ $stdout.puts "[ -d #{_q a} ]"
+ File.directory? a
+ end
+
+ def executable?(a, options={})
+ $stdout.puts "[ -x #{_q a} ]"
+ File.executable? a
+ end
end
end
end