Sha256: a2d65bc2801a773541986acb683c5d706c6409ef7ce6c58e80a6431eb9e0bff7

Contents?: true

Size: 590 Bytes

Versions: 7

Compression:

Stored size: 590 Bytes

Contents

#!/usr/bin/env ruby

N = 2

task :default => :run

BUILD_DIR = 'build'
task :clean do
  rm_rf 'build'
  rm_rf 'src'
end

task :run

TARGET_DIR = 'build/copies'

FileList['src/*'].each do |src|
  directory TARGET_DIR
  target = File.join TARGET_DIR, File.basename(src)
  file target => [src, TARGET_DIR] do
    cp src, target
    # sleep 3 if src !~ /foo#{N-1}$/   # I'm commenting out this sleep, it doesn't seem to do anything.
  end
  task :run => target
end

task :prep => :clean do
  mkdir_p 'src'
  N.times do |n|
    puts "DBG: Touching src/foo#{n}"
    touch "src/foo#{n}"
  end
end

Version data entries

7 entries across 7 versions & 2 rubygems

Version Path
drake-0.9.0.0.3.0 test/data/file_creation_task/Rakefile
rake-0.9.0 test/data/file_creation_task/Rakefile
rake-0.9.0.beta.5 test/data/file_creation_task/Rakefile
rake-0.9.0.beta.4 test/data/file_creation_task/Rakefile
rake-0.9.0.beta.2 test/data/file_creation_task/Rakefile
rake-0.9.0.beta.1 test/data/file_creation_task/Rakefile
rake-0.9.0.beta.0 test/data/file_creation_task/Rakefile