Copy To A Target Directory And Filter Files
Join the DZone community and get the full member experience.Join For Free
# not the best code around but worked for my usage,... require 'fileutils' target = "../custom_code/" FileUtils.mkdir(target) unless File.exist?(target) require "rake" FileList['**/*.java'].each do |source| file_name = File.basename(source) target_dir = target + File.new(source).path.sub(file_name, '') makedirs target_dir cp_r source, target_dir + file_name, :verbose => true end
Opinions expressed by DZone contributors are their own.