Skip to content

Instantly share code, notes, and snippets.

@nanodeath
Created September 3, 2010 03:42
Show Gist options
  • Save nanodeath/563388 to your computer and use it in GitHub Desktop.
Save nanodeath/563388 to your computer and use it in GitHub Desktop.
x_file = "x.txt"
task :prepare_x do
bunch_of_files = calculate_all_upstream_files_slowly
bunch_of_files.each {|filename| file x_file => filename}
end
task :real_x => [x_file]
task :x => [:prepare_x, :real_x]
file "x.txt" => ["a.txt"]
file "x.txt" => ["b.txt"]
file "x.txt" => ["c.txt"]
file "x.txt" do
output = File.read("a.txt") + File.read("b.txt") + File.read("c.txt")
File.open("x.txt", "w") {|f| f.write(output) }
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment