Skip to content

Instantly share code, notes, and snippets.

@nono
Created April 21, 2012 17:18
Show Gist options
  • Select an option

  • Save nono/2438537 to your computer and use it in GitHub Desktop.

Select an option

Save nono/2438537 to your computer and use it in GitHub Desktop.
def long_filename
sha1 = File.read('sha1').chomp
"my_prog-#{sha1}"
end
file "archive.tgz" do
Rake::Task[:build].invoke
`tar cvzf archive.tgz #{long_filename}`
end
task :build => ["my_prog", "sha1"] do
cp "my_prog", long_filename
end
file "my_prog" => ["foo"] do
touch "my_prog"
end
file "sha1" do
`sha1sum foo | awk '{ print $1 }' > sha1`
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment