Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix filter to return content #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion lib/nanoc/filters/gzip.rb
Expand Up @@ -9,11 +9,13 @@ class Gzip < Nanoc::Filter
type :text

def run(content, params = {})
Zlib::GzipWriter.open(output_filename, Zlib::BEST_COMPRESSION) do |gz|
out = StringIO.new
Zlib::GzipWriter.wrap(out, Zlib::BEST_COMPRESSION) do |gz|
gz.orig_name = File.basename(item[:filename])
gz.mtime = mtime.to_i
gz.write content
end
out.string
end

def mtime
Expand Down