PageRenderTime 123ms CodeModel.GetById 119ms app.highlight 3ms RepoModel.GetById 0ms app.codeStats 1ms

/tools/Ruby/lib/ruby/gems/1.8/gems/rake-0.9.2/test/data/file_creation_task/Rakefile

http://github.com/agross/netopenspace
Rakefile | 31 lines | 24 code | 6 blank | 1 comment | 0 complexity | 1764b4d70c0b3ff27c53bf3740923653 MD5 | raw file
 1N = 2
 2
 3task :default => :run
 4
 5BUILD_DIR = 'build'
 6task :clean do
 7  rm_rf 'build'
 8  rm_rf 'src'
 9end
10
11task :run
12
13TARGET_DIR = 'build/copies'
14
15FileList['src/*'].each do |src|
16  directory TARGET_DIR
17  target = File.join TARGET_DIR, File.basename(src)
18  file target => [src, TARGET_DIR] do
19    cp src, target
20    # sleep 3 if src !~ /foo#{N-1}$/   # I'm commenting out this sleep, it doesn't seem to do anything.
21  end
22  task :run => target
23end
24
25task :prep => :clean do
26  mkdir_p 'src'
27  N.times do |n|
28    puts "DBG: Touching src/foo#{n}"
29    touch "src/foo#{n}"
30  end
31end