Created
December 3, 2010 03:17
-
-
Save jmeridth/726535 to your computer and use it in GitHub Desktop.
rake zip task vs albacore zip task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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