Skip to content

Instantly share code, notes, and snippets.

@jmeridth
Created December 3, 2010 03:17
Show Gist options
  • Select an option

  • Save jmeridth/726535 to your computer and use it in GitHub Desktop.

Select an option

Save jmeridth/726535 to your computer and use it in GitHub Desktop.
rake zip task vs albacore zip task
# BY HAND
def create_zip(filename, root, excludes=/^$/)
root = root + "/" if root[root.length - 1].chr != "/"
Zip::ZipFile.open(filename, Zip::ZipFile::CREATE) do |zip|
Find.find(root) do |path|
next if path =~ excludes
zip_path = path.gsub(root, '')
zip.add(zip_path, path)
end
end
end
VS
#ALBACORE
zip do |zip|
zip.directories_to_zip "lib", "spec"
zip.additional_files = "README.markdown"
zip.output_file = 'source.zip'
zip.output_path = File.dirname(__FILE__)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment