Class: Stylo::PipelineSteps::StylesheetMinifying

Inherits:
Object
  • Object
show all
Defined in:
lib/stylo/pipeline_steps/stylesheet_minifying.rb

Instance Method Summary collapse

Instance Method Details

#call(response) ⇒ Object



4
5
6
7
8
9
# File 'lib/stylo/pipeline_steps/stylesheet_minifying.rb', line 4

def call(response)
  if Config.options[:css_minifying_enabled] and !Config::options[:css_minifying_exclusions].include?(response.path) and response.extension == '.css' and response.has_content?
    minified = CssMinifier.minify(response.body)
    response.set_body minified, :css
  end
end