lib/cfoundry/app.rb in cfoundry-0.1.0 vs lib/cfoundry/app.rb in cfoundry-0.1.1

- old
+ new

@@ -160,10 +160,20 @@ else @manifest["staging"]["runtime"] = v end end + def command + manifest["staging"]["command"] + end + + def command=(v) + @manifest ||= {} + @manifest["staging"] ||= {} + @manifest["staging"]["command"] = v + end + def memory manifest["resources"]["memory"] end def memory=(v) @@ -237,17 +247,36 @@ FileUtils.mkdir(to) files = Dir.glob("#{path}/{*,.[^\.]*}") - UPLOAD_EXCLUDE.each do |e| - files.delete e + exclude = UPLOAD_EXCLUDE + if File.exists?("#{path}/.vmcignore") + exclude += File.read("#{path}/.vmcignore").split(/\n+/) end + # prevent initial copying if we can, remove sub-files later + files.reject! do |f| + exclude.any? do |e| + File.fnmatch(f.sub(path + "/", ""), e) + end + end + FileUtils.cp_r(files, to) find_sockets(to).each do |s| File.delete s + end + + # remove ignored globs more thoroughly + # + # note that the above file list only includes toplevel + # files/directories for cp_r, so this is where sub-files/etc. are + # removed + exclude.each do |e| + Dir.glob("#{to}/#{e}").each do |f| + FileUtils.rm_rf(f) + end end end end RESOURCE_CHECK_LIMIT = 64 * 1024