/tools/Rake/filelist.rb
http://github.com/agross/netopenspace · Ruby · 23 lines · 21 code · 2 blank · 0 comment · 1 complexity · 6d772dbd890f5013b7a702aff692bdb6 MD5 · raw file
- class FileList
- def copy_hierarchy(attributes)
- self.each do |source|
- target = source.pathmap("%{^#{attributes[:source_dir]},#{attributes[:target_dir]}}p")
-
- if File.directory? source
- FileUtils.cp_r \
- source,
- target.dirname,
- :verbose => false,
- :preserve => true
- next
- end
-
- FileUtils.mkdir_p target.dirname
- FileUtils.cp \
- source,
- target,
- :verbose => false,
- :preserve => true
- end
- end
- end