Sha256: 993e27fb885ba0ff85618f6dc35abd7beab5475b8d1e58c74c4b4e4362272cfa

Contents?: true

Size: 324 Bytes

Versions: 205

Compression:

Stored size: 324 Bytes

Contents

require "zlib"

class GzipFilter < Nanoc::Filter
  identifier :gzip

  type text: :binary

  def run(content, params = {})
    Zlib::GzipWriter.open(output_filename, Zlib::BEST_COMPRESSION) do |gz|
      gz.orig_name = "index.html"
      gz.mtime = File.mtime(item[:filename]).to_i
      gz.write content
    end
  end

end

Version data entries

205 entries across 205 versions & 1 rubygems

Version Path
origen-0.54.3 templates/nanoc/lib/gzip_filter.rb
origen-0.54.2 templates/nanoc/lib/gzip_filter.rb
origen-0.54.1 templates/nanoc/lib/gzip_filter.rb
origen-0.54.0 templates/nanoc/lib/gzip_filter.rb
origen-0.53.1 templates/nanoc/lib/gzip_filter.rb
origen-0.53.0 templates/nanoc/lib/gzip_filter.rb
origen-0.52.4 templates/nanoc/lib/gzip_filter.rb
origen-0.52.3 templates/nanoc/lib/gzip_filter.rb
origen-0.52.2 templates/nanoc/lib/gzip_filter.rb
origen-0.52.1 templates/nanoc/lib/gzip_filter.rb
origen-0.52.0 templates/nanoc/lib/gzip_filter.rb
origen-0.51.3 templates/nanoc/lib/gzip_filter.rb
origen-0.51.2 templates/nanoc/lib/gzip_filter.rb
origen-0.51.1 templates/nanoc/lib/gzip_filter.rb
origen-0.51.0 templates/nanoc/lib/gzip_filter.rb
origen-0.50.0 templates/nanoc/lib/gzip_filter.rb
origen-0.44.0 templates/nanoc/lib/gzip_filter.rb
origen-0.43.0 templates/nanoc/lib/gzip_filter.rb
origen-0.42.2 templates/nanoc/lib/gzip_filter.rb
origen-0.42.1 templates/nanoc/lib/gzip_filter.rb