module Sprockets::Compressing

def compressors

def compressors
  config[:compressors]
end

def css_compressor

Return CSS compressor or nil if none is set
def css_compressor
  if defined? @css_compressor
    @css_compressor
  end
end

def css_compressor=(compressor)

The compressor object must respond to `compress`.

Assign a compressor to run on `text/css` assets.
def css_compressor=(compressor)
  unregister_bundle_processor 'text/css', @css_compressor if defined? @css_compressor
  @css_compressor = nil
  return unless compressor
  if compressor.is_a?(Symbol)
    @css_compressor = klass = config[:compressors]['text/css'][compressor] || raise(Error, "unknown compressor: #{compressor}")
  elsif compressor.respond_to?(:compress)
    klass = LegacyProcProcessor.new(:css_compressor, proc { |context, data| compressor.compress(data) })
    @css_compressor = :css_compressor
  else
    @css_compressor = klass = compressor
  end
  register_bundle_processor 'text/css', klass
end

def gzip=(gzip)

on by default.
Enable or disable the creation of gzip files,
def gzip=(gzip)
  @gzip = gzip
end

def gzip?

def gzip?
  return @gzip if defined?(@gzip)
  true
end

def js_compressor

Return JS compressor or nil if none is set
def js_compressor
  if defined? @js_compressor
    @js_compressor
  end
end

def js_compressor=(compressor)

The compressor object must respond to `compress`.

Assign a compressor to run on `application/javascript` assets.
def js_compressor=(compressor)
  unregister_bundle_processor 'application/javascript', @js_compressor if defined? @js_compressor
  @js_compressor = nil
  return unless compressor
  if compressor.is_a?(Symbol)
    @js_compressor = klass = config[:compressors]['application/javascript'][compressor] || raise(Error, "unknown compressor: #{compressor}")
  elsif compressor.respond_to?(:compress)
    klass = LegacyProcProcessor.new(:js_compressor, proc { |context, data| compressor.compress(data) })
    @js_compressor = :js_compressor
  else
    @js_compressor = klass = compressor
  end
  register_bundle_processor 'application/javascript', klass
end

def register_compressor(mime_type, sym, klass)

def register_compressor(mime_type, sym, klass)
  self.config = hash_reassoc(config, :compressors, mime_type) do |compressors|
    compressors[sym] = klass
    compressors
  end
end

def skip_gzip?

def skip_gzip?
  !gzip?
end