PageRenderTime 208ms CodeModel.GetById 202ms app.highlight 3ms RepoModel.GetById 2ms app.codeStats 0ms

/tools/Rake/filelist.rb

http://github.com/agross/netopenspace
Ruby | 23 lines | 21 code | 2 blank | 0 comment | 1 complexity | 6d772dbd890f5013b7a702aff692bdb6 MD5 | raw file
 1class FileList
 2	def copy_hierarchy(attributes)
 3		self.each do |source|
 4			target = source.pathmap("%{^#{attributes[:source_dir]},#{attributes[:target_dir]}}p") 
 5			
 6			if File.directory? source
 7				FileUtils.cp_r \
 8					source,
 9					target.dirname,
10					:verbose => false,
11					:preserve => true
12				next
13			end
14			
15			FileUtils.mkdir_p target.dirname
16			FileUtils.cp \
17				source,
18				target,
19				:verbose => false,
20				:preserve => true
21		end
22	end
23end