class Sprockets::Exporters::ZlibExporter
Ruby’s standard library.
Generates a ‘.gz` file using the zlib algorithm built into
def call
def call write(@gzip_target) do |file| @gzip.compress(file, target) end end
def setup
def setup @gzip_target = "#{ target }.gz" @gzip = Sprockets::Utils::Gzip.new(asset, archiver: Utils::Gzip::ZlibArchiver) end
def skip?(logger)
def skip?(logger) return true if environment.skip_gzip? return true if @gzip.cannot_compress? if ::File.exist?(@gzip_target) logger.debug "Skipping #{ @gzip_target }, already exists" true else logger.info "Writing #{ @gzip_target }" false end end