Sha256: eb670c940d082f51304120d3b4a04690a2b5fe89d8ff131370df039187bddca1
Contents?: true
Size: 527 Bytes
Versions: 25
Compression:
Stored size: 527 Bytes
Contents
require 'tilt' module Sprockets class YUICompressor < Tilt::Template def self.engine_initialized? defined?(::YUI) end def initialize_engine require_template_library 'yui/compressor' end def prepare end def evaluate(context, locals, &block) case context.content_type when 'application/javascript' YUI::JavaScriptCompressor.new.compress(data) when 'text/css' YUI::CssCompressor.new.compress(data) else data end end end end
Version data entries
25 entries across 25 versions & 5 rubygems