Sha256: e004ebbcd519bf549b3e392f8ef3e013e9e133794fa3c543704745d5ecb34bf8
Contents?: true
Size: 866 Bytes
Versions: 29
Compression:
Stored size: 866 Bytes
Contents
require 'sprockets/exporters/base' require 'sprockets/utils/gzip' module Sprockets module Exporters # Generates a `.gz` file using the zlib algorithm built into # Ruby's standard library. class ZlibExporter < Exporters::Base def setup @gzip_target = "#{ target }.gz" @gzip = Sprockets::Utils::Gzip.new(asset, archiver: Utils::Gzip::ZlibArchiver) end 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 def call write(@gzip_target) do |file| @gzip.compress(file, target) end end end end end
Version data entries
29 entries across 28 versions & 10 rubygems