Sha256: a76bad7138f125aab8a84a6f04415f4ecaf49042dd01d9dc2cfc3a6c9840fcac
Contents?: true
Size: 742 Bytes
Versions: 9
Compression:
Stored size: 742 Bytes
Contents
require 'sass' require 'uglifier' require 'front-compiler' module Alula module Compressors class CSSCompressor def compress(content) if content.count("\n") > 2 Sass::Engine.new(content, :syntax => :scss, :cache => false, :read_cache => false, :style => :compressed).render else content end end end class JSCompressor def compress(content) @@compressor ||= Uglifier.new @@compressor.compress(content) end end module HTMLCompressor def output_with_compression @@compressor ||= FrontCompiler.new @@compressor.compact_html(@output) end end end end
Version data entries
9 entries across 9 versions & 1 rubygems