123456789_123456789_123456789_123456789_123456789_

Class: Sprockets::Exporters::ZopfliExporter

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
Instance Chain:
Inherits: Sprockets::Exporters::ZlibExporter
Defined in: lib/sprockets/exporters/zopfli_exporter.rb

Overview

Generates a .gz file using the zopfli algorithm from the Zopfli gem.

Class Method Summary

Base - Inherited

.new

Public: Creates new instance.

Instance Attribute Summary

Instance Method Summary

ZlibExporter - Inherited

Base - Inherited

#call

Public: Contains logic for writing “exporting” asset to disk.

#setup

Public: Callback that is executed after initialization.

#skip?

Public: Handles logic for skipping exporter and notifying logger.

#write

Public: Yields a file that can be written to with the input.

Constructor Details

This class inherits a constructor from Sprockets::Exporters::Base

Instance Method Details

#setup

[ GitHub ]

  
# File 'lib/sprockets/exporters/zopfli_exporter.rb', line 8

def setup
  @gzip_target = "#{ target }.gz"
  @gzip = Sprockets::Utils::Gzip.new(asset, archiver: Utils::Gzip::ZopfliArchiver)
end