Skip to content

Instantly share code, notes, and snippets.

@bobspryn
Created January 16, 2012 22:35
Show Gist options
  • Save bobspryn/1623400 to your computer and use it in GitHub Desktop.
Save bobspryn/1623400 to your computer and use it in GitHub Desktop.
Trying to create a gzip filter for rake-pipeline
class GzipFilter < Rake::Pipeline::Filter
processes_binary_files
def generate_output(inputs, output)
inputs.each do |input|
strio = StringIO.open('','w')
gz = Zlib::GzipWriter.new(strio)
gz.write(input.read)
gz.close
output.write strio.string
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment